|
@@ -0,0 +1,62 @@
|
|
|
+package com.tzld.longarticle.recommend.server.service.filter.strategy;
|
|
|
+
|
|
|
+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;
|
|
|
+import com.tzld.longarticle.recommend.server.service.filter.FilterStrategy;
|
|
|
+import com.tzld.longarticle.recommend.server.util.TitleSimilarCheckUtil;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+@Component
|
|
|
+@Slf4j
|
|
|
+public class BadStrategy implements FilterStrategy {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private AIGCRemoteService aigcRemoteService;
|
|
|
+
|
|
|
+ private static List<String> badTitles;
|
|
|
+
|
|
|
+ static {
|
|
|
+ badTitles = Arrays.asList("男人跟婚外女人很难断,不是因为爱,而是这三个原因,别傻傻不知",
|
|
|
+ "瑞士和平会,乌有2个好消息,有得就有失,捧场的基本是西方国家",
|
|
|
+ "华春莹代表中国,用《琉球地位未定论》,好好给日本上了一课",
|
|
|
+ "再下一城,27年的等待一朝绽放,中国开始放大招",
|
|
|
+ "一把大火,文明倒退1000年",
|
|
|
+ "善恶终有报?晚年有了儿子的王刚本以为可以安度晚年,但如今的情况却让人感叹",
|
|
|
+ "赵丽蓉:中国第一位小品女皇,因一句台词识破潜伏间谍,72岁自备寿衣,临终前为巩汉林留一句忠告",
|
|
|
+ "致命一击!美国的惊天谎言被拆穿,暴露其真实嘴脸!",
|
|
|
+ "男生遭醉汉掐脖反击后被刑拘,警方最新回应",
|
|
|
+ "“夫妻不送葬,送葬必遭殃”,为什么老伴不能去送呢?亲人去世后,最忌讳的八件事,别不当回事!",
|
|
|
+ "102岁杨振宁豪宅内,宴请小他27岁的岳母听沪剧,翁帆一个举动真情流露",
|
|
|
+ "中国垫资38亿美元帮修铁路,6年过去没还,还想期限延长至50年!",
|
|
|
+ "结婚前新娘突然要增加50万彩礼,否则不嫁,新郎无奈放弃,新娘收50万彩礼另嫁他人,1年后,报应来了!",
|
|
|
+ "张学良到死都不知道,当年救他一命的不是宋美龄,而是一个痴心女",
|
|
|
+ "美大选反转再反转!笑到最后的竟是她?拜登、特朗普都始料未及",
|
|
|
+ "大妈揣80万去儿子家住一周,7天吃咸菜,孙子:等你走了吃煎牛排",
|
|
|
+ "山西农民房檐上石狮子7万没有卖,3天后发生的事情让他始料未及",
|
|
|
+ "当不成总统了?美大选有变,中方需早做准备",
|
|
|
+ "女人最佳“绝经期”已公布,不是45岁,而是这个数,越接近越健康",
|
|
|
+ "村头光棍在下雪天捡一女婴,终身未娶拉扯张长大28年,女孩回报方式看哭众人",
|
|
|
+ "杜聿明的女儿,嫁给自己的老师杨振宁,生三个孩子事业有成",
|
|
|
+ "他享有国葬殊荣,临终捐光2000亿,大儿子开出租谋生");
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<String> filter(FilterParam param) {
|
|
|
+ List<String> result = new ArrayList<>();
|
|
|
+ List<Content> contents = param.getContents();
|
|
|
+ for (Content content : contents) {
|
|
|
+ if (!TitleSimilarCheckUtil.isDuplicateContent(content.getTitle(), badTitles)) {
|
|
|
+ result.add(content.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|