package com.kcim.common.enums;

/**
 * @author 李加喜
 * @Package com.imed.costaccount.enums
 * @date 2021-07-26 15:12
 */
public enum  ResultCodeEnum {

    SUCCESS(200, "返回成功", "Return Success"),
    UPDATE_INSERT_SUCCESS(201,"新建或修改数据成功","Return Success"),
    ASYNCHRONOUS_TASKS(202,"一个请求已经进入后台排队（异步任务）"),
    DELETE_SUCCESS(203,"删除数据成功"),

    FAIL(500, "返回失败", "Return Failed"),
    ILLEGAL_ARGUMENT(400, "非法参数", "Illegal Argument"),
    UNAUTHORIZED(401, "认证失败", "Unauthorized"),
    FORBIDDEN(403, "登陆失效", "Forbidden"),
    URL_NOT_FOUND(404,"路径不存在"),
    METHOD_NOT_ALLOW(405,"请求方法不被允许"),
    REQUEST_FORMAT(406,"请求的格式不可得"),
    TOKEN_EXPIRED(410, "访问令牌已过期", "Token Expired"),
    USER_NOT_FOUND(411, "用户不存在"),
    USERPASSWORD_NOT_BLANK(412, "用户名密码不正确"),
    HOSPITAL_NOT_FOUND(413, "医院不存在,请检查链接"),
    USER_NOT_SYS(414, "用户没有系统权限"),
    USER_ADD_EXCEPTION(422,"当创建一个对象时，发生一个验证错误"),
    SERVER_ERROR(500,"服务器异常"),
    GATEWAY_ERROR(502,"网关错误"),
    SERVICE_NOT_USE(503,"服务不可用"),
    GATEWAY_TIMEOUT(504,"网关超时"),
    ERROR(999, "系统异常", "System Exception");

    private final Integer code;
    private final String message;
    private String enMessage = "";

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

    private ResultCodeEnum(Integer code, String message, String enMessage) {
        this.code = code;
        this.message = message;
        this.enMessage = enMessage;
    }

    public Integer getCode() {
        return this.code;
    }

    public String getMessage() {
        return this.message;
    }

    public String getEnMessage() {
        return this.enMessage;
    }
}
