package com.microservices.wiki.refactoring.constant;

import java.util.HashMap;
import java.util.Map;

/**
 * 系统常量
 *
 * @author David
 */
public class Constants {
    public static final String CHARSET_URF8 = "UTF-8";

    public static final String COOKIE_NAME = "autologin_trustie";
    public static final String TOKEN_ACTION = "autologin";
    public static final String MAIL_REG = "^[a-zA-Z0-9]+([.\\-_\\\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$";
    public static final String PHONE_REG = "^1\\d{10}$";

    public static final Byte TXT_FILE = 1;
    public static final Byte VIDEO_FILE = 2;
    public static final Byte IMG_FILE = 3;
    public static final Byte APP_FILE = 4;
    public static final Byte OTHER_FILE = 5;

    public static final Map<String, Byte> FILE_TYPE_MAP = new HashMap<String, Byte>() {
        {
            put(".jpg", IMG_FILE);
            put(".png", IMG_FILE);
            put(".jpeg", IMG_FILE);
            put(".mp4", VIDEO_FILE);
            put(".txt", TXT_FILE);
            put(".doc", TXT_FILE);
            put(".docx", TXT_FILE);
            put(".xls", TXT_FILE);
            put(".xlsx", TXT_FILE);
            put(".exe", APP_FILE);
        }
    };


}

