use of me.zhyd.hunter.config.HunterConfig in project OneBlog by zhangyd-c.
the class RemoverServiceImpl method saveArticles.
private void saveArticles(Long typeId, HunterConfig config, HunterPrintWriter writerUtil, CopyOnWriteArrayList<VirtualArticle> list) {
// 获取数据库中的标签列表
List<Tags> tags = tagsService.listAll();
Map<String, Long> originalTags = tags.stream().collect(Collectors.toMap(tag -> tag.getName().toUpperCase(), Tags::getId));
User user = SessionUtil.getUser();
// 添加文章到数据库
Article article = null;
for (VirtualArticle spiderVirtualArticle : list) {
article = this.saveArticle(typeId, config.isConvertImg(), writerUtil, user, spiderVirtualArticle);
this.saveTags(writerUtil, originalTags, article, spiderVirtualArticle);
}
}
Aggregations