Ver Fonte

Merge branch 'main' into wyp/accountStrategy

# Conflicts:
#	long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recall/RecallService.java
wangyunpeng há 9 meses atrás
pai
commit
f5863d4e29

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

@@ -15,5 +15,5 @@ public class ContentHisPublishArticle {
     private Long updateTime;
     private Integer avgViewCount;
     private Double viewCountRate;
-
+    private boolean isInnerAccount;
 }

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

@@ -164,7 +164,11 @@ public class RecallService implements ApplicationContextAware {
                 ContentHisPublishArticle article = new ContentHisPublishArticle();
                 BeanUtils.copyProperties(hisArticle, article);
                 AvgReadDTO dto = jsonObject.getObject(hisArticle.getGhId() + "_" + hisArticle.getItemIndex(), AvgReadDTO.class);
-                Integer avgViewCount = dto == null ? 0 : (int) dto.getReadAvg();
+                int avgViewCount = 0;
+                if (Objects.nonNull(dto)) {
+                    article.setInnerAccount(true);
+                    avgViewCount = (int) dto.getReadAvg();
+                }
                 article.setAvgViewCount(avgViewCount);
                 if (Objects.nonNull(article.getAvgViewCount()) && article.getAvgViewCount() > 0) {
                     article.setViewCountRate((article.getShowViewCount() * 1.0) / article.getAvgViewCount());