package com.xinelu.common.constant;

import io.jsonwebtoken.Claims;

/**
 * 通用常量信息
 *
 * @author xinelu
 */
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";

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

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

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

    /**
     * 令牌前缀
     */
    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";

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

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

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

    /**
     * LDAPS 远程方法调用
     */
    public static final String LOOKUP_LDAPS = "ldaps:";

    /**
     * 定时任务白名单配置（仅允许访问的包名，如其他需要可以自行添加）
     */
    public static final String[] JOB_WHITELIST_STR = {"com.xinelu"};

    /**
     * 定时任务违规的字符
     */
    public static final String[] JOB_ERROR_STR = {"java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
            "org.springframework", "org.apache", "com.xinelu.common.utils.file"};

    /**
     * 图片上传文件带.的
     */
    public static final String FILE_NAME_SPOT = ".";

    /**
     * 字符串空格标识
     */
    public static final String EMPTY = " ";

    /**
     * Excel文件格式后缀
     */
    public static final String XLSX = "xlsx";

    /**
     * Excel文件格式后缀
     */
    public static final String XLS = "xls";

    /**
     * 机构类别编码前缀
     */
    public static final String CATEGORY_CODE = "CC";

    /**
     * 机构信息导入标识
     */
    public static final String AGENCY = "agency";

    /**
     * 科室信息导入标识
     */
    public static final String DEPARTMENT = "department";

    /**
     * 手术编号
     */
    public static final String SURGERY_ENCODING = "SE";

    /**
     * 服务方式编码
     */
    public static final String SERVICE_MODE_ENCODING = "SME";

    /**
     * 任务类型编码
     */
    public static final String TASK_TYPE_CODE = "TTC";

    /**
     * 任务细分编码
     */
    public static final String TASK_PARTITION_CODE = "TPC";

    /**
     * 任务状态编码
     */
    public static final String TASK_STATUS_CODE = "TSC";

    /**
     * 机构代码编码
     */
    public static final String AGENCY_CODE = "AYC";

    /**
     * 科室病种编码
     */
    public static final String DISEASE_TYPE_CODE = "DTC";

    /**
     * 任务状态编码
     */
    public static final String DEPARTMENT_CODE = "DTC";

	/**
	 * 宣教编码
	 */
	public static final String PROPAGANDA_INFO_CODE = "PIC";

    /**
     * 门诊患者
     */
    public static final String OUTPATIENT = "outpatient";

    /**
     * 患者导入
     */
    public static final String PATIENT_INFO_IMPORT = "patientInfoImport";

    /**
     * 患者导入
     */
    public static final String BATCH_SEND_TASK_INFO = "batchSendTaskInfo";

    /**
     * 预住院
     */
    public static final String PRE_HOSPITALIZED = "prehospitalized";

    /**
     * 在院
     */
    public static final String IN_HOSPITAL = "inhospital";

    /**
     * 出院
     */
    public static final String DISCHARGED = "discharged";

    /**
     * 字段信息编码前缀
     */
    public static final String FIELD_ENCODING = "FE";

    /**
     * 字段内容编码前缀
     */
    public static final String CONTENT_ENCODING = "CE";

    /**
     * 路径编码
     */
    public static final String ROUTE_CODE = "RC";

    /**
     * 常用术语编码
     */
    public static final String TERM_CODE = "TC";

    /**
     * 院后微信小程序accessToken的redis的键前缀
     */
    public static final String WE_CHAT_APPLET_ACCESS_TOKEN = "WE_CHAT_APPLET_ACCESS_TOKEN_";

    /**
     * 院后微信公众号accessToken的redis的键前缀
     */
    public static final String WE_CHAT_OFFICIAL_ACCOUNT_ACCESS_TOKEN = "WE_CHAT_OFFICIAL_ACCOUNT_ACCESS_TOKEN_";

    /**
     * 获取微信小程序和微信公众号accessToken的url地址
     */
    public static final String WE_CHAT_ACCESS_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential";

    /**
     * 微信公众号模板消息推送发送接口地址
     */
    public static final String OFFICIAL_ACCOUNT_TEMPLATE_SEND_URL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=";

    /**
     * 微信小程序模板消息推送发送接口地址
     */
    public static final String OFFICIAL_ACCOUNT_SUBSCRIBE_SEND_URL = "https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=";

    /**
     * 获取 access_token 时 AppSecret 错误，或者 access_token 无效。请开发者认真比对 AppSecret 的正确性，或查看是否正在为恰当的公众号调用接口
     */
    public static final int INVALID_CREDENTIAL_ACCESS_TOKEN_ISINVALID_OR_NOT_LATEST = 40001;

    /**
     * 不合法的 OpenID ，请开发者确认 OpenID （该用户）是否已关注公众号，或是否是其他公众号的 OpenID
     */
    public static final int INVALID_OPENID = 40003;

    /**
     * 不合法的 access_token ，请开发者认真比对 access_token 的有效性（如是否过期），或查看是否正在为恰当的公众号调用接口
     */
    public static final int INVALID_ACCESS_TOKEN = 40014;

    /**
     * 不合法的 template_id
     */
    public static final int INVALID_TEMPLATE_ID = 40037;

    /**
     * 用户拒接订阅
     */
    public static final int DENY_SUBSCRIPTION = 43101;

    /**
     * 参数无效
     */
    public static final int ARGUMENT_INVALID = 47003;

    /**
     * api功能未授权
     */
    public static final int API_UNAUTHORIZED = 48001;

    /**
     * 成功
     */
    public static final int SUCCESS_ERROR_CODE = 0;

    /**
     * 院后微信小程序登录接口地址
     */
    public static final String APPLET_LOGIN_URL = "https://api.weixin.qq.com/sns/jscode2session";

    /**
     * 微信小程序ACCESS_TOKEN前缀
     */
    public static final String POST_DISCHARGE_APPLET_ACCESS_TOKEN = "POST_Discharge_APPLET_ACCESS_TOKEN_";

    /**
     * 返回成功状态码
     */
    public static final int SUCCESS_CODE = 0;

    /**
     * 院后微信小程序获取用户手机号接口地址
     */
    public static final String PHONE_NUMBER_URL = "https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=";

    /**
     * 获取微信小程序access_token错误码
     */
    public static final int ERROR_ACCESS_CODE = 40001;

    /**
     * 返回成功状态码
     */
    public static final String OK = "ok";

    /**
     * 资讯分类编码前缀
     */
    public static final String INFO_CATEGORY_CODE = "ICC";

    /**
     * 资讯编码前缀
     */
    public static final String INFO_CODE = "IC";

    /**
     * 泉医微信小程序ACCESS_TOKEN前缀(测试使用)
     */
    public static final String NURSE_STATION_APPLET_ACCESS_TOKEN = "NURSE_STATION_APPLET_ACCESS_TOKEN";

    /**
     * 常用术语最大层数
     */
    public static final Long TERM_MAX_LEVEL = 3L;

    /**
     * 常用术语最小层数
     */
    public static final Long TERM_MIN_LEVEL = 1L;

    /**
     * 登录发送短信验证冷却键前缀
     */
    public static final String SMS_COOL_DOWN ="SMS_COOL_DOWN_";

    /**
     * 登录发送短信验证冷却键对应的值
     */
    public static final String SMS_COOL_DOWN_VALUE ="COOL_DOWN";


    /**
     * 登录发送短信验证前缀
     */
    public static final String SMS_CODE ="SMS_CODE_";

    /**
     * 医院时间配置
     */
    public static final String DIAL_TIME ="dial_time";

    /**
     * 账单代码编码
     */
    public static final String BILL_CODE = "AYC";
}
