package org.jeecg.module.custom.ocr.common.enums;

/**
 * @ClassName ReturnCode
 * @Description TODO
 * @Author 王泽振
 * @Date 6:25 AM 3/6/22
 * @Version 1.0
 **/
public enum ReturnCode {
    /**操作成功**/
    RC100(100,"操作成功"),
    /**操作失败**/
    RC999(999,"操作失败"),
    /**服务限流**/
    RC200(200,"服务开启限流保护,请稍后再试!"),
    /**服务降级**/
    RC201(201,"服务开启降级保护,请稍后再试!"),
    /**热点参数限流**/
    RC202(202,"热点参数限流,请稍后再试!"),
    /**系统规则不满足**/
    RC203(203,"系统规则不满足要求,请稍后再试!"),
    /**授权规则不通过**/
    RC204(204,"授权规则不通过,请稍后再试!"),
    PARAM_TYPE_ERROR(300, "参数类型错误"),
    PARAM_FORMAT_ERROR(301, "参数格式错误"),
    PARAM_SCOPE_ERROR(302, "参数超出正常取值范围"),
    TOKEN_OVERDUE(303, "token过期"),
    TOKEN_INVALID(304, "token无效"),
    ADDRESS_NOT_FOUND(400, "找不到地址"),
    /**access_denied**/
    RC403(403,"无访问权限,请联系管理员授予权限"),
    /**access_denied**/
    RC401(401,"匿名用户访问无权限资源时的异常"),
    /**服务异常**/
    RC500(500,"服务异常"),

    /**领域服务异常**/
    RC501(501,"领域服务异常"),
    /**数据转换异常**/
    RC502(502,"数据转换异常"),
    /**调用服务异常**/
    RC503(503,"调用服务异常"),
    /**基础建设服务异常**/
    RC504(504,"基础建设服务异常"),

    /* 第三方登录状态码 */
    NOT_BINDING(604, "未找到绑定手机号，请先绑定手机号"),
    NOT_AUTH(605, "未授权或授权失败，请重试"),
    /**服务异常**/
    BUSINESS_EXCEPTION(3001,"业务异常，操作失败"),

    INVALID_TOKEN(2001,"访问令牌不合法"),
    ACCESS_DENIED(2003,"没有权限访问该资源"),
    INVALID_TOKEN_OR_EXPIRED(2004,"该令牌已过期，请重新获取令牌"),
    CLIENT_AUTHENTICATION_FAILED(1001,"客户端认证失败"),
    USERNAME_OR_PASSWORD_ERROR(1002,"用户名或密码错误"),
    UNSUPPORTED_GRANT_TYPE(1003, "不支持的认证模式"),
//    SUCCESS(200, "成功"),

//    ERROR(500, "系统异常"),

    NULL(10000, "空指针"),
    ACCOUNT_NOT_FOUND(10001, "账号不存在"),
    ACCOUNT_BLOCK(1000, "账号冻结"),
    PASSWORD_ERROR(10003, "密码错误"),
    MORE_ADVANCED_AUTHORIZATION(10005, "该资源需要appkey拥有更高级的授权"),
    MISSING_SOURCE_PARAMETER(10006, "缺少source参数(appkey)"),
    ILLEGAL_PARAMETER(10007, "非法参数"),
    PARAMETER_ERROR(10008, "参数错误，请参考API文档"),
    TOO_MANY_TASKS(10009, "任务过多，系统繁忙"),
    OVERTIME(10010, "超时"),
    ILLEGAL_REQUEST(10011, "非法请求"),
    MISSING_REQUIRED_PARAMETER(10012, "缺失必选参数，请参考API文档"),
    REQUEST_LENGTH_EXCEEDS_LIMIT(10013, "请求长度超过限制"),
    INTERNAL_INTERFACE_PARAMETER_ERROR(10014, "内部接口参数错误"),

    OAUTH_PARAMETER_REJECTED(20001, "Oauth参数被拒绝"),
    REDIRECT_ADDRESS_MISMATCH(20002, "重定向地址不匹配"),
    PICTURE_ERROR(20003, "图片错误，请确保使用multipart上传了图片"),
    USER_DOES_NOT_EXIST(20004, "用户不存在"),
    TOKEN_PARAMETER_IS_NULL(40001, "token参数为空"),
    INSUFFICIENT_PERMISSIONS(40002, "权限不足"),
    DATABASE_ERROR(40003, "数据库错误，请联系系统管理员"),
    LIST_NAME_CONFLICT(40004, "列表名冲突"),
    THE_ID_LIST_IS_TOO_LONG(40005, "id列表太长"),


    /**
     * 租户相关
     */
    NO_OPEN_PRODUCT_ERROR(80001, "无法启用！请为租户开通产品"),
    NO_ADMIN_ACCOUNT_ERROR(80002, "无法启用！请为租户设置管理员账号"),


    /**
     * 产品相关
     */
    PRODUCT_CATEGORY_NAME_ALREADY_EXISTS(4001, "产品分类名称已存在"),

    FUNCTION_ITEM_NAME_ALREADY_EXISTS(5001, "功能项名称已存在"),
    FUNCTION_ITEM_ID_ALREADY_EXISTS(5002, "功能项标识已存在"),
    FUNCTION_NAME_ALREADY_EXISTS(6001, "功能名称已存在"),
    FUNCTION_ID_ALREADY_EXISTS(6002, "功能标识已存在"),
    MODULE_NAME_ALREADY_EXISTS(7001, "模块名称已存在"),
    MODULE_ID_ALREADY_EXISTS(7002, "模块标识已存在"),
    PRODUCT_NAME_ALREADY_EXISTS(8001, "产品名称已存在"),
    PRODUCT_ID_ALREADY_EXISTS(8002, "产品标识已存在"),
    MENU_NAME_ALREADY_EXISTS(9001, "菜单名称已存在"),
    MENU_ID_ALREADY_EXISTS(9002, "菜单标识已存在"),

    RC9003(9003,"该功能项不在该父级菜单绑定的功能下的功能项中"),

    RC9004(9004,"该菜单上级还没绑定菜单"),

    RC9005(9005,"该功能下还没有功能项"),


    RC9006(9006,"该模块下还没有绑定功能"),

    RC9007(9007,"该产品下还没有绑定模块"),

    RC9008(9008,"该菜单下还没有绑定功能/功能项");



    /**自定义状态码**/
    private final int code;
    /**自定义描述**/
    private final String message;

    ReturnCode(int code, String message){
        this.code = code;
        this.message = message;
    }


    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
