放缓存

This commit is contained in:
wangxiaopeng
2024-03-29 20:17:08 +08:00
parent c3e5b0e53e
commit 549805b0fe
6 changed files with 122 additions and 11 deletions

View File

@@ -263,4 +263,14 @@ public class RedisConstant {
*/
public static final String PARTNER_APPOINTMENT_LOCK = "partner:appointment:lock:{0}";
/**
* 用户意向区域key
*/
public static final String USER_WANT_AREA_CACHE = "user_want_area_cache_";
/**
* 招商经理轮询key
*/
public static final String INVESTMENT_MANAGER_CACHE = "investment_manager_cache_";
}

View File

@@ -0,0 +1,45 @@
package com.cool.store.enums;
import java.util.Arrays;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* describe:职位来源枚举
*
* @author zhouyiping
* @date 2020/12/30
*/
public enum RoleSourceEnum {
/**
* 职位来源
*/
CREATE("create", "自建"),
EHR("ehr", "EHR"),
SYNC("sync", "钉钉同步");
private static final Map<String, RoleSourceEnum> map = Arrays.stream(values()).collect(
Collectors.toMap(RoleSourceEnum::getCode, Function.identity()));
private String code;
private String desc;
RoleSourceEnum(String code, String desc) {
this.code = code;
this.desc = desc;
}
public String getCode() {
return code;
}
public String getDesc() {
return desc;
}
public static RoleSourceEnum getByCode(String code) {
return map.get(code);
}
}

View File

@@ -98,4 +98,13 @@ public class RedisConstantUtil {
return active + "_" + RedisConstant.PHONE_NUMBER + phoneNumber;
}
public String getUserWantAreaListKey(String userId) {
return active + "_" + RedisConstant.USER_WANT_AREA_CACHE + eid + ":" + userId;
}
public String getInvestmentManagerKey(Long wantShopAreaId) {
return active + "_" + RedisConstant.INVESTMENT_MANAGER_CACHE + eid + ":" + wantShopAreaId;
}
}