|
@@ -1,5 +1,6 @@
|
|
|
package com.tzld.piaoquan.recommend.server.service.filter.strategy;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
|
|
|
import com.google.common.cache.CacheBuilder;
|
|
|
import com.google.common.cache.CacheLoader;
|
|
@@ -58,12 +59,12 @@ public class BlacklistContainer {
|
|
|
@Qualifier("longVideoRedisTemplate")
|
|
|
private RedisTemplate<String, String> longVideoRedisTemplate;
|
|
|
|
|
|
- @ApolloJsonValue("${content.security.generalization.user.condition.config:}")
|
|
|
- private Map<String, GeneralizationUserConfig> generalizationUserConditionConfig;
|
|
|
-
|
|
|
@Resource
|
|
|
private WxVideoTagRelRepository wxVideoTagRelRepository;
|
|
|
|
|
|
+ @ApolloJsonValue("${content.security.generalization.user.condition.config:{}}")
|
|
|
+ private Map<String, GeneralizationUserConfig> generalizationUserConditionConfig;
|
|
|
+
|
|
|
/**
|
|
|
* 不同类型的用户要过滤掉的标签列表配置
|
|
|
* <br >
|
|
@@ -77,9 +78,6 @@ public class BlacklistContainer {
|
|
|
@ApolloJsonValue("${content.security.filter.config:{}}")
|
|
|
private Map<String, TagFilterConfig> tagFilterConfigMap;
|
|
|
|
|
|
- @ApolloJsonValue("${content.security.user.type.priority.config:{}}")
|
|
|
- private Map<String, List<String>> userTypePriorityConfigMap;
|
|
|
-
|
|
|
/**
|
|
|
* 保存Tag标签与视频列表的映射
|
|
|
* <br>
|
|
@@ -119,7 +117,7 @@ public class BlacklistContainer {
|
|
|
refreshVideoTagCache();
|
|
|
}
|
|
|
|
|
|
- @Scheduled(cron = "0 0/5 0/1 * * ? ")
|
|
|
+ @Scheduled(cron = "0 0/5 * * * ? ")
|
|
|
public void cronSync() {
|
|
|
refreshVideoTagCache();
|
|
|
}
|
|
@@ -180,6 +178,8 @@ public class BlacklistContainer {
|
|
|
private String matchUserBlacklistTypeEnum(String uid, Long hotSceneType, String cityCode, String clientIP) {
|
|
|
try {
|
|
|
LOG.info("计算用户黑名单类型,判断参数: uid={}, hotSceneType={}, cityCode={}, clientIP={}", uid, hotSceneType, cityCode, clientIP);
|
|
|
+ LOG.info("generalizationUserConditionConfig: {}", JSON.toJSONString(generalizationUserConditionConfig));
|
|
|
+ LOG.info("tagFilterConfigMap: {}", JSON.toJSONString(tagFilterConfigMap));
|
|
|
String key = this.calcUserRedisKey(uid);
|
|
|
Map<String, String> uidBlacklistMap = blacklistCache.get(key);
|
|
|
if (uidBlacklistMap.containsKey(uid)) {
|