🎨 剔除主动推送百度 SEO 功能

This commit is contained in:
ronger 2021-12-14 10:20:45 +08:00
parent f63ed152fc
commit dff2145c0f
2 changed files with 4 additions and 20 deletions

View File

@ -199,30 +199,14 @@ public class ArticleServiceImpl extends AbstractService<Article> implements Arti
}
if (StringUtils.isNotBlank(articleContentHtml)) {
String previewContent;
if (articleContentHtml.length() > MAX_PREVIEW) {
previewContent = BaiDuAipUtils.getNewsSummary(newArticle.getArticleTitle(), articleContentHtml, MAX_PREVIEW);
String previewContent = Html2TextUtil.getContent(articleContentHtml);
if (previewContent.length() > MAX_PREVIEW) {
previewContent = previewContent.substring(0, MAX_PREVIEW);
}
} else {
previewContent = Html2TextUtil.getContent(articleContentHtml);
}
newArticle.setArticlePreviewContent(previewContent);
}
articleMapper.updateByPrimaryKeySelective(newArticle);
// 推送百度 SEO
if (!ProjectConstant.ENV.equals(env)
&& defaultStatus.equals(newArticle.getArticleStatus())
&& articleContent.length() >= MAX_PREVIEW) {
if (isUpdate) {
BaiDuUtils.sendUpdateSEOData(newArticle.getArticlePermalink());
} else {
BaiDuUtils.sendSEOData(newArticle.getArticlePermalink());
}
}
map.put("id", newArticle.getIdArticle());
return map;
}

View File

@ -10,7 +10,7 @@ import org.springframework.stereotype.Component;
/**
* @author ronger
*/
@Component
//@Component
@Slf4j
public class BaiDuCronTask {