|
@@ -1,5 +1,6 @@
|
|
|
package com.tzld.longarticle.recommend.server.service.filter.strategy;
|
|
|
|
|
|
+import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
|
|
|
import com.tzld.longarticle.recommend.server.model.Content;
|
|
|
import com.tzld.longarticle.recommend.server.remote.AIGCRemoteService;
|
|
|
import com.tzld.longarticle.recommend.server.service.filter.FilterParam;
|
|
@@ -16,12 +17,13 @@ import java.util.List;
|
|
|
|
|
|
@Component
|
|
|
@Slf4j
|
|
|
-public class BadStrategy implements FilterStrategy {
|
|
|
+public class BadStrategy implements FilterStrategy {
|
|
|
|
|
|
@Autowired
|
|
|
private AIGCRemoteService aigcRemoteService;
|
|
|
|
|
|
|
|
|
+ @ApolloJsonValue("${badTitles:[]}")
|
|
|
private static List<String> badTitles;
|
|
|
|
|
|
static {
|
|
@@ -53,8 +55,8 @@ public class BadStrategy implements FilterStrategy {
|
|
|
public FilterResult filter(FilterParam param) {
|
|
|
FilterResult filterResult = new FilterResult();
|
|
|
List<String> result = new ArrayList<>();
|
|
|
- List<Content> contents = param.getContents();
|
|
|
- List<Content> filterContents = new ArrayList<>();
|
|
|
+ List<Content> contents = param.getContents();
|
|
|
+ List<Content> filterContents = new ArrayList<>();
|
|
|
for (Content content : contents) {
|
|
|
if (!TitleSimilarCheckUtil.isDuplicateContent(content.getTitle(), badTitles)) {
|
|
|
result.add(content.getId());
|