package com.engine.organization.util.response;

public enum ResultCode implements IErrorCode {
    SUCCESS(200, "操作成功", 547157),
    FAILED(500, "操作失败", 547158),
    VALIDATE_FAILED(404, "参数检验失败", -1),
    UNAUTHORIZED(401, "暂未登陆或相关token已经过期", -1),
    FORBIDDEN(403, "没有相关权限", -1),


    BODY_NOT_MATCH(400, "请求的数据格式不符!", -1),
    INTERNAL_SERVER_ERROR(500, "服务器内部错误!", -1),
    SERVER_BUSY(503, "服务器正忙，请稍后再试!", -1);
    private long code;
    private String msg;
    private int labelId;

    ResultCode(long code, String msg, int labelId) {
        this.code = code;
        this.msg = msg;
        this.labelId = labelId;
    }

    @Override
    public long getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return msg;
    }

    @Override
    public int getLabelId() {
        return labelId;
    }
}

interface IErrorCode {
    long getCode();

    String getMessage();

    int getLabelId();
}

