ChannelWithdrawStatusEnum.java 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package com.qs.mp.common.enums;
  2. import com.alibaba.fastjson.JSONObject;
  3. import com.alibaba.fastjson.annotation.JSONType;
  4. import com.baomidou.mybatisplus.annotation.IEnum;
  5. import com.qs.mp.common.json.EnumValueDeserializer;
  6. /**
  7. * @auther zhongcp
  8. * @create 2022 2022/3/7 2:30 下午
  9. * @describe
  10. */
  11. @JSONType(deserializer = EnumValueDeserializer.class)
  12. public enum ChannelWithdrawStatusEnum implements IEnum<Integer> {
  13. WITHDRAWING(1, "待提现"),
  14. FINISHED(2, "已完成"),
  15. FAILED(3, "提现失败");
  16. private final int value;
  17. private final String desc;
  18. ChannelWithdrawStatusEnum(int value, String desc) {
  19. this.value = value;
  20. this.desc = desc;
  21. }
  22. public static ChannelWithdrawStatusEnum getChannelWithdrawStatusEnum(int value) {
  23. for (ChannelWithdrawStatusEnum channelMoneyTypeEnum : ChannelWithdrawStatusEnum.values()) {
  24. if (channelMoneyTypeEnum.getValue() == value) {
  25. return channelMoneyTypeEnum;
  26. }
  27. }
  28. return null;
  29. }
  30. @Override
  31. public Integer getValue() {
  32. return value;
  33. }
  34. public String getDesc() {
  35. return desc;
  36. }
  37. @Override
  38. public String toString() {
  39. JSONObject object = new JSONObject();
  40. object.put("value", value);
  41. object.put("desc", desc);
  42. return object.toString();
  43. }
  44. }