package com.ruoyi.enums;


import com.ruoyi.common.exception.enums.abs.AbstractBaseExceptionEnum;

/**
 * @author liwenlong
 * @date 2021/11/1 19:34
 */
public enum MallExceptionEnum implements AbstractBaseExceptionEnum {

    COUPON_RECEIVE_FINISH("优惠券已被领取完"),
    COUPON_NOT_EXIST("优惠券已被领取完"),

    DELETER_SHOPPING_CAR_ERROR("删除购物车失败"),
    GOODS_DEL_FLAG("商品已下架"),
    NOT_STOCK("库存不足"),

    ORDER_STATUS_ERROR( "订单状态错误 请刷新数据"),
    ORDER_NOT_SEND( "商品未发货 无需申请退货"),

    ORDER_REPEAT_APPLY( "请勿重复申请"),
    UPDATE_STOREK_ERROR( "修改库存错误"),
    UPDATE_SALES_ERROR( "修改销量错误"),

    CREATE_ORDER_ERROR( "创建订单失败"),

    ORDER_BE_ROBBED( "订单已被抢"),

    ORDER_NOT_RESERVATION_TIME( "预约时间未到,请勿操作"),

    ORDER_NOT_AUTH_EXCEPTION( "无权限抢单"),

    ;

    private Integer code;
    private String message;

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

    private MallExceptionEnum(String message) {
        this.code = 500;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return this.message;
    }
}
