AppSourceEnum.java 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. package com.qs.mp.common.enums;
  2. import com.baomidou.mybatisplus.annotation.IEnum;
  3. import io.swagger.annotations.ApiModel;
  4. /**
  5. * 小程序来源枚举
  6. * @author Cup
  7. * @date 2022/7/11
  8. */
  9. @ApiModel("小程序来源枚举")
  10. public enum AppSourceEnum implements IEnum<Integer> {
  11. /**
  12. * 盲票AppId
  13. */
  14. MP(1,"wx8533800e393dbd6b", "f7a104e09d6c2e55445be2a45c4ab551"),
  15. /**
  16. * 马上兑券AppId
  17. */
  18. MSDQ(2,"wxffb4598e70b9f871", "1c7ba0eed8c0287b8800b089e3c9d102"),
  19. /**
  20. * 支付宝盲票AppID
  21. */
  22. ALI_MP(3, "2021003127607930", null),
  23. /**
  24. * 票赢填写AppID
  25. */
  26. CHANNEL(4, "wxc3a684f1196f6e15", "7708655ba65f04de2a42f23d20ab4134");
  27. private Integer value;
  28. private String appId;
  29. private String appSecret;
  30. AppSourceEnum(Integer value, String appId, String appSecret) {
  31. this.value = value;
  32. this.appId = appId;
  33. this.appSecret = appSecret;
  34. }
  35. public static AppSourceEnum getByValue(Integer value){
  36. for (AppSourceEnum appSourceEnum : AppSourceEnum.values()) {
  37. if (appSourceEnum.getValue().equals(value)) {
  38. return appSourceEnum;
  39. }
  40. }
  41. return AppSourceEnum.MP;
  42. }
  43. public String getAppSecret() {
  44. return appSecret;
  45. }
  46. @Override
  47. public Integer getValue() {
  48. return value;
  49. }
  50. public String getAppId() {
  51. return appId;
  52. }
  53. @Override
  54. public String toString() {
  55. return "AppSourceEnum{" +
  56. "value='" + value + '\'' +
  57. ", appId='" + appId + '\'' +
  58. '}';
  59. }
  60. }