Constants.java 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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. /* --------------------------------------------------redis常量----------------------------------------------- */
  10. public static final String MEMBER_SYS_ACCESS_TOKEN_REDIS_KEY = "haikong_memberSys_accessToken";
  11. public static final String MEMBER_SYS_REFRESH_TOKEN_REDIS_KEY = "haikong_memberSys_refreshToken";
  12. public static final String WAREHOUSE_STOCK_MAP_KEY = "haikong_warehouse_stock_cache";
  13. /* --------------------------------------------------redis常量----------------------------------------------- */
  14. /**
  15. * 活动主题枚举
  16. */
  17. public enum ActivityTopicEnum {
  18. /**
  19. * 满赠活动
  20. */
  21. MZ("mz", "满赠", 3),
  22. /**
  23. * 限时特价活动
  24. */
  25. LSCX("lscx", "限时特价", 1),
  26. /**
  27. * 优惠券活动
  28. */
  29. YHQ("yhq", "优惠券", 5)
  30. ;
  31. private final String topicCode;
  32. private final String topicName;
  33. private final Integer priority;
  34. ActivityTopicEnum(String topicCode, String topicName, Integer priority) {
  35. this.topicCode = topicCode;
  36. this.topicName = topicName;
  37. this.priority = priority;
  38. }
  39. public String getTopicCode() {
  40. return topicCode;
  41. }
  42. public String getTopicName() {
  43. return topicName;
  44. }
  45. public Integer getPriority() {
  46. return priority;
  47. }
  48. }
  49. /**
  50. * 活动类型
  51. */
  52. public enum ActivityType {
  53. /**
  54. * 按品牌参加活动
  55. */
  56. BRAND("0", "商品品牌"),
  57. /**
  58. * 按分类参加活动
  59. */
  60. CATEGORY("1", "商品分类"),
  61. /**
  62. * 按单个商品参加活动
  63. */
  64. PRODUCT("2", "商品")
  65. ;
  66. private final String activityTypeCode;
  67. private final String activityType;
  68. ActivityType(String activityTypeCode, String activityType) {
  69. this.activityTypeCode = activityTypeCode;
  70. this.activityType = activityType;
  71. }
  72. public String getActivityTypeCode() {
  73. return activityTypeCode;
  74. }
  75. public String getActivityType() {
  76. return activityType;
  77. }
  78. public static ActivityType customValueOf(String val) {
  79. for (ActivityType value : ActivityType.values()) {
  80. if (val.equals(value.getActivityTypeCode())) {
  81. return value;
  82. }
  83. }
  84. return null;
  85. }
  86. }
  87. /**
  88. * 参与了限时特价的商品是否参与积分抵扣
  89. */
  90. public enum PromotionActivityRejectEnum {
  91. /**
  92. * 允许参加积分抵扣
  93. */
  94. ALLOW("0", "不互斥"),
  95. /**
  96. * 不允许参加积分抵扣
  97. */
  98. REJECT("1", "互斥"),
  99. ;
  100. private final String code;
  101. private final String desc;
  102. PromotionActivityRejectEnum(String code, String desc) {
  103. this.code = code;
  104. this.desc = desc;
  105. }
  106. public String getCode() {
  107. return code;
  108. }
  109. public String getDesc() {
  110. return desc;
  111. }
  112. }
  113. /**
  114. * 会员积分生成规则类型
  115. */
  116. public enum MemberScoreRulesEnum{
  117. ZERO(0, "门店"),
  118. ONE(1, "商品分类"),
  119. TWO(2, "商品")
  120. ;
  121. private final Integer code;
  122. private final String type;
  123. MemberScoreRulesEnum(Integer code, String type) {
  124. this.code = code;
  125. this.type = type;
  126. }
  127. public Integer getCode() {
  128. return code;
  129. }
  130. public String getType() {
  131. return type;
  132. }
  133. }
  134. }