|
@@ -2,7 +2,8 @@ package com.tzld.longarticle.recommend.server.service.recall.strategy;
|
|
|
|
|
|
import com.tzld.longarticle.recommend.server.model.Content;
|
|
import com.tzld.longarticle.recommend.server.model.Content;
|
|
import com.tzld.longarticle.recommend.server.remote.AIGCRemoteService;
|
|
import com.tzld.longarticle.recommend.server.remote.AIGCRemoteService;
|
|
-import com.tzld.longarticle.recommend.server.repository.mapper.crawler.CrawlerBaseMapper;
|
|
|
|
|
|
+import com.tzld.longarticle.recommend.server.repository.aigc.CrawlerMetaArticleRepository;
|
|
|
|
+import com.tzld.longarticle.recommend.server.repository.entity.aigc.CrawlerMetaArticle;
|
|
import com.tzld.longarticle.recommend.server.service.filter.FilterParam;
|
|
import com.tzld.longarticle.recommend.server.service.filter.FilterParam;
|
|
import com.tzld.longarticle.recommend.server.service.filter.FilterResult;
|
|
import com.tzld.longarticle.recommend.server.service.filter.FilterResult;
|
|
import com.tzld.longarticle.recommend.server.service.filter.FilterService;
|
|
import com.tzld.longarticle.recommend.server.service.filter.FilterService;
|
|
@@ -27,7 +28,7 @@ public class ColdStartBackupRecallStrategy implements RecallStrategy {
|
|
@Autowired
|
|
@Autowired
|
|
private AIGCRemoteService aigcRemoteService;
|
|
private AIGCRemoteService aigcRemoteService;
|
|
@Autowired
|
|
@Autowired
|
|
- CrawlerBaseMapper crawlerBaseMapper;
|
|
|
|
|
|
+ CrawlerMetaArticleRepository crawlerMetaArticleRepository;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public RecallResult.RecallData recall(RecallParam param) {
|
|
public RecallResult.RecallData recall(RecallParam param) {
|
|
@@ -50,22 +51,22 @@ public class ColdStartBackupRecallStrategy implements RecallStrategy {
|
|
|
|
|
|
private void setContentCategory(List<Content> contentList) {
|
|
private void setContentCategory(List<Content> contentList) {
|
|
List<String> channelContentIds = contentList.stream().map(Content::getCrawlerChannelContentId).collect(Collectors.toList());
|
|
List<String> channelContentIds = contentList.stream().map(Content::getCrawlerChannelContentId).collect(Collectors.toList());
|
|
- List<ContentCategory> categoryList = getContentCategoryByChannelContentId(channelContentIds);
|
|
|
|
|
|
+ List<CrawlerMetaArticle> categoryList = getContentCategoryByChannelContentId(channelContentIds);
|
|
if (CollectionUtils.isEmpty(categoryList)) {
|
|
if (CollectionUtils.isEmpty(categoryList)) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- Map<String, List<String>> categoryMap = categoryList.stream().collect(Collectors.groupingBy(ContentCategory::getContentChannelId,
|
|
|
|
- Collectors.mapping(ContentCategory::getCategory, Collectors.toList())));
|
|
|
|
|
|
+ Map<String, List<String>> categoryMap = categoryList.stream().collect(Collectors.groupingBy(CrawlerMetaArticle::getChannelContentId,
|
|
|
|
+ Collectors.mapping(CrawlerMetaArticle::getCategory, Collectors.toList())));
|
|
for (Content content : contentList) {
|
|
for (Content content : contentList) {
|
|
content.setCategory(categoryMap.get(content.getCrawlerChannelContentId()));
|
|
content.setCategory(categoryMap.get(content.getCrawlerChannelContentId()));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private List<ContentCategory> getContentCategoryByChannelContentId(List<String> channelContentIds) {
|
|
|
|
|
|
+ private List<CrawlerMetaArticle> getContentCategoryByChannelContentId(List<String> channelContentIds) {
|
|
if (CollectionUtils.isEmpty(channelContentIds)) {
|
|
if (CollectionUtils.isEmpty(channelContentIds)) {
|
|
return new ArrayList<>();
|
|
return new ArrayList<>();
|
|
}
|
|
}
|
|
- return crawlerBaseMapper.getContentCategory(channelContentIds);
|
|
|
|
|
|
+ return crawlerMetaArticleRepository.getByChannelContentIdIn(channelContentIds);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|