package com.changfa.enums;

/**
 * API 返回状态枚举
 *
 * @author Bamboo
 * @since 2020-03-18
 */
public enum StatusEnum {

    // 成功
    OK(200, "请求处理成功"),
    // layUI 数据表格默认成功状态码
    SUCCESS(200, "请求处理成功"),
    // 失败
    FAIL(-1, "操作失败"),
    // 服务器异常
    INTERNAL_SERVER_ERROR(500, "系统异常，请稍后重试！"),

    LOGIN_INDENTY(201,"请先进行登录"),

    NOT_AUTH(501,"暂无权限"),

    USER_OR_PASSWORD_ERROR(500,"用户名或密码错误"),

    PASSWORD_ERROR(504,"原密码输入有误"),

    SURE_PASSWORD_ERROR(500,"新密码和确认密码不一致"),

    USER_INFO_IS_EXISTS(500,"账号已存在"),

    USER_IS_NOT_EXISTS(500,"用户不存在"),

    NO_DATA(500,"暂无数据"),

    NAME_IS_EXISTS(500,"已存在相同名称"),

    LOGIN_LOCK(501,"此账号被禁用"),

    ROLE_NOT_FREE(502,"此角色已被分配，暂无法删除"),

    ROLE_NO_EXISTS(503,"暂无此角色信息"),
    ROLE_CODE_EXISTS(504,"角色编码已存在"),
    ROLE_NAME_EXISTS(505,"角色名称已存在"),
    NO_SERVICE(503,"设备服务没联通"),
    ILLEGAL_PARAM(503,"非法参数"),
    PARAM_IS_EMPTY(503,"参数为空"),
    NO_WORD_ORDER_HANDLE(503,"没有要处理的告警"),

    ;

    /**
     * 状态码
     */
    public Integer code;

    /**
     * 提示信息
     */
    public String message;

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

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
