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); } }