package cn.qinys.platform.base.response;

import lombok.Getter;

/**
 * Description:
 *
 * @author tanlie
 * Date: 2024/1/9 8:34
 */
@Getter
public enum ResultCodeEnum {
    // 返回代码
    SUCCESS(200, "成功"),
    FAILURE(300, "失败"),

    BAD_REQUEST(400, "错误的请求参数"),
    UNAUTHORIZED(401, "未认证（签名错误）"),
    MISSING_REQUEST_PARAMETER(402, "缺少请求参数"),

    INTERNAL_SERVER_ERROR(500, "服务器内部错误，请稍后重试~"),
    DATABASE_ERROR(501, "数据库操作错误"),
    CONNECTION_ERROR(502, "网络连接失败"),

    IO_STREAM_ERROR(601, "IO流异常"),

    DOWNLOAD_FILE_ERROR(603, "下载文件异常"),
    UPLOAD_FILE_ERROR(604, "上传文件异常"),
    READ_EXCEL_ERROR(608, "读取Excel异常"),
    UPLOAD_EXCEL_TEMPLATE_ERROR(609, "上传的模板错误"),

    ;

    private final int code;
    private final String desc;

    ResultCodeEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

}
