Browse Source

Merge branch 'wyp/0923-log' of Server/long-article-recommend into master

wangyunpeng 9 months ago
parent
commit
de49033612
19 changed files with 8 additions and 19 deletions
  1. 1 2
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/repository/aigc/PublishAccountRepository.java
  2. 1 1
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/repository/crawler/ArticleRepository.java
  3. 1 2
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/repository/crawler/PublishSortLogRepository.java
  4. 1 1
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/DataDashboardService.java
  5. 0 1
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/filter/strategy/DeDuplicationStrategy.java
  6. 0 1
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/filter/strategy/KeywordStrategy.java
  7. 0 1
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/filter/strategy/LowScoreStrategy.java
  8. 2 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/rank/strategy/RankV11Strategy.java
  9. 2 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/rank/strategy/RankV12Strategy.java
  10. 0 1
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/score/strategy/ContentPoolStrategy.java
  11. 0 1
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/score/strategy/HisFissionAvgReadRateCorrelationRateStrategy.java
  12. 0 1
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/score/strategy/HisFissionAvgReadRateRateStrategy.java
  13. 0 1
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/score/strategy/HisFissionAvgReadSumRateStrategy.java
  14. 0 1
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/score/strategy/HisFissionDeWeightAvgReadSumRateStrategy.java
  15. 0 1
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/score/strategy/HisFissionFansRateRateStrategy.java
  16. 0 1
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/score/strategy/HisFissionFansSumRateStrategy.java
  17. 0 1
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/score/strategy/ViewCountRateCorrelationStrategy.java
  18. 0 1
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/score/strategy/ViewCountRateStrategy.java
  19. 0 1
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/score/strategy/ViewCountStrategy.java

+ 1 - 2
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/repository/aigc/PublishAccountRepository.java

@@ -5,10 +5,9 @@ import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
-import java.util.Set;
 
 @Repository
 public interface PublishAccountRepository extends JpaRepository<PublishAccount, String> {
 
-    List<PublishAccount> getAllByGhIdIn(Set<String> ghIds);
+    List<PublishAccount> getAllByGhIdIn(List<String> ghIds);
 }

+ 1 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/repository/crawler/ArticleRepository.java

