Explorar el Código

Merge branch 'wyp/1210-publishContentFilter' of Server/long-article-recommend into master

wangyunpeng hace 7 meses
padre
commit
84e5197108

+ 4 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/PublishContentFilterService.java

@@ -10,6 +10,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -30,6 +31,9 @@ public class PublishContentFilterService {
         List<String> filterTitleList = longArticleBaseMapper.getFilterColdLongArticleTitle();
         List<Set<Character>> firstSecondTitleCache = TitleSimilarCheckUtil.makeCache(filterTitleList);
         for (PublishContentFilterContentItem contentItem : param.getContentList()) {
+            if (!StringUtils.hasText(contentItem.getTitle())) {
+                continue;
+            }
             boolean isDuplicate = false;
             if (ContentPoolEnum.autoArticlePoolLevel4.getContentPool().equals(contentItem.getPoolLevel())) {
                 isDuplicate = TitleSimilarCheckUtil.isDuplicateContentByCache(contentItem.getTitle(),