Explorar o código

feat: 增加客户白名单

jiandong.liu hai 3 días
pai
achega
9a41dad2fe

+ 11 - 0
ad-engine-service/src/main/java/com/tzld/piaoquan/ad/engine/service/score/strategy/RankStrategyBasic.java

@@ -46,6 +46,9 @@ public abstract class RankStrategyBasic implements RankStrategy {
     @ApolloJsonValue("${h5.score.suppress:{}}")
     private Map<String, Double> h5ScoreSuppress;
 
+    @ApolloJsonValue("${h5.score.suppress.customer.white:[]}")
+    private Set<Long> customerIdWhiteSet;
+
     @Value("${guarantee.exp:742}")
     protected String guaranteeExp;
 
@@ -1190,6 +1193,14 @@ public abstract class RankStrategyBasic implements RankStrategy {
         if (org.springframework.util.CollectionUtils.isEmpty(h5ScoreSuppress) || Objects.isNull(item)) {
             return 1.0;
         }
+
+        Long customerId = item.getCustomerId();
+
+        if (!CollectionUtils.isEmpty(customerIdWhiteSet) && Objects.nonNull(customerId) && customerIdWhiteSet.contains(customerId)) {
+            log.info("getH5SuppressWeight 客户命中白名单, customerId:{}", customerId);
+            return 1.0;
+        }
+
         try {
             Integer landingPageType = item.getLandingPageType();
             String profession = item.getProfession();