package com.cyksj.enums;

import lombok.Getter;

/**
 * @author chan
 * @className GatewayApiCode
 * @description 网关响应码枚举
 * @date 2021/3/22 9:45 下午
 */
@Getter
public enum GatewayApiCode {

    /**
     * 接口调用成功
     */
    SUCCESS(10000, "success"),


    /**
     * API参数错误
     */
    ENUM_TYPE_ILLEGAL(10010, "非法枚举值"),
    DATE_FORMAT_ILLEGAL(10020, "日期格式不对"),
    START_TIME_FORMAT_ILLEGAL(10021, "起始时间不对"),
    END_TIME_FORMAT_ILLEGAL(10022, "结束时间不对"),
    USER_INFO_ILLEGAL(10023, "获取不到用户信息"),
    WHITE_LIST_PROMOTION_TYPE_ILLEGAL(10124, "获取不到用户信息"),

    /**
     * 订单相关
     */
    THE_ORDER_CANNOT_BE_FOUND(30001,"该订单不存在"),
    AMOUNT_TOO_SMALL(30021,"Stripe支付金额不能小于0.5$"),

    /**
     * 系统异常，10-系统异常
     */
    ILLEGAL_ENUM_VALUE(100001, "异常枚举类型"),
    METADATA_SYSTEM_ERROR(100002, "系统错误"),

    /**
     * 11-mq处理异常
     */
    ILLEGAL_DELAY_MQ_TYPE(110001, "延时消息类型不在有效范围之内"),
    LOOP_DELAY_MQ_ERR_INTERVAL(110002, "循环延时消息的interval不能为0"),
    LOOP_DELAY_MQ_NOT_SET_STOP_CONDITION(110003, "循环延时消息未设置终止循环的有效数值"),

    /**
     * API参数错误-14
     */
    PARAMETER_MISSING_ERROR(140001, "参数错误"),
    REPEAT_REQUEST(140002, "重复请求"),

    /**
     * 车票
     */
    GROUP_INDEX_NOT_FIND(40001,"该车位不存在"),

    GROUP_INDEX_ALREADY_BE_USER(40002,"该车位已有人"),


    //用户未登录
    CMS_USER_NO_LOGIN(20000,"用户未登录！"),
    //用户不存在
    CMS_USER_NO_FIND(20001,"用户不存在！"),
    //密码错误
    CMS_USER_PASSWORD_ERROR(20002,"密码错误！"),
    //用户无权限
    CMS_USER_NO_PERMISSION(20003,"您没有此项操作权限"),
    //用户无角色权限
    CMS_USER_NO_ROLE(20004,"您没有此项操作角色"),
    //无登录权限
    CMS_USER_NO_LOGIN_PERMISSION(20005,"您无法登录，请联系管理员"),
    //用户登录信息失效
    CMS_TOKEN_VALID(20006,"登录信息已失效,请重新登录！"),
    //踢下线
    CMS_TOKEN_OUT_LINE(20007,"您已被管理员踢下线,请重新登录！"),
    ;

    private Integer code;

    private String msg;

    GatewayApiCode(Integer _code, String _msg) {
        this.code = _code;
        this.msg = _msg;
    }
}
