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 UserTicketOrderStatusEnum implements IEnum<Integer> {
  CANCELED(-1, "已取消"),
  NOT_PAY(0, "待付款"),
  FINISHED(1, "已完成");

  private final int value;
  private final String desc;

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

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

  public String getDesc() {
    return desc;
  }

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