package cc.smtweb.framework.core.exception;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * 错误码 JDK version used:      <JDK1.8>
 *
 * @author kevin
 * @version v1.0
 */
@Setter
@Getter
@ToString
public class ExceptionMessage {
    private int code;

    private String msg;

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

    // 401
    public static ExceptionMessage NO_AUTH_ERROR = new ExceptionMessage(401, "登录失效！");

    // 403
    public static ExceptionMessage FORBIDDEN_ERROR = new ExceptionMessage(403, "没有访问权限！");

    // 404
    public static ExceptionMessage NOT_FOUND_ERROR = new ExceptionMessage(404, "没有找到需要资源！");

    // 405
    public static ExceptionMessage NOT_ALLOWED_ERROR = new ExceptionMessage(405, "访问被阻断！");

    // 通用异常
    public static ExceptionMessage INNER_ERROR = new ExceptionMessage(100100, "内部服务错误，请稍后再试！");

    // 参数错误
    public static ExceptionMessage PARAM_ERROR = new ExceptionMessage(100101, "参数校验失败！");

    // 数据库访问异常
    public static ExceptionMessage DB_ERROR = new ExceptionMessage(100102, "数据库访问失败！");

    // 外部网络访问异常
    public static ExceptionMessage NETWORK_ERROR = new ExceptionMessage(100103, "外部网络访问失败！");

    // 字符转换异常
    public static ExceptionMessage UNSUPPORTED_ENCODING_ERROR = new ExceptionMessage(100104, "字符编码失败！");

    // 没有登录
    public static ExceptionMessage NO_LOGIN_ERROR = new ExceptionMessage(100105, "用户没有登录！");

    // 没有登录
    public static ExceptionMessage CAPTCHA_ERROR = new ExceptionMessage(100106, "验证码错误！");

    // 用户不存在
    public static ExceptionMessage USER_ERROR = new ExceptionMessage(100107, "手机号或密码错误，请重新输入！");

    //  用户被禁
    public static ExceptionMessage USER_FORBIDED = new ExceptionMessage(100108, "用户被禁！");

    // 密码错误
    public static ExceptionMessage PASSWORD_ERROR = new ExceptionMessage(100109, "密码错误，请重新输入！");

    // 文件上传失败
    public static ExceptionMessage FILE_UPLOAD_ERROR = new ExceptionMessage(100110, "文件上传失败！");

    // 文件不存在
    public static ExceptionMessage FILE_NOT_EXIST = new ExceptionMessage(100111, "文件不存在！");

    // 树形层级只有6级
    public static ExceptionMessage TREE_HIERARCHY_ERROR = new ExceptionMessage(100112, "树形层级过多！");

    // 手机号被使用了
    public static ExceptionMessage PHONE_ERROR = new ExceptionMessage(100113, "手机号被使用了！");

    // 手机号不存在
    public static ExceptionMessage PHONE_EXISTS_ERROR = new ExceptionMessage(100114, "手机号不存在！");

    // 消息发送要延迟
    public static ExceptionMessage SM_SEND_NEED_DELAY = new ExceptionMessage(100115, "验证码有效时间");

    // 身份不能确认
    public static ExceptionMessage IDENTITY_ERROR = new ExceptionMessage(100116, "请选择登录身份！");

    // 身份不能确认
    public static ExceptionMessage USER_PERMISSION_CHANGE = new ExceptionMessage(100117, "权限变更，请选择退出重新登录！");

    // 数据发生变更
    public static ExceptionMessage DATA_CHANGE_ERROR = new ExceptionMessage(100118, "数据发生变更，请刷新后重试！");

    // 数据发生变更
    public static ExceptionMessage SM_SEND_ERROR = new ExceptionMessage(100119, "验证码发生失败！");

    // 敏感词
    public static ExceptionMessage XSS_ERROR = new ExceptionMessage(100120, "含有敏感词，请检查。");

    // 树形层级数量太多
    public static ExceptionMessage TREE_NUMBER_ERROR = new ExceptionMessage(100121, "树形该层节点过多！");

    public static ExceptionMessage APP_ID_NOT_EXISTS = new ExceptionMessage(100122, "不存在的应用ID");
}
