package com.sw.common.accessory.constants;

import io.jsonwebtoken.Claims;

import java.util.Arrays;
import java.util.List;

/**
 * 通用常量信息
 *
 * @author liru
 */
public class Constants
{
    /**
     * UTF-8 字符集
     */
    public static final String UTF8 = "UTF-8";

    /**
     * GBK 字符集
     */
    public static final String GBK = "GBK";

    /**
     * http请求
     */
    public static final String HTTP = "http://";

    /**
     * https请求
     */
    public static final String HTTPS = "https://";

    /**
     * 通用成功标识
     */
    public static final String SUCCESS = "0";

    /**
     * 通用失败标识
     */
    public static final String FAIL = "1";

    /**
     * 登录成功
     */
    public static final String LOGIN_SUCCESS = "Success";

    /**
     * 注销
     */
    public static final String LOGOUT = "Logout";

    /**
     * 注册
     */
    public static final String REGISTER = "Register";

    /**
     * 登录失败
     */
    public static final String LOGIN_FAIL = "Error";

    /**
     * 验证码 redis key
     */
    public static final String CAPTCHA_CODE_KEY = "captcha_codes:";

    /**
     * 登录用户 redis key
     */
    public static final String LOGIN_TOKEN_KEY = "login_tokens:";

    /**
     * 防重提交 redis key
     */
    public static final String REPEAT_SUBMIT_KEY = "repeat_submit:";

    /**
     * 限流 redis key
     */
    public static final String RATE_LIMIT_KEY = "rate_limit:";

    /**
     * 验证码有效期（分钟）
     */
    public static final Integer CAPTCHA_EXPIRATION = 2;

    /**
     * 令牌
     */
    public static final String TOKEN = "token";

    /**
     * 令牌前缀
     */
    public static final String TOKEN_PREFIX = "BearerJk ";

    /**
     * 令牌前缀
     */
    public static final String LOGIN_USER_KEY = "login_user_key";

    /**
     * 用户ID
     */
    public static final String JWT_USERID = "userid";

    /**
     * 用户名称
     */
    public static final String JWT_USERNAME = Claims.SUBJECT;

    /**
     * 用户头像
     */
    public static final String JWT_AVATAR = "avatar";

    /**
     * 创建时间
     */
    public static final String JWT_CREATED = "created";

    /**
     * 用户权限
     */
    public static final String JWT_AUTHORITIES = "authorities";

    /**
     * 参数管理 cache key
     */
    public static final String SYS_CONFIG_KEY = "sys_config:";

    /**
     * 字典管理 cache key
     */
    public static final String SYS_DICT_KEY = "sys_dict:";

    /**
     * 资源映射路径 前缀
     */
    public static final String RESOURCE_PREFIX = "/profile";

    /**
     * RMI 远程方法调用
     */
    public static final String LOOKUP_RMI = "rmi://";

    /**
     * LDAP 远程方法调用
     */
    public static final String LOOKUP_LDAP = "ldap://";

    public final static String USER_ID = "user_id";
    public final static String USER_NAME = "user_name";
    /**
     * 班次
     */
    public final static String USER_CLASS_NO = "user_class_no";

    /**
     * 班组
     */
    public final static String USER_TEAM_GROUP = "user_team_group";

    /**
     * 动态查询，参数前缀
     */
    public final static String SEARCH_PREFIX = "search_";

    /**
     * 内部动态查询参数常量
     */
    public final static String NEST_DYNAMIC_SEARCH = "$nest_dynamic_search$";

    /**
     * 递增的排序方式
     */
    public final static String ORDER_DIRECTION_ASC = "ASC";
    /**
     * 递减的排序方式
     */
    public final static String ORDER_DIRECTION_DESC = "DESC";

    public final static Integer EXPROT_ROWS = 2000;

    public final static Integer NUMBER_OF_CUTS = 1;

    public final static String[] englishArr = {"*", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"};

    public final static String WEIGHT_RATIO = "WeightRatio";
    public final static String THEORETICAL_WEIGHT_COEFFICIENTFB = "TheoreticalWeightCoefficientFb";

    public final static String CRACK = "裂纹";

    public final static String DISLOCATION = "位错";

    public final static String REC_MATERIALS = "回收料";

    public final static String CRYSTAL_SEGMENT = "晶段";


    public final static String TRIAL_PROCESS = "试加工";

    /**
     * 托盘绑定点位
     */
    public final static String BIND_SITE = "BindSite";

    public static String USER_ENABLE = "enable";
    public static String USER_DISABLE = "disable";
    public static String USER_ORIGINAL = "original";
    public static String USER_ROLES = "user_roles";
    public static String USER_PERMISSIONS = "user_permissions";
    public static String USER_PERMISSION_CODES = "user_permission_codes";
    public static String PUSH_TOPICS="push_topics";
    public static String PUSH_PERMISSION="push";


    public final static String FB_BIND_SITE = "FbBindSite";
    //圆棒回收料
    public final static String RECYCLED_MATERIAL_Y = "回收料Y";
    //方棒回收料
    public final static String RECYCLED_MATERIAL_F = "回收料F";

    //圆棒反切原因
    public final static String YB_RECUT_TYPE = "YbRecutType";

    //回收料集合
    public final static List<String> MATERIAL_RECYCLED_ASSESSMENT_LIST = Arrays.asList("无有效长度","吊多晶");
}
