Constants.java 3.29 KB
Newer Older
m1991's avatar
m1991 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
package cn.wisenergy.common.utils;

/***
 * 系统中保存的一些常量
 */
/**
 * Created by m1991 on 2021/2/28 22:50
 */
public class Constants {
    //通用常量
    public static class Common{
        //否
        public final static Integer NOT = 0;
        //是
        public final static Integer YES = 1;
        //女
        public final static Integer SEX_WOMEN = 0;
        //男
        public final static Integer SEX_MAN = 1;
        //数据精度
        public final static Integer DECIMAL_DIGITS = 2;
    }
    //访问来源
    public static class SourceType{
        //访问来源-APP
        public final static Integer APP = 0;
        //访问来源-PC
        public final static Integer PC = 1;
    }
    //连接符
    public static class Connnector{
        //逗号
        public final static String COMMA_ = ",";
        //下划线
        public final static String UNDERLINE = "_";
        //冒号
        public final static String COLON=":";
    }
    //时长
    public static class Duration{
        //一秒
        public final static Integer SECOND_INT = 1;
        //一分钟
44
        public final static Integer MINUTE_INT = SECOND_INT * 180;
m1991's avatar
m1991 committed
45 46
        //半小时
        public final static Integer HALF_HOUR_INT = MINUTE_INT * 30;
47 48
        //十小时
        public final static Integer TEN_HOURS_HOUR_INT = HALF_HOUR_INT * 20;
m1991's avatar
m1991 committed
49 50 51 52
    }
    //正则的一些常量
    public static class RegConstant{
        //手机号正则
53
        public static String PHONE_REGSTR = "^1[0-9]{10}$";
m1991's avatar
m1991 committed
54 55 56 57 58 59
        //密码正则
        public static String PASSWORD_REGSTR = "^([A-Z]|[a-z]|[0-9]|[_]){6,10}$";
    }
    //SMS相关常量
    public static class Sms{
        public static class TemplateCode{
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
            //对存入redis的tokn用户进行标注
            public static String LOGIN_BZ_REGISTER="xts";
            //身份验证验证码
            public static String LOGIN_SF_REGISTER="SMS_212170059";
            //登录确认验证码
            public static String LOGIN_DL_REGISTER="SMS_212170058";
            //登录异常验证码
            public static String LOGIN_DLYC_REGISTER="SMS_212170057";
            //用户注册验证码
            public static String LOGIN_ZC_REGISTER="SMS_212170056";
            //修改密码验证码
            public static String LOGIN_XGMM_REGISTER= "SMS_212170055";
           // 信息变更验证码
            public static String LOGIN_XXBG_REGISTER= "SMS_212170054";

m1991's avatar
m1991 committed
75 76 77 78 79 80 81 82 83 84 85 86 87
        }

        public static class CodeType{
            public static Integer LOGIN_OR_REGISTER=0;
            public static Integer PASS_UPDATE=1;
            public static Integer ORDER_NOTICE=2;
        }
    }
    //RedisKey相关的常量
    public static class RedisKey{
        public static String PROJECT_PRIFIX="xts";
        public static String SMS_PRIFIX="sms";
        public static String TOKEN_PRIFIX="token";
88
        public static String BANK_PRIFIX="bank";
m1991's avatar
m1991 committed
89
    }
m1991's avatar
m1991 committed
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
    /**
     * redis常量
     */
    public static class Redis{
        /**
         * 项目公共 前缀
         */
        public final static String PREFIX = "xts";

        /**
         * 短信相关
         */
        public final static String PREFIX_SMS = "sms:";

        /**
         * token相关
         */
        public final static String PREFIX_TOKEN = "token:";

    }
m1991's avatar
m1991 committed
110
}