package com.storlead.framework.common.enums;

/**
 * @program: sp-sales
 * @description:
 * @author: chenkq
 * @create: 2022-07-15 09:30
 */
public enum ErrorMsgCode {
    /** 协议级返回码 */
    UPGRADE(100, "您当前版本需要升级"),
    UPGRADE_DATA(101, "需更新配置或数据"),
    SUCCESS(200, "操作成功"),
    REDIRECT(300, "重定向"),
    LOGIN_FAIL(401, "登陆鉴权失败"),
    PARAMETER_FAIL(400, "参数错误"),
    NOT_FOUND(404, "接口未找到"),
    FORBIDDEN(403, "权限不足"),
    ERP_SERVICE_ERROR(700, "路由"),
    OPTIONS_CODE(9999, "预处理"),

    /** 系统级错误码 */
    SYSTEM_ERROR(1001, "系统错误"),
    SERVICE_PAUSE(1002, "服务暂停"),
    SERVICE_BUSY(1003, "服务器忙"),
    API_NOT_FOUND(1004, "接口不存在"),

    /** 业务级错误码 */
    WEB_ERROR(110000, "服务端web异常"),
    FORM_VALIDATE_ERROR(110100, "输入参数有误"),
    USER_ABSENT(110101, "缺少用户信息"),
    SERVICE_ERROR(120000, "服务端service异常"),
    DAO_ERROR(130000, "服务端dao异常"),
    DB_ERROR(191000, "数据库访问异常"),
    IO_ERROR(192000, "IO操作异常"),
    CACHE_ERROR(193000, "cache操作异常"),
    LOCAL_INVOKE_ERROR(194000, "Local api调用错误"),
    RPC_INVOKE_ERROR(195000, "RPC调用错误"),
    SECURITY_ERROR(196000, "安全错误"),

    /** 其它错误码 */
    OTHER_ERROR(900000, "其它错误"),

    /** 其它错误码 */
    D_400000(400000, "校验成功"),
    D_400001(400001, "超过当天发送次数"),
    D_400002(400002, "发送验证码频繁，请稍后再试"),
    D_400003(400003, "发送失败，请稍后再试"),
    D_400004(400004, "请先发送验证码"),
    D_400005(400005, "验证码不正确或已使用,请重新输入"),
    D_400006(400006, "验证码已过有效期, 请重新发送"),
    D_400007(400007, "验证码已失效, 请重新发送"),
    D_400008(400008, "验证码不正确, 请重新输入"),
    D_400009(400009, "请输入正确的手机号码"),


    /** 其它错误码 */
    WECHAT_SMS_100006(100006, "微信消息模板不存在"),
    WECHAT_SMS_100007(100007, ""),
    WECHAT_SMS_100008(100008, "消息接收人不能为空"),
    WECHAT_SMS_100009(100009, "未找到消息接收用户"),
    ;

    private final Integer code;
    private final String msg;

    ErrorMsgCode(Integer code,String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return  msg;
    }
}
