package com.qs.mp.common.enums;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONType;
import com.baomidou.mybatisplus.annotation.IEnum;
import com.qs.mp.common.json.EnumValueDeserializer;

/**
 * @auther zhongcp
 * @create 2022 2022/3/7 2:30 下午
 * @describe
 */
@JSONType(deserializer = EnumValueDeserializer.class)
public enum CouponDiscountTypeEnum implements IEnum<Integer> {

  MONEY_OFF(1, "代金券"),
  DISCOUNT(2, "折扣券"),
  EXCHANGE(3, "兑换券");


  private final int value;
  private final String desc;

  CouponDiscountTypeEnum(int value, String desc) {
    this.value = value;
    this.desc = desc;
  }

  @Override
  public Integer getValue() {
    return value;
  }


  @Override
  public String toString() {
    JSONObject object = new JSONObject();
    object.put("value", value);
    object.put("desc", desc);
    return object.toString();
  }
}
