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 CouponTypeEnum implements IEnum<Integer> {

  TICKET_ORDER(1, "盲票购买"),
  SITE_CONSUME(2, "门店消费"),
  CHANNEL(3, "经销商采购");


  private final int value;
  private final String desc;

  CouponTypeEnum(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();
  }
}
