package com.lutao.cloud.iot.mqtt.core.server.http.api.code;

import org.tio.http.common.HttpResponseStatus;

/**
 * 响应 code 码
 */
public enum ResultCode {
    /**
     * 成功
     */
    SUCCESS(HttpResponseStatus.C200, 1),
    /**
     * 关键请求参数缺失
     */
    E101(HttpResponseStatus.C400, 101),
    /**
     * 请求参数错误
     */
    E102(HttpResponseStatus.C400, 102),
    /**
     * 用户名或密码错误
     */
    E103(HttpResponseStatus.C401, 103),
    /**
     * 请求方法错误
     */
    E104(HttpResponseStatus.C405, 104),
    /**
     * 未知错误
     */
    E105(HttpResponseStatus.C500, 105),

    ;

    private final HttpResponseStatus statusCode;
    private final int resultCode;

    ResultCode(HttpResponseStatus statusCode, int resultCode) {
        this.statusCode = statusCode;
        this.resultCode = resultCode;
    }

    public HttpResponseStatus getStatusCode() {
        return statusCode;
    }

    public int getResultCode() {
        return resultCode;
    }
}