@@ -18,7 +18,7 @@ public interface ArticleRepository extends JpaRepository<Article, String> {
 
     List<Article> getByGhIdInAndAppMsgIdInAndItemIndexAndTypeEqualsAndStatusEquals(Set<String> ghIds, Set<String> appMsgIds, Integer itemIndex, String type, Integer status);
 
-    List<Article> getByGhIdInAndUpdateTimeGreaterThanAndTypeEquals(Set<String> ghIds, Long updateTime, String type);
+    List<Article> getByGhIdInAndUpdateTimeGreaterThanAndTypeEquals(List<String> ghIds, Long updateTime, String type);
 
     List<Article> getByGhIdInAndUpdateTimeLessThanAndTypeEquals(List<String> ghIds, Long updateTIme, String type);
 

+ 1 - 2
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/repository/crawler/PublishSortLogRepository.java

@@ -5,7 +5,6 @@ import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
-import java.util.Set;
 
 @Repository
 public interface PublishSortLogRepository extends JpaRepository<PublishSortLog, Long> {
@@ -18,7 +17,7 @@ public interface PublishSortLogRepository extends JpaRepository<PublishSortLog,
 
     List<PublishSortLog> findByCrawlerChannelContentIdIn(List<String> crawlerChannelContentIds);
 
-    List<PublishSortLog> findByGhIdInAndDateStrGreaterThanEqual(Set<String> ghIds, String dateStr);
+    List<PublishSortLog> findByGhIdInAndDateStrGreaterThanEqual(List<String> ghIds, String dateStr);
 
 
 }

+ 1 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/DataDashboardService.java

@@ -135,7 +135,7 @@ public class DataDashboardService {
         long timestamp = DateUtils.dateStrToTimestamp(dateStr, "yyyyMMdd");
         String dateStrS = DateUtils.timestampToYMDStr(timestamp, "yyyy-MM-dd");
         List<AccountAvgInfo> accountAvgInfoList = accountAvgInfoRepository.getAllByUpdateTimeGreaterThanEqual(dateStrS);
-        Set<String> ghIds = accountAvgInfoList.stream().map(AccountAvgInfo::getGhId).collect(Collectors.toSet());
+        List<String> ghIds = accountAvgInfoList.stream().map(AccountAvgInfo::getGhId).distinct().collect(Collectors.toList());
 
         List<Article> articleList = articleRepository.getByGhIdInAndUpdateTimeGreaterThanAndTypeEquals(ghIds, timestamp, "9");
         Map<String, Map<String, Map<Integer, Article>>> articleMap = articleList.stream().collect(Collectors.groupingBy(Article::getGhId,

+ 0 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/filter/strategy/DeDuplicationStrategy.java

@@ -38,7 +38,6 @@ public class DeDuplicationStrategy implements FilterStrategy {
 
         filterResult.setContentIds(result);
         filterResult.setFilterContent(filterContents);
-        log.info("DeDuplicationStrategy cost:{}", System.currentTimeMillis() - start);
         return filterResult;
     }
 

+ 0 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/filter/strategy/KeywordStrategy.java

@@ -39,7 +39,6 @@ public class KeywordStrategy implements FilterStrategy {
         }
         filterResult.setContentIds(result);
         filterResult.setFilterContent(filterContents);
-        log.info("KeywordStrategy cost:{}", System.currentTimeMillis() - start);
         return filterResult;
     }
 

+ 0 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/filter/strategy/LowScoreStrategy.java

@@ -58,7 +58,6 @@ public class LowScoreStrategy implements FilterStrategy {
                 filterResult.getContentIds().add(content.getId());
             }
         }
-        log.info("LowScoreStrategy cost:{}", System.currentTimeMillis() - start);
         return filterResult;
     }
 }

+ 2 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/rank/strategy/RankV11Strategy.java

@@ -1,6 +1,7 @@
 package com.tzld.longarticle.recommend.server.service.rank.strategy;
 
 
+import com.alibaba.fastjson.JSONObject;
 import com.tzld.longarticle.recommend.server.model.dto.Content;
 import com.tzld.longarticle.recommend.server.service.AccountContentPoolConfigService;
 import com.tzld.longarticle.recommend.server.service.StrategyIndexScoreWeightService;
@@ -111,6 +112,7 @@ public class RankV11Strategy implements RankStrategy {
 
         // 头
         List<Content> pool1 = contentMap.get(contentPools[0]);
+        log.info("RankV11Strategy 头条评分结果 {}", JSONObject.toJSONString(pool1));
         if (CollectionUtils.isNotEmpty(pool1)) {
             result.add(pool1.get(0));
         } else {

+ 2 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/rank/strategy/RankV12Strategy.java

@@ -1,6 +1,7 @@
 package com.tzld.longarticle.recommend.server.service.rank.strategy;
 
 
+import com.alibaba.fastjson.JSONObject;
 import com.tzld.longarticle.recommend.server.model.dto.Content;
 import com.tzld.longarticle.recommend.server.service.AccountContentPoolConfigService;
 import com.tzld.longarticle.recommend.server.service.StrategyIndexScoreWeightService;
@@ -111,6 +112,7 @@ public class RankV12Strategy implements RankStrategy {
 
         // 头
         List<Content> pool1 = contentMap.get(contentPools[0]);
+        log.info("RankV12Strategy 头条评分结果 {}", JSONObject.toJSONString(pool1));
         if (CollectionUtils.isNotEmpty(pool1)) {
             result.add(pool1.get(0));
         } else {

+ 0 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/score/strategy/ContentPoolStrategy.java

@@ -47,7 +47,6 @@ public class ContentPoolStrategy implements ScoreStrategy {
             score.setStrategy(this);
             return score;
         });
-        log.info("ContentPoolStrategy cost:{}", System.currentTimeMillis() - start);
         return scores;
     }
 

+ 0 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/score/strategy/HisFissionAvgReadRateCorrelationRateStrategy.java

@@ -34,7 +34,6 @@ public class HisFissionAvgReadRateCorrelationRateStrategy implements ScoreStrate
             score.setScore(content.getT0FissionByReadAvgCorrelationMean());
             scores.add(score);
         }
-        log.info("HisFissionAvgReadRateRateStrategy cost:{}", System.currentTimeMillis() - start);
         return scores;
     }
 }

