فهرست منبع

homepage recommend

丁云鹏 1 سال پیش
والد
کامیت
c144987a18

+ 3 - 4
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/RecommendService.java

@@ -57,12 +57,11 @@ public class RecommendService {
     @ApolloJsonValue("${app_ab_code:{}}")
     private Map<String, Map<String, Map<String, String>>> appAbCodeMap = new HashMap<>();
 
-    private int[] flowPoolIdList = {7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
-
+    @ApolloJsonValue("${flow.pool.ids:[7, 8, 9, 10, 11, 12, 13, 14, 15, 16]}")
+    private List<Integer> flowPoolIds;
 
     @Autowired
     private FlowPoolConfigService flowPoolConfigService;
-
     @Autowired
     private RecallService recallService;
     @Autowired
@@ -243,7 +242,7 @@ public class RecommendService {
         }
 
         // 流量池分发实验组划分
-        int flowPoolIdChoice = flowPoolIdList[RandomUtils.nextInt(0, flowPoolIdList.length - 1)];
+        int flowPoolIdChoice = flowPoolIds.get(RandomUtils.nextInt(0, flowPoolIds.size() - 1));
         param.setFlowPoolAbtestGroup("control_group");
         Map<String, List<Integer>> flowPoolConfig = flowPoolConfigService.getFlowPoolConfig();
         for (Map.Entry<String, List<Integer>> entry : flowPoolConfig.entrySet()) {