package com.cslg.ppa.common.exception;

import lombok.Getter;

@Getter
public enum ExceptionEnum {
    //400~500  登录相关异常提示
    LOGIN_NO_LOGIN("401","未登录"),
    LOGIN_ACCOUNT_MISTAKE("402","账号错误"),
    LOGIN_PASSWORD_MISTAKE("403","密码错误"),
    LOGIN_ERROR("405","登录错误"),
    LOGIN_INVITE_ERROR("406","邀请码错误"),
    THE_TOKEN_IS_INVALID("407", "token失效"),
    THE_REQUEST_TIME_OVERTIME("408", "请求时间超时"),
    THE_SIGN_IS_NOT_SAME("408", "请求SIGN不一致,重新检查"),
    THE_MACHINE_CODE_IS_NULL("409", "机器码不可为空"),
    DO_NOT_LOG_IN_TO_MORE_THAN_TWO_NEW_MACHINES_WITH_THE_SAME_ACCOUNT("410", "同一账号新机登录不可超过两个"),
    THE_PHONE_FORMAT_ERROR("411","手机号格式错误"),
    THE_PHONE_IS_NOT_EMPTY("412","手机号不可为空"),
    THE_PHONE_CODE_IS_INVALID("413","手机验证码失效"),
    THE_PHONE_CODE_IS_NOT_NULL("414","手机验证码不可为空"),
    THE_PHONE_CODE_IS_INCONFORMITY("415","验证码不一致"),
    THE_PERSONNEL_IS_NOT_EXIST("416","用户不存在"),
    THE_PERSONNEL_IS_FORBIDDEN("417","该用户不可用"),
    THE_VERSION_IS_NULL("418", "版本号不可为空"),
    THE_PERSONNEL_IS_EXIST("419","用户已存在"),
    //500~600   业务异常相关
    THE_SYSTEM_ERROR("500", "系统异常"),

    //600~700  权限相关异常提示
    PERMISSION_ERROR("601","无权限"),
    PERMISSION_NO_VIP("606","未开会员"),
    PERMISSION_BEYOND_USETIME("607","超过使用次数"),

    //700~800  参数相关异常提示
    BUSINESS_ERROR("708","业务错误"),
    BUSINESS_CHECK("709","参数校验错误"),


    NO_NEED_PAY("901","支付成功"),





    /*APP端 100000-300000*/
    SUCCESS("000000", "调用成功"),
    PARAMETER_VERIFICATION_ERROR("000001", "数据参数校验异常"),
    PHONE_FORMAT_ERROR("000002","手机号格式错误"),

    VERIFY_CODE("10001", "校验码失效"),
    CODE_WRONG("10002","验证码错误"),
    INIT_GENERICITY_BEAN_ERROR("10003","泛型实例化异常"),
    THE_PHONE_CANNOT_BE_EXIST("10004","手机号已存在"),
    THE_LOG_OUT("10004","未登录"),
    THE_CODE_IS_NOT_NULL("10006","验证码不能为空"),

    //异常20000
    THE_PARAMETER_EXCEPTION("20001", "参数异常，请传入数据"),
    THE_GET_INFORMATION_TOKEN_INVALID("20002", "获取用户信息token失效"),
    THE_FAIL_TO_DELETE("20003", "删除失败"),

    //业务异常
    THE_PRODUCT_CATEGORY_NAME_IS_EXIST("607", "产品类别名称已存在"),
    THE_LOG_INVALID_NEED_LOGIN_AGAIN("606","登录失效，请重新登录"),









    SYSTEM_ERROR("999999", "系统异常");

    private String code;// 异常代码
    private String message;// 异常信息

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

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
