[测评系统]--测评系统核心代码库
linzhijie
2021-03-11 3cfd98ba9e99e68b9ff43e35a8befd90a48e1ab7
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
package com.ots.common.enums;
import cn.hutool.core.util.StrUtil;
import com.ots.project.common.exception.BusinessExceptionAssert;
import lombok.Getter;
@Getter
public enum ResponseCode implements BusinessExceptionAssert {
    
    SUCCESS(1, "成功!"),
    TEST_URL_FAIL(3, "评测地址已经失效!"),
    TEST_TOKEN_FAIL(4, "访问令牌已经失效,请重新申请!"),
    TEST_MEMBERINFO_EMPTY(5, "评测用户没有填写人口学变量信息!"),
    MISSING_PARAMETERS(6, "请求参数[{0}]缺失!"),
    TEST_MEMBER_EMPTY(7, "邀请评测用户为空!"),
    TEST_SEND_ERROR(8, "模板发送参数【链接地址】没有按要求填写!"),
    TEL_IS_NOLL(88,"用户手机号为空,不能发送短信邀请!"),
    USER_EXTEND_EMPTY(9,"[{0}]用户未分配使用次数,请联系管理员分配!"),
    USER_PACKAGE_EMPTY(10,"[{0}]用户没有测试包数据!"),
    USR_TIME_ISOVER(11,"[{0}]用户使用次数不足,请联系分销商增加!"),
    ERROR_MESSAGE_CHECK(111, "[{0}]!"),
    ERROR_RECOVER(12,"没有可回收的用户!"),
    ;
    private int code;
    private String message;
    ResponseCode(int code, String message) {
        this.code = code;
        this.message = message;
    }
    public String getCodeStr() {
        return String.valueOf(code);
    }
    public String getFormat(Object... str) {
        return StrUtil.format(this.getMessage(), str);
    }
}