123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- package com.kmall.admin.haikong.constant;
- import java.util.Arrays;
- /**
- * 常量类
- * @author lhm
- * @createDate 2021-10-30
- */
- public class Constants {
- /* --------------------------------------------------redis常量----------------------------------------------- */
- public static final String MEMBER_SYS_ACCESS_TOKEN_REDIS_KEY = "haikong_memberSys_accessToken";
- public static final String MEMBER_SYS_REFRESH_TOKEN_REDIS_KEY = "haikong_memberSys_refreshToken";
- public static final String WAREHOUSE_STOCK_MAP_KEY = "haikong_warehouse_stock_cache";
- /* --------------------------------------------------redis常量----------------------------------------------- */
- /**
- * 活动主题枚举
- */
- public enum ActivityTopicEnum {
- /**
- * 满赠活动
- */
- MZ("mz", "满赠", 3),
- /**
- * 限时特价活动
- */
- LSCX("lscx", "限时特价", 1),
- /**
- * 优惠券活动
- */
- YHQ("yhq", "优惠券", 5)
- ;
- private final String topicCode;
- private final String topicName;
- private final Integer priority;
- ActivityTopicEnum(String topicCode, String topicName, Integer priority) {
- this.topicCode = topicCode;
- this.topicName = topicName;
- this.priority = priority;
- }
- public String getTopicCode() {
- return topicCode;
- }
- public String getTopicName() {
- return topicName;
- }
- public Integer getPriority() {
- return priority;
- }
- }
- /**
- * 活动类型
- */
- public enum ActivityType {
- /**
- * 按品牌参加活动
- */
- BRAND("0", "商品品牌"),
- /**
- * 按分类参加活动
- */
- CATEGORY("1", "商品分类"),
- /**
- * 按单个商品参加活动
- */
- PRODUCT("2", "商品")
- ;
- private final String activityTypeCode;
- private final String activityType;
- ActivityType(String activityTypeCode, String activityType) {
- this.activityTypeCode = activityTypeCode;
- this.activityType = activityType;
- }
- public String getActivityTypeCode() {
- return activityTypeCode;
- }
- public String getActivityType() {
- return activityType;
- }
- public static ActivityType customValueOf(String val) {
- for (ActivityType value : ActivityType.values()) {
- if (val.equals(value.getActivityTypeCode())) {
- return value;
- }
- }
- return null;
- }
- }
- /**
- * 参与了限时特价的商品是否参与积分抵扣
- */
- public enum PromotionActivityRejectEnum {
- /**
- * 允许参加积分抵扣
- */
- ALLOW("0", "不互斥"),
- /**
- * 不允许参加积分抵扣
- */
- REJECT("1", "互斥"),
- ;
- private final String code;
- private final String desc;
- PromotionActivityRejectEnum(String code, String desc) {
- this.code = code;
- this.desc = desc;
- }
- public String getCode() {
- return code;
- }
- public String getDesc() {
- return desc;
- }
- }
- /**
- * 会员积分生成规则类型
- */
- public enum MemberScoreRulesEnum{
- ZERO(0, "门店"),
- ONE(1, "商品分类"),
- TWO(2, "商品")
- ;
- private final Integer code;
- private final String type;
- MemberScoreRulesEnum(Integer code, String type) {
- this.code = code;
- this.type = type;
- }
- public Integer getCode() {
- return code;
- }
- public String getType() {
- return type;
- }
- }
- }
|