package com.fs.common.constant;

import io.jsonwebtoken.Claims;

/**
 * 通用常量信息
 *

 */
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 = "Bearer ";


    /**
     * 令牌前缀 企业端
     */
    public static final String COMPANY_LOGIN_USER_KEY = "company_login_user_key";
    public static final String COMPANY_IM_LOGIN_USER_KEY = "company_im_login_user_key";

    /**
     * 登录用户 redis key 企业端
     */
    public static final String COMPANY_LOGIN_TOKEN_KEY = "company_login_tokens:";
    public static final String COMPANY_IM_LOGIN_TOKEN_KEY = "company_im_login_tokens:";

    /**
     * 令牌前缀 企业端
     */
    public static final String HOSPITAL_LOGIN_USER_KEY = "hospital_login_user_key";

    /**
     * 登录用户 redis key 企业端
     */
    public static final String HOSPITAL_LOGIN_TOKEN_KEY = "hospital_login_tokens:";
    /**
     * 令牌前缀
     */
    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 static final Integer PAGE_SIZE =10;
    /**
     * CID 执行任务ID
     */
    public static final String TASK_ID = "cid:task:";
    /**
     * 外呼机器人打电话
     */
    public static final String CELL_PHONE = "cellPhone";
    /**
     * 添加微信
     */
    public static final String ADD_WX = "addWx";
    /**
     * 企微添加个微
     */
    public static final String QW_ADD_WX = "qwAddWx";
    /**
     * 发送短信
     */
    public static final String SEND_MSG = "sendMsg";
    /**
     * CID 执行下一个 roboticID + calleesId
     */
    public static final String CID_NEXT_TASK_ID = "cid:next:task:";

    /**
     * 工作流加微超时检测 Key: workflow:addwx:timeout:{workflowInstanceId}:{wxClientId}
     * Value: 超时时间戳
     */
    public static final String WORKFLOW_ADD_WX_TIMEOUT = "workflow:addwx:timeout:";

    /**
     * 工作流加微执行状态标记 Key: workflow:addwx:executed:{workflowInstanceId}:{wxClientId}
     * Value: 1-已执行
     * 用于实现回调成功和超时互斥，只执行一个
     */
    public static final String WORKFLOW_ADD_WX_EXECUTED = "workflow:addwx:executed:";
    /**
     * 工作流企微加个微执行状态标记 Key: workflow:addwx:executed:{workflowInstanceId}:{wxClientId}
     * Value: 1-已执行
     * 用于实现回调成功和超时互斥，只执行一个
     */
    public static final String WORKFLOW_QW_ADD_WX_EXECUTED = "workflow:qwaddwx:executed:";
    /**
     * 工作流企微加个微超时检测 Key: workflow:addwx:timeout:{workflowInstanceId}:{wxClientId}
     * Value: 超时时间戳
     */
    public static final String WORKFLOW_QW_ADD_WX_TIMEOUT = "workflow:qwaddwx:timeout:";
}
