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

  STREET_STORE(1, "临街门店"),
  ENTERTAINMENT(2, "娱乐场所"),
  CINEMA(3, "电影院"),
  CHAIN_STORE(4, "品牌连锁店");

  private final int value;
  private final String desc;

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

  @Override
  public Integer 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();
  }
}