+ 0 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/score/strategy/HisFissionAvgReadRateRateStrategy.java

@@ -34,7 +34,6 @@ public class HisFissionAvgReadRateRateStrategy implements ScoreStrategy {
             score.setScore(content.getT0FissionByReadAvgMean());
             scores.add(score);
         }
-        log.info("HisFissionAvgReadRateRateStrategy cost:{}", System.currentTimeMillis() - start);
         return scores;
     }
 }

+ 0 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/score/strategy/HisFissionAvgReadSumRateStrategy.java

@@ -34,7 +34,6 @@ public class HisFissionAvgReadSumRateStrategy implements ScoreStrategy {
             score.setScore(content.getT0FissionByReadAvgSumAvg());
             scores.add(score);
         }
-        log.info("HisFissionAvgReadSumRateStrategy cost:{}", System.currentTimeMillis() - start);
         return scores;
     }
 }

+ 0 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/score/strategy/HisFissionDeWeightAvgReadSumRateStrategy.java

@@ -34,7 +34,6 @@ public class HisFissionDeWeightAvgReadSumRateStrategy implements ScoreStrategy {
             score.setScore(content.getT0FissionDeWeightByReadAvgSumAvg());
             scores.add(score);
         }
-        log.info("HisFissionAvgReadSumRateStrategy cost:{}", System.currentTimeMillis() - start);
         return scores;
     }
 }

+ 0 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/score/strategy/HisFissionFansRateRateStrategy.java

@@ -34,7 +34,6 @@ public class HisFissionFansRateRateStrategy implements ScoreStrategy {
             score.setScore(content.getT0FissionByFansMean());
             scores.add(score);
         }
-        log.info("HisFissionFansRateRateStrategy cost:{}", System.currentTimeMillis() - start);
         return scores;
     }
 }

+ 0 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/score/strategy/HisFissionFansSumRateStrategy.java

@@ -34,7 +34,6 @@ public class HisFissionFansSumRateStrategy implements ScoreStrategy {
             score.setScore(content.getT0FissionByFansSumAvg());
             scores.add(score);
         }
-        log.info("HisFissionFansSumRateStrategy cost:{}", System.currentTimeMillis() - start);
         return scores;
     }
 }

+ 0 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/score/strategy/ViewCountRateCorrelationStrategy.java

@@ -145,7 +145,6 @@ public class ViewCountRateCorrelationStrategy implements ScoreStrategy {
                 break;
             }
         }
-        log.info("ViewCountRateStrategy cost:{}", System.currentTimeMillis() - start);
         return scores;
     }
 }

+ 0 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/score/strategy/ViewCountRateStrategy.java

@@ -141,7 +141,6 @@ public class ViewCountRateStrategy implements ScoreStrategy {
                 break;
             }
         }
-        log.info("ViewCountRateStrategy cost:{}", System.currentTimeMillis() - start);
         return scores;
     }
 }

+ 0 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/score/strategy/ViewCountStrategy.java

@@ -44,7 +44,6 @@ public class ViewCountStrategy implements ScoreStrategy {
             score.setStrategy(this);
             return score;
         });
-        log.info("ViewCountStrategy cost:{}", System.currentTimeMillis() - start);
         return scores;
     }