Jelajahi Sumber

feat:添加VOV过滤实验

zhaohaipeng 7 bulan lalu
induk
melakukan
daabaf5bb5

+ 8 - 0
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/filter/strategy/VovLowerStrategy.java

@@ -7,6 +7,7 @@ import com.tzld.piaoquan.recommend.server.service.filter.FilterParam;
 import com.tzld.piaoquan.recommend.server.service.filter.FilterStrategy;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.data.redis.core.RedisTemplate;
@@ -50,6 +51,8 @@ public class VovLowerStrategy implements FilterStrategy {
             return result;
         }
 
+        log.info("vovInfos: {}", vovInfos);
+
         List<Long> removeIds = new ArrayList<>();
 
         for (int i = 0; i < videoIds.size(); i++) {
@@ -70,6 +73,11 @@ public class VovLowerStrategy implements FilterStrategy {
 
     private boolean isFilter(String vovInfo) {
         try {
+
+            if (StringUtils.isEmpty(vovInfo)) {
+                return false;
+            }
+
             Map<String, Double> vovInfoMap = JSON.parseObject(vovInfo, new TypeReference<Map<String, Double>>() {
             });