package com.kym.common.constant;

import com.kym.common.exception.BusinessExceptionAssert;
import lombok.Getter;

/**
 * 返回码信息
 *
 * @author skyline
 */
@Getter
public enum ResponseEnum implements BusinessExceptionAssert {
    SUCCESS(200, "ok"),
    FAILED(500, "failed"),

    HTTP_STATUS_200(200, "ok"),
    HTTP_STATUS_202(202, "accepted"),
    HTTP_STATUS_400(400, "request error"),
    HTTP_STATUS_401(401, "no authentication"),
    HTTP_STATUS_403(403, "no authorities"),
    HTTP_STATUS_500(500, "server error"),


    // 微信小程序
    WX_MP_LOGIN_ERROR(301, "微信登录异常"),

    // 微信支付
    WX_PAY_AMOUNT_ERROR(300001, "微信支付金额异常"),


    // 登录 权限
    LOGIN_FAILED(10001, "用户名或密码错误"),
    NO_PERMISSION(10002, "无访问权限"),

    // 订单
    EQUIP_CONNECTOR_ID_ERROR(20000, "设备编码错误"),
    ORDER_IN_PROGRESS(20001, "用户有进行中的订单"),
    NO_ORDER_IN_PROGRESS(20002, "用户无进行中的订单"),
    INSUFFICIENT_USER_BALANCE(20003, "用户余额不足"),
    PLATFORM_EQUIP_AUTH_FAIL(20004, "设备认证失败"),
    PLATFORM_EQUIP_NOT_CONNECTED(20005, "设备未连接"),
    PLATFORM_ORDER_IS_PARKING(20006, "此订单为停车中"),
    PLATFORM_ORDER_CLOSED(20007, "此订单已关闭"),
    PLATFORM_EQUIP_CHECK_FAIL(20008, "设备检测失败"),
    PLATFORM_EQUIP_START_FAIL(20009, "设备启动充电失败"),
    PLATFORM_EQUIP_NOT_EXIST(20010, "设备不存在"),
    PLATFORM_EQUIP_OFFLINE(20011, "设备离线，请稍后重试"),
    PLATFORM_EQUIP_STOP_FAIL(20012, "设备停止充电失败"),
    PLATFORM_EQUIP_EXIST_ORDER_UNFINISHED(20013, "设备存在未完成的订单"),
    ORDER_IN_BOOKING(20014, "用户有预约中的订单"),
    STATION_WHITELIST_NOT_ENABLED(20015, "站点未启用白名单功能"),
    USER_NOT_IN_WHITELIST(20016, "非站点的白名单用户，无法启动充电"),
    STATION_WHITELIST_ALREADY_EXISTS(20017, "用户已在该站点白名单中"),
    STATION_WHITELIST_NOT_EXISTS(20018, "白名单记录不存在"),


    // 互联互通平台
    PLATFORM_API_EXCEPTION(90000, "接口数据异常"),
    PLATFORM_QUERY_TOKEN_ERROR(90001, "TOKEN获取异常"),
    PLATFORM_PUSH_SIGN_FAIL(90002, "推送数据验签失败"),
    PLATFORM_QUERY_TOKEN_EXCEPTION(90003, "EN+TOKEN过期");

    private final Integer code;
    private final String message;

    ResponseEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
