Explorar el Código

official_articles_v2 发布时间改为使用 publish_timestamp

wangyunpeng hace 8 meses
padre
commit
a408d7c31f

+ 1 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/dto/ContentHisPublishArticle.java

@@ -17,6 +17,7 @@ public class ContentHisPublishArticle {
     private Integer itemIndex;
     private Integer viewCount;
     private Long updateTime;
+    private Long publishTimestamp;
     private Integer avgViewCount;
     private Double viewCountRate;
     private Integer firstViewCount;

+ 3 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/entity/crawler/Article.java

@@ -72,5 +72,8 @@ public class Article implements Serializable {
     private String articleGroup;
     @Column(name = "status")
     private Integer status;
+    @Column(name = "publish_timestamp")
+    private Long publishTimestamp;
+
 }
 

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

@@ -19,13 +19,13 @@ public interface ArticleRepository extends JpaRepository<Article, String> {
     List<Article> getByGhIdInAndAppMsgIdInAndItemIndexAndTypeEqualsAndStatusEquals(Set<String> ghIds, Set<String> appMsgIds,
                                                                                    Integer itemIndex, String type, Integer status);
 
-    List<Article> getByGhIdInAndUpdateTimeBetweenAndTypeEquals(List<String> ghIds, Long updateTimeStart, Long updateTimeEnd, String type);
+    List<Article> getByGhIdInAndPublishTimestampBetweenAndTypeEquals(List<String> ghIds, Long publishTimestampStart, Long publishTimestampEnd, String type);
 
-    List<Article> getByGhIdInAndUpdateTimeGreaterThanAndTypeEquals(List<String> ghIds, Long updateTime, String type);
+    List<Article> getByGhIdInAndPublishTimestampGreaterThanAndTypeEquals(List<String> ghIds, Long publishTimestamp, String type);
 
-    List<Article> getByGhIdInAndUpdateTimeLessThanAndTypeEquals(List<String> ghIds, Long updateTIme, String type);
+    List<Article> getByGhIdInAndPublishTimestampLessThanAndTypeEquals(List<String> ghIds, Long publishTimestamp, String type);
 
-    List<Article> getByUpdateTimeGreaterThanAndTypeEquals(Long updateTIme, String type);
+    List<Article> getByPublishTimestampGreaterThanAndTypeEquals(Long publishTimestamp, String type);
 
     List<Article> getByGhIdAndItemIndexAndTypeEqualsAndStatusEquals(String ghId, Integer itemIndex, String type, Integer status);
 

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

@@ -146,7 +146,7 @@ public class DataDashboardService {
         log.info("newSortStrategyData accountAvgInfoList finish");
         List<String> ghIds = accountAvgInfoList.stream().map(AccountAvgInfo::getGhId).distinct().collect(Collectors.toList());
 
-        List<Article> articleList = articleRepository.getByGhIdInAndUpdateTimeBetweenAndTypeEquals(ghIds,
+        List<Article> articleList = articleRepository.getByGhIdInAndPublishTimestampBetweenAndTypeEquals(ghIds,
                 beginTimestamp, endTimestamp, ArticleTypeEnum.QUNFA.getVal());
         Map<String, Map<String, Map<Integer, Article>>> articleMap = articleList.stream().collect(Collectors.groupingBy(Article::getGhId,
                 Collectors.groupingBy(Article::getAppMsgId, Collectors.toMap(Article::getItemIndex, o -> o))));
@@ -302,10 +302,10 @@ public class DataDashboardService {
             Article firstArticle = articleMap.get(article.getGhId()).get(article.getAppMsgId()).get(1);
             Map<String, String> dateStrategy = sortStrategyMap.get(article.getGhId());
             AccountAvgInfo avgInfo = getAccountAvgInfo(accountAvgInfoIndexMap, article.getGhId(),
-                    article.getUpdateTime(), article.getItemIndex());
+                    article.getPublishTimestamp(), article.getItemIndex());
             AccountAvgInfo firstAvgInfo = getAccountAvgInfo(accountAvgInfoIndexMap, article.getGhId(),
-                    article.getUpdateTime(), 1);
-            String date = DateUtils.timestampToYMDStr(article.getUpdateTime(), "yyyyMMdd");
+                    article.getPublishTimestamp(), 1);
+            String date = DateUtils.timestampToYMDStr(article.getPublishTimestamp(), "yyyyMMdd");
             setObjBaseInfo(article, obj, date);
             if (Objects.nonNull(firstArticle)) {
                 obj.setFirstViewCount(firstArticle.getShowViewCount());
@@ -433,9 +433,9 @@ public class DataDashboardService {
                                    Map<String, Map<String, Map<String, AccountAvgInfo>>> accountAvgInfoIndexMap,
                                    Map<String, List<ArticleDetailInfo>> hisArticleDetailInfoMap) {
         List<Article> hisArticles = hisArticleMap.getOrDefault(article.getTitle(), new ArrayList<>());
-        hisArticles = hisArticles.stream().filter(o -> o.getUpdateTime() < (article.getUpdateTime() - 3600 * 8)
+        hisArticles = hisArticles.stream().filter(o -> o.getPublishTimestamp() < (article.getPublishTimestamp() - 3600 * 8)
                 && (1 == o.getItemIndex() || 2 == o.getItemIndex())
-                && !ScoreStrategy.hisContentLateFilter(o.getUpdateTime())).collect(Collectors.toList());
+                && !ScoreStrategy.hisContentLateFilter(o.getPublishTimestamp())).collect(Collectors.toList());
         Integer readCount = 0;
         Double readAvgCount = 0.0;
         int firstCount = 0;
@@ -443,7 +443,7 @@ public class DataDashboardService {
         for (Article hisArticle : hisArticles) {
             readCount += hisArticle.getShowViewCount();
             AccountAvgInfo accountAvgInfo = getAccountAvgInfo(accountAvgInfoIndexMap, hisArticle.getGhId(),
-                    hisArticle.getUpdateTime(), hisArticle.getItemIndex());
+                    hisArticle.getPublishTimestamp(), hisArticle.getItemIndex());
             if (Objects.nonNull(accountAvgInfo)) {
                 readAvgCount += accountAvgInfo.getReadAvg();
             }
@@ -481,13 +481,13 @@ public class DataDashboardService {
         obj.setPosition(article.getItemIndex());
         obj.setViewCount(article.getShowViewCount());
         obj.setDateStr(date);
-        obj.setPublishTime(DateUtils.timestampToYMDStr(article.getUpdateTime(), "HH:mm:ss"));
+        obj.setPublishTime(DateUtils.timestampToYMDStr(article.getPublishTimestamp(), "HH:mm:ss"));
         obj.setWxSn(article.getWxSn());
     }
 
     private void setObjArticleDetailInfo(Article article, NewSortStrategyExport obj, List<ArticleDetailInfo> articleDetailInfos) {
         if (CollectionUtils.isNotEmpty(articleDetailInfos)) {
-            Date publishDate = DateUtils.getStartDateOfDay(article.getUpdateTime());
+            Date publishDate = DateUtils.getStartDateOfDay(article.getPublishTimestamp());
             articleDetailInfos = articleDetailInfos.stream().filter(o -> !o.getRecallDt().before(publishDate))
                     .collect(Collectors.toList());
             Date minDate = articleDetailInfos.stream().map(ArticleDetailInfo::getRecallDt).min(Date::compareTo).orElse(new Date());
@@ -830,9 +830,9 @@ public class DataDashboardService {
                 .collect(Collectors.groupingBy(AccountAvgInfo::getGhId, Collectors.groupingBy(AccountAvgInfo::getUpdateTime,
                         Collectors.toMap(AccountAvgInfo::getPosition, o -> o))));
         List<String> ghIds = accountAvgInfoList.stream().map(AccountAvgInfo::getGhId).distinct().collect(Collectors.toList());
-        List<Article> articleList = articleRepository.getByGhIdInAndUpdateTimeLessThanAndTypeEquals(ghIds, dateEnd, ArticleTypeEnum.QUNFA.getVal());
+        List<Article> articleList = articleRepository.getByGhIdInAndPublishTimestampLessThanAndTypeEquals(ghIds, dateEnd, ArticleTypeEnum.QUNFA.getVal());
         Map<String, Article> articleMap = articleList.stream().collect(Collectors.toMap(Article::getWxSn, o -> o));
-        List<Article> todayPublish = articleList.stream().filter(o -> o.getUpdateTime() > dateStart).collect(Collectors.toList());
+        List<Article> todayPublish = articleList.stream().filter(o -> o.getPublishTimestamp() > dateStart).collect(Collectors.toList());
         if (CollectionUtils.isEmpty(todayPublish)) {
             return new ArrayList<>();
         }
@@ -854,7 +854,7 @@ public class DataDashboardService {
         List<NewSortStrategyExport> newSortStrategyExportList = getNewSortStrategyExportList(todayPublish,
                 articleDetailInfoMap, accountAvgInfoIndexMap);
 
-        List<Article> futurePublishList = articleRepository.getByUpdateTimeGreaterThanAndTypeEquals(dateEnd, ArticleTypeEnum.QUNFA.getVal());
+        List<Article> futurePublishList = articleRepository.getByPublishTimestampGreaterThanAndTypeEquals(dateEnd, ArticleTypeEnum.QUNFA.getVal());
         Map<String, List<Article>> futurePublishMap = futurePublishList.stream().collect(Collectors.groupingBy(Article::getTitle));
 
         Map<String, List<String>> titleTypeMap = new HashMap<>();
@@ -870,7 +870,7 @@ public class DataDashboardService {
             }
             IntermediateIndicatorsExport item = resultMap.get(type);
             List<Article> list = hisPublishMap.get(data.getTitle());
-            list = list.stream().filter(publish -> publish.getUpdateTime() < (article.getUpdateTime() - 3600 * 8))
+            list = list.stream().filter(publish -> publish.getPublishTimestamp() < (article.getPublishTimestamp() - 3600 * 8))
                     .collect(Collectors.toList());
             Integer poolLevel = getArticlePoolLevel(data.getGhId(), list, small);
             List<String> titles = titleTypeMap.computeIfAbsent(type, k -> new ArrayList<>());
@@ -1048,8 +1048,8 @@ public class DataDashboardService {
             List<ArticleDetailInfo> articleDetailInfos = articleDetailInfoMap.get(article.getWxSn());
             setObjArticleDetailInfo(article, obj, articleDetailInfos);
             AccountAvgInfo avgInfo = getAccountAvgInfo(accountAvgInfoIndexMap, article.getGhId(),
-                    article.getUpdateTime(), article.getItemIndex());
-            String date = DateUtils.timestampToYMDStr(article.getUpdateTime(), "yyyyMMdd");
+                    article.getPublishTimestamp(), article.getItemIndex());
+            String date = DateUtils.timestampToYMDStr(article.getPublishTimestamp(), "yyyyMMdd");
             setObjBaseInfo(article, obj, date);
             setObjAvgInfo(article, obj, avgInfo);
             result.add(obj);
@@ -1068,13 +1068,13 @@ public class DataDashboardService {
                                              Integer poolLevel,
                                              List<String> small,
                                              Map<String, List<Article>> hisPublishMap) {
-        Long hisMinDate = hisPublish.stream().mapToLong(Article::getUpdateTime).min().orElse(0);
+        Long hisMinDate = hisPublish.stream().mapToLong(Article::getPublishTimestamp).min().orElse(0);
         int scorePublishTime = scoreHisPublishTimeMap.computeIfAbsent(type, k -> 0);
         Set<String> wxsnHisDistinctSet = wxsnHisDistinctSetMap.computeIfAbsent(type, k -> new HashSet<>());
         for (Article publish : hisPublish) {
             if (poolLevel == 1) {
                 List<Article> list = hisPublishMap.get(publish.getTitle());
-                list = list.stream().filter(o -> o.getUpdateTime() < (publish.getUpdateTime() - 3600 * 8))
+                list = list.stream().filter(o -> o.getPublishTimestamp() < (publish.getPublishTimestamp() - 3600 * 8))
                         .collect(Collectors.toList());
                 Integer hisPublishPoolLevel = getArticlePoolLevel(publish.getGhId(), list, small);
                 if (hisPublishPoolLevel > poolLevel) {
@@ -1082,7 +1082,7 @@ public class DataDashboardService {
                 }
             }
             AccountAvgInfo avgInfo = getAccountAvgInfo(accountAvgInfoIndexMap, publish.getGhId(),
-                    publish.getUpdateTime(), publish.getItemIndex());
+                    publish.getPublishTimestamp(), publish.getItemIndex());
             if (wxsnHisDistinctSet.contains(publish.getWxSn())) {
                 continue;
             }
@@ -1134,7 +1134,7 @@ public class DataDashboardService {
             item.setAverageFirstLayerFissionToViewBaseRatio(averageFirstLayerFissionToViewBaseRatio);
             Map<String, Map<Integer, PublishSortLog>> dateSortMap = publishSortLogMap.get(publish.getGhId());
             if (Objects.nonNull(dateSortMap)) {
-                String publishDateStr = DateUtils.timestampToYMDStr(publish.getUpdateTime(), "yyyyMMdd");
+                String publishDateStr = DateUtils.timestampToYMDStr(publish.getPublishTimestamp(), "yyyyMMdd");
                 Map<Integer, PublishSortLog> indexMap = dateSortMap.get(publishDateStr);
                 if (Objects.nonNull(indexMap)) {
                     PublishSortLog log = indexMap.get(publish.getItemIndex());
@@ -1152,7 +1152,7 @@ public class DataDashboardService {
                 }
             }
             double firstExplorationIntervalAvg = Double.isNaN(item.getFirstExplorationIntervalAvg()) ? 0.0 : item.getFirstExplorationIntervalAvg();
-            double explorationInterval = (publish.getUpdateTime() - hisMinDate) / 86400.0;
+            double explorationInterval = (publish.getPublishTimestamp() - hisMinDate) / 86400.0;
             firstExplorationIntervalAvg = (firstExplorationIntervalAvg * (item.getTotalArticleReleaseCountNonInfinite() - 1)
                     + explorationInterval) / item.getTotalArticleReleaseCountNonInfinite();
             item.setFirstExplorationIntervalAvg(firstExplorationIntervalAvg);
@@ -1226,7 +1226,7 @@ public class DataDashboardService {
         if (!ghIds.contains(article.getGhId())) {
             ghIds.add(article.getGhId());
             AccountAvgInfo accountAvgInfo = getAccountAvgInfo(accountAvgInfoIndexMap, article.getGhId(),
-                    article.getUpdateTime(), article.getItemIndex());
+                    article.getPublishTimestamp(), article.getItemIndex());
             if (Objects.nonNull(accountAvgInfo)) {
                 item.setFansCount(item.getFansCount() + accountAvgInfo.getFans());
             }
@@ -1371,11 +1371,11 @@ public class DataDashboardService {
         sortLogList.sort(Comparator.comparing(PublishSortLog::getGhId).thenComparing(PublishSortLog::getDateStr));
         List<String> ghIds = sortLogList.stream().map(PublishSortLog::getGhId).distinct().collect(Collectors.toList());
         long minTimestamp = DateUtils.dateStrToTimestamp(dateStrList.get(0), "yyyyMMdd");
-        List<Article> articleList = articleRepository.getByGhIdInAndUpdateTimeGreaterThanAndTypeEquals(ghIds, minTimestamp, ArticleTypeEnum.QUNFA.getVal());
+        List<Article> articleList = articleRepository.getByGhIdInAndPublishTimestampGreaterThanAndTypeEquals(ghIds, minTimestamp, ArticleTypeEnum.QUNFA.getVal());
         articleList = articleList.stream().filter(o -> o.getItemIndex() == 1).collect(Collectors.toList());
         Map<String, Map<String, Article>> articleMap = articleList.stream().collect(
                 Collectors.groupingBy(Article::getGhId, Collectors.toMap(
-                        o -> DateUtils.timestampToYMDStr(o.getUpdateTime(), "yyyyMMdd"), o -> o,
+                        o -> DateUtils.timestampToYMDStr(o.getPublishTimestamp(), "yyyyMMdd"), o -> o,
                         (existing, replacement) -> replacement)));
         List<String> titleList = articleList.stream().map(Article::getTitle).distinct().collect(Collectors.toList());
         List<PublishContent> hisPublishList = new ArrayList<>();
@@ -1427,7 +1427,7 @@ public class DataDashboardService {
             if (Objects.nonNull(map)) {
                 List<String> avgMapDateList = new ArrayList<>(map.keySet());
                 String publishDate = DateUtils.findNearestDate(avgMapDateList,
-                        DateUtils.timestampToYMDStr(article.getUpdateTime(), "yyyy-MM-dd"), "yyyy-MM-dd");
+                        DateUtils.timestampToYMDStr(article.getPublishTimestamp(), "yyyy-MM-dd"), "yyyy-MM-dd");
                 AccountAvgInfo accountAvgInfo = map.get(publishDate);
                 if (Objects.nonNull(accountAvgInfo)) {
                     item.setReadAvg(accountAvgInfo.getReadAvg());
@@ -1436,7 +1436,7 @@ public class DataDashboardService {
             }
             List<PublishContent> hisPublish = hisPublishMap.get(article.getTitle());
             long hisMinDate = hisPublish.stream().mapToLong(PublishContent::getPublishTimestamp).min().orElse(0);
-            int explorationInterval = (int) ((article.getUpdateTime() - (hisMinDate / 1000)) / 86400);
+            int explorationInterval = (int) ((article.getPublishTimestamp() - (hisMinDate / 1000)) / 86400);
             item.setFirstExplorationIntervalAvg(explorationInterval);
             result.add(item);
         }

+ 5 - 5
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/recall/RecallService.java

@@ -281,7 +281,7 @@ public class RecallService implements ApplicationContextAware {
             }
             content.setHisPublishArticleList(new ArrayList<>());
             for (Article hisArticle : hisArticles) {
-                if (ScoreStrategy.hisContentLateFilter(hisArticle.getUpdateTime())) {
+                if (ScoreStrategy.hisContentLateFilter(hisArticle.getPublishTimestamp())) {
                     continue;
                 }
                 ContentHisPublishArticle article = new ContentHisPublishArticle();
@@ -292,7 +292,7 @@ public class RecallService implements ApplicationContextAware {
                 // 设置账号位置阅读均值
                 int avgViewCount = 0;
                 Map<String, Map<String, AccountAvgInfo>> dateAvgMap = accountAvgInfoIndexMap.get(hisArticle.getGhId());
-                String hisPublishDate = DateUtils.timestampToYMDStr(article.getUpdateTime(), "yyyy-MM-dd");
+                String hisPublishDate = DateUtils.timestampToYMDStr(article.getPublishTimestamp(), "yyyy-MM-dd");
                 if (Objects.nonNull(dateAvgMap)) {
                     List<String> avgMapDateList = new ArrayList<>(dateAvgMap.keySet());
                     hisPublishDate = DateUtils.findNearestDate(avgMapDateList, hisPublishDate, "yyyy-MM-dd");
@@ -362,14 +362,14 @@ public class RecallService implements ApplicationContextAware {
             }
             if (CollectionUtils.isEmpty(article.getArticleDetailInfoList())) {
                 // 仅判断7.12以后发布文章
-                if (article.getUpdateTime() > 1720713600 && contentHisFeishuEnable) {
+                if (article.getPublishTimestamp() > 1720713600 && contentHisFeishuEnable) {
                     FeishuMessageSender.sendWebHookMessage(FeishuRobotIdEnum.RECOMMEND.getRobotId(),
                             "历史表现裂变特征获取失败\n"
                                     + "ghId: " + article.getGhId() + "\n"
                                     + "账号名称: " + article.getAccountName() + "\n"
                                     + "位置: " + article.getItemIndex() + "\n"
                                     + "标题: " + article.getTitle() + "\n"
-                                    + "发布时间: " + DateUtils.timestampToYMDStr(article.getUpdateTime(), "yyyyMMdd") + "\n"
+                                    + "发布时间: " + DateUtils.timestampToYMDStr(article.getPublishTimestamp(), "yyyyMMdd") + "\n"
                                     + "wxsn: " + article.getWxSn());
                 }
                 continue;
@@ -398,7 +398,7 @@ public class RecallService implements ApplicationContextAware {
                 t0FissionByReadAvgCorrelationSum += article.getT0FissionByReadAvg() * correlation;
             }
             fissionSum += sumFission0;
-            int hour = DateUtils.getHourByTimestamp(article.getUpdateTime());
+            int hour = DateUtils.getHourByTimestamp(article.getPublishTimestamp());
             if (hour >= 12) {
                 fissionWeightSum += sumFission0 / morningNoonFissionRate;
             } else {

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

@@ -69,7 +69,7 @@ public class ViewCountRateCorrelationStrategy implements ScoreStrategy {
                 double maxAvgViewCount = 0D;
                 for (ContentHisPublishArticle hisItem : content.getHisPublishArticleList()) {
                     // 过滤掉发布时间晚于19点数据
-                    if (ScoreStrategy.hisContentLateFilter(hisItem.getUpdateTime())) {
+                    if (ScoreStrategy.hisContentLateFilter(hisItem.getPublishTimestamp())) {
                         continue;
                     }
                     if (hisItem.isInnerAccount() && Objects.nonNull(hisItem.getViewCount())

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

@@ -69,7 +69,7 @@ public class ViewCountRateStrategy implements ScoreStrategy {
                 double maxAvgViewCount = 0D;
                 for (ContentHisPublishArticle hisItem : content.getHisPublishArticleList()) {
                     // 过滤掉发布时间晚于19点数据
-                    if (ScoreStrategy.hisContentLateFilter(hisItem.getUpdateTime())) {
+                    if (ScoreStrategy.hisContentLateFilter(hisItem.getPublishTimestamp())) {
                         continue;
                     }
                     if (hisItem.isInnerAccount() && Objects.nonNull(hisItem.getViewCount())

+ 8 - 8
long-article-recommend-service/src/test/java/com/tzld/longarticle/recommend/server/RecommendTest.java

@@ -67,7 +67,7 @@ public class RecommendTest {
 //    @Test
 //    void exportData() {
 //        Set<String> ghIds = new HashSet<>(Arrays.asList("gh_adca24a8f429", "gh_e0eb490115f5", "gh_51e4ad40466d", "gh_95ed5ecf9363"));
-//        List<Article> articleList = articleRepository.getByGhIdInAndUpdateTimeGreaterThanAndTypeEquals(ghIds, 1722441600L, ArticleTypeEnum.qunfa.getVal());
+//        List<Article> articleList = articleRepository.getByGhIdInAndPublishTimestampGreaterThanAndTypeEquals(ghIds, 1722441600L, ArticleTypeEnum.qunfa.getVal());
 //
 //        Map<String, Map<Integer, List<Article>>> map = articleList.stream()
 //                .collect(Collectors.groupingBy(Article::getTitle, Collectors.groupingBy(Article::getItemIndex)));
@@ -101,7 +101,7 @@ public class RecommendTest {
 //            Map<String, AccountAvgInfo> accountAvgInfoMap = accountAvgInfoIndexMap.get(article.getGhId());
 //            AccountAvgInfo avgInfo = accountAvgInfoMap.get(article.getItemIndex().toString());
 //            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
-//            String date = sdf.format(new Date(article.getUpdateTime() * 1000));
+//            String date = sdf.format(new Date(article.getPublishTimestamp() * 1000));
 //            JSONObject obj = new JSONObject();
 //            obj.put("ghId", article.getGhId());
 //            obj.put("accountName", article.getAccountName());
@@ -188,8 +188,8 @@ public class RecommendTest {
         List<String> morning = Lists.newArrayList("gh_084a485e859a", "gh_183d80deffb8", "gh_5ff48e9fb9ef", "gh_6d9f36e3a7be", "gh_9f8dc5b0c74e", "gh_e0eb490115f5", "gh_e24da99dc899");
         List<String> noon = Lists.newArrayList("gh_080bb43aa0dc", "gh_0c89e11f8bf3", "gh_192c9cf58b13", "gh_1b27dd1beeca", "gh_1d887d61088c", "gh_29074b51f2b7", "gh_3ed305b5817f", "gh_5ae65db96cb7", "gh_6b7c2a257263", "gh_6cfd1132df94", "gh_6d205db62f04", "gh_72bace6b3059", "gh_7e5818b2dd83", "gh_7f5075624a50", "gh_89ef4798d3ea", "gh_9877c8541764", "gh_9eef14ad6c16", "gh_a2901d34f75b", "gh_b15de7c99912", "gh_b676b7ad9b74", "gh_b6f2c5332c72", "gh_bfe5b705324a", "gh_bff0bcb0694a", "gh_c5cdf60d9ab4", "gh_c69776baf2cd", "gh_d49df5e974ca", "gh_d4dffc34ac39", "gh_dd4c857bbb36", "gh_ee78360d06f5", "gh_f25b5fb01977", "gh_f902cea89e48", "gh_ff487cb5dab3");
         String dateStr = "2024-09-12";
-        List<Article> articleList = articleRepository.getByUpdateTimeGreaterThanAndTypeEquals(1725120000L, ArticleTypeEnum.QUNFA.getVal());
-        articleList = articleList.stream().filter(o -> o.getItemIndex() == 1 && o.getUpdateTime() < 1726675200).collect(Collectors.toList());
+        List<Article> articleList = articleRepository.getByPublishTimestampGreaterThanAndTypeEquals(1725120000L, ArticleTypeEnum.QUNFA.getVal());
+        articleList = articleList.stream().filter(o -> o.getItemIndex() == 1 && o.getPublishTimestamp() < 1726675200).collect(Collectors.toList());
         Map<String, List<Article>> map = articleList.stream().collect(Collectors.groupingBy(Article::getTitle));
         List<AccountAvgInfo> accountAvgInfoList = accountAvgInfoRepository.getAllByUpdateTime(dateStr);
         accountAvgInfoList = accountAvgInfoList.stream().filter(o -> o.getPosition().equals("1")).collect(Collectors.toList());
@@ -269,10 +269,10 @@ public class RecommendTest {
         sortLogList = sortLogList.stream().filter(o -> o.getIndex() == 1).collect(Collectors.toList());
         sortLogList.sort(Comparator.comparing(PublishSortLog::getGhId).thenComparing(PublishSortLog::getDateStr));
         List<String> ghIds = sortLogList.stream().map(PublishSortLog::getGhId).distinct().collect(Collectors.toList());
-        List<Article> articleList = articleRepository.getByGhIdInAndUpdateTimeGreaterThanAndTypeEquals(ghIds, 1727452800L, ArticleTypeEnum.QUNFA.getVal());
+        List<Article> articleList = articleRepository.getByGhIdInAndPublishTimestampGreaterThanAndTypeEquals(ghIds, 1727452800L, ArticleTypeEnum.QUNFA.getVal());
         articleList = articleList.stream().filter(o -> o.getItemIndex() == 1).collect(Collectors.toList());
         Map<String, Map<String, Article>> articleMap = articleList.stream().collect(Collectors.groupingBy(Article::getGhId, Collectors.toMap(
-                o -> DateUtils.timestampToYMDStr(o.getUpdateTime(),"yyyyMMdd"), o -> o,
+                o -> DateUtils.timestampToYMDStr(o.getPublishTimestamp(),"yyyyMMdd"), o -> o,
                 (existing, replacement) -> replacement)));
         List<AccountAvgInfo> accountAvgInfoList = accountAvgInfoRepository.getAllByGhIdIn(new HashSet<>(ghIds));
         Map<String, Map<String, AccountAvgInfo>> accountAvgInfoMap = accountAvgInfoList.stream()
@@ -380,7 +380,7 @@ public class RecommendTest {
             if (Objects.nonNull(map)) {
                 List<String> avgMapDateList = new ArrayList<>(map.keySet());
                 String publishDate = DateUtils.findNearestDate(avgMapDateList,
-                        DateUtils.timestampToYMDStr(article.getUpdateTime(), "yyyy-MM-dd"), "yyyy-MM-dd");
+                        DateUtils.timestampToYMDStr(article.getPublishTimestamp(), "yyyy-MM-dd"), "yyyy-MM-dd");
                 AccountAvgInfo accountAvgInfo = map.get(publishDate);
                 if (Objects.nonNull(accountAvgInfo)) {
                     cell.setCellValue(accountAvgInfo.getReadAvg());
@@ -530,7 +530,7 @@ public class RecommendTest {
         List<String> ghIds = Arrays.asList("gh_d7fa1998b4e1","gh_52100b6803fb","gh_8d7fc54d5026");
         List<String> accountNames = Arrays.asList("生活超读","灵读生活","生活情感读");
         List<Integer> fans = Arrays.asList(85759,103083,79214);
-        List<Article> articleList = articleRepository.getByGhIdInAndUpdateTimeLessThanAndTypeEquals(
+        List<Article> articleList = articleRepository.getByGhIdInAndPublishTimestampLessThanAndTypeEquals(
                 Arrays.asList("gh_02f5bca5b5d9"), 1729353600L, ArticleTypeEnum.QUNFA.getVal());
         for (int i = 0; i < ghIds.size(); i++) {
             String ghId = ghIds.get(i);

+ 1 - 1
long-article-recommend-service/src/test/java/com/tzld/longarticle/recommend/server/ScoreStrategyTest.java

@@ -56,7 +56,7 @@ public class ScoreStrategyTest {
         System.out.println(JSONObject.toJSONString(param.getContents().get(0).getHisPublishArticleList()));
         List<Score> result = viewCountRateStrategy.score(param);
         System.out.println(JSONObject.toJSONString(result));
-        //hisArticleList = hisArticleList.stream().filter(o -> o.getUpdateTime() < 1729267200).collect(Collectors.toList());
+        //hisArticleList = hisArticleList.stream().filter(o -> o.getPublishTimestamp() < 1729267200).collect(Collectors.toList());
     }
 
 }