Browse Source

Update SensitiveStrategy: comment useless code

StrayWarrior 7 months ago
parent
commit
7081abe438

+ 8 - 8
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/filter/strategy/SensitiveStrategy.java

@@ -39,17 +39,17 @@ public class SensitiveStrategy implements FilterStrategy {
     @Override
     public FilterResult filter(FilterParam param) {
         FilterResult filterResult = new FilterResult();
-        List<String> result = new ArrayList<>();
+        List<String> result = new ArrayList<>(param.getContents().size());
         List<Content> filterContents = new ArrayList<>();
 
-        Map<String, String> titleMd5Map = new HashMap<>();
+//        Map<String, String> titleMd5Map = new HashMap<>();
 //        Map<String, ArticleSensitive> articleSensitiveMap = new HashMap<>();
-        List<String> md5List = new ArrayList<>();
-        for (Content content : param.getContents()) {
-            String md5 = Md5Util.encoderByMd5(content.getTitle());
-            md5List.add(md5);
-            titleMd5Map.put(content.getTitle(), md5);
-        }
+//        List<String> md5List = new ArrayList<>();
+//        for (Content content : param.getContents()) {
+//            String md5 = Md5Util.encoderByMd5(content.getTitle());
+//            md5List.add(md5);
+//            titleMd5Map.put(content.getTitle(), md5);
+//        }
 //        List<ArticleSensitive> articleSensitiveList = getArticleSensitive(md5List);
 //        if (CollectionUtil.isNotEmpty(articleSensitiveList)) {
 //            articleSensitiveMap = articleSensitiveList.stream().collect(Collectors.toMap(ArticleSensitive::getMd5, o -> o));