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;

/**
 * 短信发送场景
 *
 * @author zhongcp
 * @Date 2021/9/2
 */
@JSONType(deserializer = EnumValueDeserializer.class)
public enum SmsSendSceneEnum implements IEnum<String> {
  VERIFY("1", "身份验证"),
  GETPWD("2", "找回密码"),
  ORDER("3", "下单"),
  PAY("4", "支付"),
  WITHDRAW("5", "提现"),
  MERCHACT("6", "商户账号创建成功通知"),
  BILLPAYFAIL("7", "账单支付失败通知");

  private final String value;
  private final String desc;

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