|
@@ -38,10 +38,10 @@ public class RecallService implements ApplicationContextAware {
|
|
|
private BlacklistContainer blacklistContainer;
|
|
|
|
|
|
|
|
|
- * 在流量池场景下,哪些appType不用判断黑名单
|
|
|
+ * 在流量池场景下,哪些appType用判断黑名单
|
|
|
*/
|
|
|
- @ApolloJsonValue("${content.security.recommendflowpool.whitelist.apptype.config:[]}")
|
|
|
- private Set<Integer> contentSecurityWhitelistAppTypeSet;
|
|
|
+ @ApolloJsonValue("${content.security.recommendflowpool.blacklist.apptype.config:[]}")
|
|
|
+ private Set<Integer> blacklistAppTypeSet;
|
|
|
|
|
|
@PostConstruct
|
|
|
public void init() {
|
|
@@ -91,13 +91,10 @@ public class RecallService implements ApplicationContextAware {
|
|
|
return strategies;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- boolean hitUserBlacklist = false;
|
|
|
- if (CollectionUtils.isEmpty(contentSecurityWhitelistAppTypeSet) || !contentSecurityWhitelistAppTypeSet.contains(param.getAppType())) {
|
|
|
String matchUserBlacklistTypeEnum = blacklistContainer.matchUserBlacklistTypeEnum(param.getUid(), param.getHotSceneType(), param.getCityCode(),
|
|
|
param.getClientIp(), param.getMid(), "recommend-flow-pool", param.getAppType());
|
|
|
- hitUserBlacklist = StringUtils.isNotBlank(matchUserBlacklistTypeEnum);
|
|
|
- }
|
|
|
+ boolean hitUserBlacklist = StringUtils.isNotBlank(matchUserBlacklistTypeEnum);
|
|
|
+ boolean isInBlacklist = CollectionUtils.isNotEmpty(blacklistAppTypeSet) && blacklistAppTypeSet.contains(param.getAppType());
|
|
|
|
|
|
String abCode = param.getAbCode();
|
|
|
|
|
@@ -175,7 +172,7 @@ public class RecallService implements ApplicationContextAware {
|
|
|
strategies.addAll(getRegionRecallStrategy(param));
|
|
|
}
|
|
|
|
|
|
- if (!hitUserBlacklist) {
|
|
|
+ if (!hitUserBlacklist || !isInBlacklist) {
|
|
|
|
|
|
if ("60116".equals(abCode)) {
|
|
|
int lastDigit = param.getLastDigit();
|
|
@@ -289,7 +286,7 @@ public class RecallService implements ApplicationContextAware {
|
|
|
case "60115":
|
|
|
case "60117":
|
|
|
case "60118":
|
|
|
- if (!hitUserBlacklist) {
|
|
|
+ if (!hitUserBlacklist || !isInBlacklist) {
|
|
|
strategies.add(strategyMap.get(FlowPoolLastDayTopRecallStrategy.class.getSimpleName()));
|
|
|
}
|
|
|
strategies.add(strategyMap.get(SimHotVideoRecallStrategy.class.getSimpleName()));
|
|
@@ -301,7 +298,7 @@ public class RecallService implements ApplicationContextAware {
|
|
|
break;
|
|
|
case "60110":
|
|
|
strategies.add(strategyMap.get(TopGoodPerformanceVideoRecallStrategy.class.getSimpleName()));
|
|
|
- if (!hitUserBlacklist) {
|
|
|
+ if (!hitUserBlacklist || !isInBlacklist) {
|
|
|
strategies.add(strategyMap.get(FlowPoolLastDayTopRecallStrategy.class.getSimpleName()));
|
|
|
}
|
|
|
strategies.add(strategyMap.get(SimHotVideoRecallStrategy.class.getSimpleName()));
|