package com.yxcheng.token.constants;

public class RedisContants {
    //获取token请求次数
    public static String TOKEN_REQ_TIMES = "taxsys:token:reqTimes:";

    public static String TOKEN_SIGNDATA_TIMES = "taxsys:token:signData:";

    public static String TOKEN_ZONE_IS_NEW = "taxsys:token:zoneIsNew:";

    public static String TOKEN_WEB_SOCKET = "taxsys:token:websocket:";
    public static String TOKEN_WEB_SOCKET_GETSIGN = "taxsys:token:websocket:getSign:";
    public static String TOKEN_WEB_SOCKET_ISONLINE = "taxsys:token:socketIsOnline";

    public static String TOKEN_TIMEOUT_TIMES = "taxsys:token:timeoutTimes";

    //获取日期列表
    public static String SIGN_DATE_LIST = "taxsys:sign:dateList:";

    //获取百望税号列表
    public static String SIGN_TAXNO_LIST = "sign:taxno:list:";

    public static String SIGN_IP_LIST = "sign:ip:list:";


    //获取token定时任务锁
    public static String GET_TOKEN_SCHEDULED_LOCK = "taxsys:token:SynGetTokenJob";

    public static int GET_TOKEN_SCHEDULED_EXPIRE = 60 * 30;


    //获取token定时任务锁
    public static String SYNC_TAXNO_SCHEDULED_LOCK = "taxsys:sign:SyncTaxnoServiceJob";

    public static int SYNC_TAXNO_SCHEDULED_EXPIRE = 5*60-2;

    //获取token定时任务锁
    public static String SYNC_DATE_INFO_LOCK = "taxsys:sign:SynDateInfoJob";

    public static int SYNC_DATE_INFO_SCHEDULED_EXPIRE = 24*60*60-2;


    //获取token定时任务锁
    public static String SYN_GET_SERVERDATE_SCHEDULED_LOCK = "taxsys:sign:SynGetServerDate4ZoneJob";

    public static int SYN_GET_SERVERDATE_SCHEDULED_EXPIRE = 60*60-2;

    public static String DELIMITER = ":";


    public static String NUONUO_TOKEN_TYPE = "taxsys:token:NNtokenType:";

    //用户校验key
    public static String CHECK_USER = "taxsys:user:checkuser:";

    public static String CHECK_FULLINFO = "taxsys:user:fullInfo:";

    public static String CHECK_FUNCTION = "taxsys:user:function:";

    public static String CHECK_RULE = "taxsys:user:rule:";

    public static String CHECK_RULE_IP = "taxsys:user:rule:ip:";

    public static String CHECK_USER_TAXNO = "taxsys:user:usertaxno:";

    public static String SCAN_VERIFY_CODE = "taxsys:scan:verifycode:";

    public static String SCAN_VERIFY_LIMIT = "taxsys:scan:verifylimit:";

    public static String SCAN_VERIFY_CODE_CONFIG = "taxsys:scan:verifycodeConfig";

    public static String CHECK_SIGNATURENONCE = "taxsys:user:signatureNonce:";



    //文件申请
    public static String FILE_APPLY_LOCK = "taxsys:file:fileApply:";
    public static String FILE_APPLY_TIMES_LOCK = "taxsys:file:fileApply:times:";
    public static String FILE_TOKEN_LOCK = "taxsys:file:token:";
    public static String FILE_TOKEN_STATUS = "taxsys:file:token:status:";
    public static String FILE_APPLY_ALARM = "taxsys:file:apply:alarm:";
    //文件下载
    public static String FIX_DOWN_FILE_LOCK = "taxsys:file:fixDownFile:";
    public static String DOWN_FILE_TIMES_LOCK = "taxsys:file:downFile:times:";
    public static String INCOME_FILEID_LOCK = "taxsys:file:incomeFileId:";
    //区域管理
    public static String ZONE_CODE = "taxsys:zone:code:";
    public static String ELE_ZONE_CODE = "taxsys:ele:zone:code:";

    public static String FILE_DOWN_MINIO_ERROR_COUNT = "taxsys:file:downFile:minio:error:count";

    public static String USER_GROUP_ID = "taxsys:token:user:groupId:";

    public static String TOKEN_REALREQUEST_COUNT = "taxsys:token:realRequest:count:";



    public static String getCheckRulesByUser(String userName) {
        return RedisContants.CHECK_RULE + userName;
    }

    public static String getCheckTaxnosByUser(String userName, String functionCode, String taxno) {
        return RedisContants.CHECK_USER_TAXNO + userName
                + RedisContants.DELIMITER + functionCode
                + RedisContants.DELIMITER + taxno;
    }

    public static String getLimitName(String functionName, String userName, String taxno) {
        return functionName + RedisContants.DELIMITER + userName + RedisContants.DELIMITER + taxno;
    }
}
