错误码工具类

public enum MsgErrorCode {

TRA_SERVICE_OK("TRA00000","一切正常"),
//消费MQ成功
TRA_CACHE_SERVICE_OK("TRAC00000","cache一切正常"),
//查询接口成功
TRA_QUERY_SERVICE_OK("TRAQ00000","query一切正常"),
//客户
TRA_A_CLIENT_ERROR("TRAA0001","用户端错误"),				//一级宏观错误码
TRA_A_CLIENT_REGISTER("TRAA0100","用户注册错误"),			//二级宏观错误码
TRA_A_CLIENT_NOT_AGREED("TRAA0101","用户未同意隐私协议"),
TRA_A_CLIENT_REGIONAL_RESTRICTIONS("TRAA0102","注册国家或地区受限"),
TRA_A_CLIENT_NAME_VERIFICATION_FAILED("TRAA0110","用户名校验失败"),
TRA_A_CLIENT_PARAMETER_ERROR("TRAA0200","用户端参数错误"),	//二级宏观错误码

//系统

TRA_B_SYSTEM_ERROR("TRAB0001","系统执行出错"),				//一级宏观错误码
TRA_B_SYSTEM_INTERFACE_ERROR("TRAB0002","系统接口异常"),
TRA_B_SYSTEM_NULL_POINTER_ERROR("TRAB0003","空指针异常"),
TRA_B_SYSTEM_DATA_TYPE_IS_NULL_EXCEPTION("TRAB0004","数据类型为null异常"),
TRA_B_SYSTEM_TIMEOUT("TRAB0100","系统执行超时"),			//二级宏观错误码
TRA_B_SYSTEM_ORDER_TIMEOUT("TRAB0101","系统订单处理超时"),
TRA_B_SYSTEM_SCHEDULED_TASK_EXECUTION_FAILED("TRAB0102","定时任务执行失败"),
TRA_B_SYSTEM_DISASTER_TOLERANCE("TRAB0200","系统容灾功能被触发"),//二级宏观错误码
TRA_B_SYSTEM_CURRENT_LIMITING("TRAB0210","系统限流"),
TRA_B_SYSTEM_NETWORK_ERROR("TRAB0220","网络异常"),
TRA_B_SYSTEM_NON_WHITE_LIST_IP("TRAB0230","非白名单IP"),
TRA_B_SYSTEM_ERROR_GETTING_IP_ADDRESS("TRAB0231","获取IP地址错误"),
TRA_B_SYSTEM_ERROR_GETTING_LINUX_IP_ADDRESS("TRAB0232","获取linuxIP地址错误"),
TRA_B_SYSTEM_GET_CONFIG_ERROR("TRAB0233","获取环境配置信息错误"),
TRA_B_SYSTEM_CHINESE_PINYIN_ERROR("TRAB0300","汉语拼音错误"),	//三级宏观错误码
TRA_B_SYSTEM_CHINESE_PINYIN_INITIAL_ERROR("TRAB0301","汉语拼音首字母错误"),
TRA_B_SYSTEM_CHAR_CONVERT_EXCEPTION("TRAB0302","字符转换异常"),
TRA_B_SYSTEM__ANALYSIS_FILE_ERROR("TRAB0303","解析文件异常"),
TRA_B_SYSTEM_JSON_CONVERT_EXCEPTION("TRAB0304","Json转换异常"),

//svc
BGD_BILLING_SVC_UBMACAN_OK("UBMACAN000","SVC接口-getUidsByMobileAndCertAndName接口请求成功"),
BGD_BILLING_SVC_UBMACAN_ERROR("UBMACAN111","SVC接口-getUidsByMobileAndCertAndName接口请求错误"),
BGD_BILLING_SVC_FSPCBC_OK("FSPCBC000","SVC接口-findSvcPcCertificateByCert接口请求成功"),
BGD_BILLING_SVC_FSPCBC_ERROR("FSPCBC111","SVC接口-findSvcPcCertificateByCert接口请求错误"),
BGD_BILLING_SVC_GCBFN_OK("GCBFN000","SVC接口-getCustomerByFfpNo接口请求成功"),
BGD_BILLING_SVC_GCBFN_ERROR("GCBFN111","SVC接口-getCustomerByFfpNo接口请求错误"),

//服务
TRA_C_SERVICE_THIRD_PARTY_ERROR("TRAC0001","调用第三方服务错误"),			//一级宏观错误码
TRA_C_SERVICE_VERSION_WRONG ("TRAC0002","服务版本号错误"),

// TRA_C_SERVICE_VERSION_IS_INCONSISTENT (“TRAC0003”,“服务与本地版本号不一致”),
TRA_C_SERVICE_THIRD_PARTY_MIDDLEWARE_ERROR(“TRAC0100”,“中间件服务错误”), //二级宏观错误码
TRA_C_SERVICE_RPC_ERROR(“TRAC0110”,“RPC服务错误”),
TRA_C_SERVICE_RPC_NOT_FOUND(“TRAC0111”,“RPC服务未找到”),
TRA_C_SERVICE_RPC_UNREGISTERED(“TRAC0112”,“RPC服务未注册”),
TRA_C_SERVICE_INTERFACE_NOT_EXIST(“TRAC0113”,“接口不存在”),
TRA_C_SERVICE_DB_EXCEPTION(“TRAC0130”,“数据库服务异常”),
TRA_C_SERVICE_DB_CACHE_INVALID(“TRAC0131”,“数据库服务缓存失效”),
TRA_C_SERVICE_KEY_DOES_NOT_EXIST(“TRAC0140”,“密钥不存在”),
TRA_C_SERVICE_KEY_OBTAIN_EXCEPTION (“TRAC0141”,“密钥获取异常”),
TRA_C_SERVICE_SET_LOCK_EXCEPTION (“TRAC0142”,“设置锁异常”),
TRA_C_SERVICE_RELEASE_LOCK_EXCEPTION(“TRAC0143”,“释放锁异常”),
TRA_C_SERVICE_FTP_DOWNLOAD_CONNECTION_FAIL(“TRAC0201”,“FTP连接失败”),
TRA_C_SERVICE_FTP_DOWNLOAD_NOT_FOUND_FILE(“TRAC0202”,“FTP未找到文件”),
TRA_C_SERVICE_FTP_DOWNLOAD_READ_FAIL(“TRAC0203”,“FTP文件读取错误”),
TRA_C_SERVICE_FTP_IP_CONFIG_FAIL(“TRAC0204”,“FTP的IP地址错误”),
TRA_C_SERVICE_FTP_PORT_CONFIG_FAIL(“TRAC0205”,“FTP的端口错误”),
TRA_C_SERVICE_FTP_CONFIG_FAIL(“TRAC0205”,“FTP配置错误”),
TRA_C_SERVICE_MESSAGE_ERROR(“TRAC0206”,“消息服务错误”), //三级宏观错误码
TRA_C_SERVICE_FILE_DOWNLOAD_ERROR(“TRAC0207”,“下载文件异常错误”),
TRA_C_SERVICE_UPDATE_ERROR(“TRAC0208”,“更新数据错误”),
TRA_C_SERVICE_SAVE_ERROR(“TRAC0209”,“保存数据失败”),
TRA_C_SERVICE_QUERY_ERROR(“TRAC0210”,“查询数据异常”),
TRA_C_SERVICE_PUSH_MQ_FAIL(“TRAC0211”,“MQ推送失败”),
TRA_C_SERVICE_MISSING_PARAMETER(“TRAC0212”,“请求参数为空”),
TRA_C_SERVICE_ILLEGAL_PARAMETER(“TRAC0213”,“非法参数”),
TRA_C_SERVICE_INVALID_DATE(“TRAC0214”,“日期格式错误”),
TRA_C_SERVICE_RANGE_DATE_ERROR(“TRAC0215”,“日期范围有误”),
TRA_C_SERVICE_BEYOND_PARAMETER(“TRAC0216”,“请求参数超出限定值”)
;

private String code;
private String msg;

private MsgErrorCode(String code,String msg){
	this.code=code;
    this.msg=msg;
}

public String getMsg(){
    return this.msg;
}

public String getCode(){
  return this.code;
}

}

你可能感兴趣的:(servlet,java,dreamweaver)