|
@@ -4,6 +4,7 @@ import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
|
|
|
import com.google.common.base.Stopwatch;
|
|
|
import com.google.common.base.Strings;
|
|
|
import com.google.common.reflect.TypeToken;
|
|
|
+import com.tzld.piaoquan.recommend.server.common.base.Constant;
|
|
|
import com.tzld.piaoquan.recommend.server.common.enums.AppTypeEnum;
|
|
|
import com.tzld.piaoquan.recommend.server.gen.common.Result;
|
|
|
import com.tzld.piaoquan.recommend.server.gen.recommend.MachineInfoProto;
|
|
@@ -340,12 +341,21 @@ public class RecommendService {
|
|
|
|
|
|
// 流量池分发实验组划分
|
|
|
int flowPoolIdChoice = flowPoolIds.get(RandomUtils.nextInt(0, flowPoolIds.size()));
|
|
|
- param.setFlowPoolId(flowPoolIdChoice);
|
|
|
- param.setFlowPoolAbtestGroup("control_group");
|
|
|
Map<String, List<Integer>> flowPoolConfig = flowPoolConfigService.getFlowPoolConfig();
|
|
|
- for (Map.Entry<String, List<Integer>> entry : flowPoolConfig.entrySet()) {
|
|
|
- if (entry.getValue().contains(flowPoolIdChoice)) {
|
|
|
- param.setFlowPoolAbtestGroup(entry.getKey());
|
|
|
+ if (Objects.equals(Constant.SUPPLY_AB_CODE, param.getAbCode())) {
|
|
|
+ List<Integer> supplyFlowPoolIdList = flowPoolConfig.get(FlowPoolConstants.SUPPLY_FLOW_SET_LEVEL);
|
|
|
+ if (Objects.nonNull(supplyFlowPoolIdList) && !supplyFlowPoolIdList.isEmpty()) {
|
|
|
+ flowPoolIdChoice = supplyFlowPoolIdList.get(0);
|
|
|
+ param.setFlowPoolId(flowPoolIdChoice);
|
|
|
+ param.setFlowPoolAbtestGroup(FlowPoolConstants.SUPPLY_FLOW_SET_LEVEL);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ param.setFlowPoolId(flowPoolIdChoice);
|
|
|
+ param.setFlowPoolAbtestGroup("control_group");
|
|
|
+ for (Map.Entry<String, List<Integer>> entry : flowPoolConfig.entrySet()) {
|
|
|
+ if (entry.getValue().contains(flowPoolIdChoice)) {
|
|
|
+ param.setFlowPoolAbtestGroup(entry.getKey());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|