yaodaoseng 2 napja
szülő
commit
e21e6608f0

+ 8 - 1
ad-engine-service/src/main/java/com/tzld/piaoquan/ad/engine/service/predict/v2/PredictStrategyByRor.java

@@ -1,5 +1,6 @@
 package com.tzld.piaoquan.ad.engine.service.predict.v2;
 
+import com.alibaba.fastjson.JSON;
 import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
 import com.tzld.piaoquan.ad.engine.commons.enums.RedisPrefixEnum;
 import com.tzld.piaoquan.ad.engine.commons.redis.AdRedisHelper;
@@ -9,6 +10,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import java.util.HashMap;
@@ -54,6 +56,9 @@ public class PredictStrategyByRor extends BasicPredict {
     @ApolloJsonValue("${experiment.ror.root.session.id.tail.config:[]}")
     private List<RootSessionIdTailConfigItem> configItems;
 
+    @Value("${experiment.ror.show.log.switch:1}")
+    private String experimentRorShowLogSwitch;
+
     private static final String TABLE_NAME = "alg_mid_history_behavior_1month";
 
     /**
@@ -105,7 +110,9 @@ public class PredictStrategyByRor extends BasicPredict {
 
             // 根据 mid 获取用户近一个月的历史行为特征
             Feature feature = featureService.getMidBehaviorFeature(TABLE_NAME, ctx.getMid());
-
+            if ("1".equals(experimentRorShowLogSwitch)) {
+                log.info("[PredictStrategyByRor] mid:{}, feature:{}, featureStr: {}", ctx.getMid(),feature,JSON.toJSONString(feature));
+            }
             // 安全地提取特征值(多层 null 检查)
             if (feature != null && feature.getUserFeature() != null && feature.getUserFeature().get("") != null) {
                 Map<String, String> algMidHistoryBehavior1month = feature.getUserFeature().get(TABLE_NAME);