package cn.edu.whu.boot.common.domain;

/**
 * 枚举了一些常用 API 操作码
 */
public enum StatusCode {
    SUCCESS(200, "操作成功"),
    FAILED(500, "操作失败"),
    FAILED_AND_SHOW(400,"自定义的错误状态码，前端接受到该错误状态码需要显示返回的message! 一般 message 自定义!!!"),
    VALIDATE_FAILED(404, "参数检验失败"),
    UNAUTHORIZED(401, "暂未登录或token已经过期"),
    FORBIDDEN(403, "没有相关权限");

    private int status;
    private String message;

    StatusCode(int status, String message) {
        this.status = status;
        this.message = message;
    }

    public int getStatus(){
        return status;
    }

    public void setStatus(int status){
        this.status = status;
    }

    public String getMessage(){
        return message;
    }

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