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;

/**
 *
 * 盲票奖品类型
 *
 */
@JSONType(deserializer = EnumValueDeserializer.class)
public enum TicketPrizeTypeEnum implements IEnum<String> {

  GOODS("goods", "商品"),
  COUPON("coupon", "优惠券"),
  COUPON_PKG("coupon_pkg", "优惠券包"),
  COIN("coin", "盲豆");

  private final String value;
  private final String desc;

  TicketPrizeTypeEnum(final String value, final String desc) {
    this.value = value;
    this.desc = desc;
  }

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

  /**
   * 重写toString，单个转化成json
   * @return
   */
  @Override
  public String toString() {
    JSONObject object = new JSONObject();
    object.put("value",value);
    object.put("desc", desc);
    return object.toString();
  }
}
