T31 错误码设计

public enum ErrorCodeEnum {

    SUCCESS("00000", "成功","操作成功"),
    USER_ERROR_A0100("A0100", "用户注册错误","注册失败,请重新注册!"),
    USER_ERROR_A0101("A0101", "用户未同意隐私协议","注册失败,请重新注册!"),
    USER_ERROR_A0102("A0102", "用户名已存在","用户名已存在,请重新注册!"),
    USER_ERROR_A0103("A0103", "手机格式校验失败","手机号错误,请重新注册!"),
    USER_ERROR_A0104("A0104", "地址格式校验失败","地址错误,请重新注册!"),
    USER_ERROR_A0105("A0105", "邮箱格式校验失败","邮箱错误,请重新注册!"),
    USER_ERROR_A0106("A0106", "密码校验失败","密码确认错误,请重新注册!"),
    USER_ERROR_A0107("A0107", "密码长度不够","密码长度不够,请重新注册!"),
    USER_ERROR_A0108("A0108", "用户证件类型未选择","请选折证件类型!"),
    USER_ERROR_A0109("A0109", "大陆身份证编号校验非法","身份证错误,请重新注册!"),
    USER_ERROR_A0200("A0200", "用户登录异常","登录异常,请联系管理员!"),
    USER_ERROR_A0201("A0201", "验证码错误","验证码错误,请重新登录!"),
    USER_ERROR_A0202("A0202", "用户密码错误","密码错误,请重新登录!"),
    USER_ERROR_A0203("A0203", "用户登陆已过期","登录过期,请重新登录!"),
    USER_ERROR_A0204("A0204", "黑名单用户","账号被冻结,请联系管理员!"),
    USER_ERROR_A0205("A0205", "用户名不存在","用户名不存在,请重新登录!"),
    USER_ERROR_A0206("A0206", "访问权限异常","权限异常,请联系管理员!"),
    ORDER_ERROR_A0300("A0300", "订单异常","订单异常,请联系管理员!"),
    ORDER_ERROR_A0301("A0301", "用户订单号为空","订单号为空!"),
    ORDER_ERROR_A0302("A0302", "订购数量为空","订购数量为空!"),
    ORDER_ERROR_A0303("A0303", "数量超出限制","数量超出限制!"),
    ORDER_ERROR_A0304("A0304", "缺少时间戳参数","缺少时间戳参数!"),
    ORDER_ERROR_A0305("A0305", "非法的时间戳参数","非法的时间戳参数!"),
    ORDER_ERROR_A0306("A0306", "订单已关闭","订单已关闭!"),
    PAY_ERROR_A0400("A0400", "支付异常","支付异常,请联系管理员!"),
    PAY_ERROR_A0401("A0401", "用户支付超时","支付超时!"),
    PAY_ERROR_A0402("A0402", "账户余额不足","余额不足!"),
    SYSTEM_ERROR_B0000("B0000","系统执行出错","系统错误,请联系管理员!"),
    SYSTEM_ERROR_B0001("B0001","系统执行超时","系统繁忙,请重试!"),
    SERVICE_ERROR_C0001("C0001","调用第三方服务出错","调用第三方服务出错,请联系管理员!"),
    SERVICE_ERROR_C0002("C0002","中间件服务出错","服务故障,请联系管理员!"),
    SERVICE_ERROR_C0003("C0003", "消息服务出错","消息服务出错!"),
    SERVICE_ERROR_C0004("C0004", "消息投递出错","消息投递出错!"),
    SERVICE_ERROR_C0005("C0005", "消息消费出错","消息消费出错!"),
    SERVICE_ERROR_C0006("C0006", "消息订阅出错","消息订阅出错!"),
    SERVICE_ERROR_C0007("C0007","第三方系统执行超时","系统超时,请重试!"),
    SERVICE_ERROR_C0008("C0008","数据库服务出错","连接异常,请联系管理员!");

    /**
     * 错误码
     */
    private final String code;
    /**
     * 错误消息
     */
    private final String message;
    /**
     * userTips
     */
    private final String userTips;

    ErrorCodeEnum(String code, String message, String userTips) {
        this.code = code;
        this.message = message;
        this.userTips = userTips;
    }

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public String getUserTips() {
        return userTips;
    }
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值