Constants.java 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. package com.kmall.admin.haikong.constant;
  2. import java.util.Arrays;
  3. /**
  4. * 常量类
  5. * @author lhm
  6. * @createDate 2021-10-30
  7. */
  8. public class Constants {
  9. public static final String MEMBER_SYS_ACCESS_TOKEN_REDIS_KEY = "haikong_memberSys_accessToken";
  10. public static final String MEMBER_SYS_REFRESH_TOKEN_REDIS_KEY = "haikong_memberSys_refreshToken";
  11. /**
  12. * 活动主题枚举
  13. */
  14. public enum ActivityTopicEnum {
  15. /**
  16. * 满赠活动
  17. */
  18. MZ("mz", "满赠", 3),
  19. /**
  20. * 限时特价活动
  21. */
  22. LSCX("lscx", "限时特价", 1),
  23. /**
  24. * 优惠券活动
  25. */
  26. YHQ("yhq", "优惠券", 5)
  27. ;
  28. private final String topicCode;
  29. private final String topicName;
  30. private final Integer priority;
  31. ActivityTopicEnum(String topicCode, String topicName, Integer priority) {
  32. this.topicCode = topicCode;
  33. this.topicName = topicName;
  34. this.priority = priority;
  35. }
  36. public String getTopicCode() {
  37. return topicCode;
  38. }
  39. public String getTopicName() {
  40. return topicName;
  41. }
  42. public Integer getPriority() {
  43. return priority;
  44. }
  45. }
  46. /**
  47. * 活动类型
  48. */
  49. public enum ActivityType {
  50. /**
  51. * 按品牌参加活动
  52. */
  53. BRAND("0", "商品品牌"),
  54. /**
  55. * 按分类参加活动
  56. */
  57. CATEGORY("1", "商品分类"),
  58. /**
  59. * 按单个商品参加活动
  60. */
  61. PRODUCT("2", "商品")
  62. ;
  63. private final String activityTypeCode;
  64. private final String activityType;
  65. ActivityType(String activityTypeCode, String activityType) {
  66. this.activityTypeCode = activityTypeCode;
  67. this.activityType = activityType;
  68. }
  69. public String getActivityTypeCode() {
  70. return activityTypeCode;
  71. }
  72. public String getActivityType() {
  73. return activityType;
  74. }
  75. public static ActivityType customValueOf(String val) {
  76. for (ActivityType value : ActivityType.values()) {
  77. if (val.equals(value.getActivityTypeCode())) {
  78. return value;
  79. }
  80. }
  81. return null;
  82. }
  83. }
  84. }