🔍 改善 SEO 提交/更新机制

This commit is contained in:
ronger 2020-08-26 09:16:27 +08:00
parent 488b0f6107
commit 2b3b7b5ac4

View File

@ -141,7 +141,7 @@ public class ArticleServiceImpl extends AbstractService<Article> implements Arti
newArticle.setArticleStatus(article.getArticleStatus()); newArticle.setArticleStatus(article.getArticleStatus());
articleMapper.insertSelective(newArticle); articleMapper.insertSelective(newArticle);
articleMapper.insertArticleContent(newArticle.getIdArticle(), articleContent, articleContentHtml); articleMapper.insertArticleContent(newArticle.getIdArticle(), articleContent, articleContentHtml);
if (!ProjectConstant.ENV.equals(env) && defaultStatus.equals(newArticle.getArticleStatus()) && articleContent.length() > MAX_PREVIEW * 3) { if (!ProjectConstant.ENV.equals(env) && defaultStatus.equals(newArticle.getArticleStatus()) && articleContent.length() >= MAX_PREVIEW) {
BaiDuUtils.sendSEOData(newArticle.getArticlePermalink()); BaiDuUtils.sendSEOData(newArticle.getArticlePermalink());
} }
} else { } else {
@ -155,7 +155,7 @@ public class ArticleServiceImpl extends AbstractService<Article> implements Arti
newArticle.setArticleStatus(article.getArticleStatus()); newArticle.setArticleStatus(article.getArticleStatus());
newArticle.setUpdatedTime(new Date()); newArticle.setUpdatedTime(new Date());
articleMapper.updateArticleContent(newArticle.getIdArticle(), articleContent, articleContentHtml); articleMapper.updateArticleContent(newArticle.getIdArticle(), articleContent, articleContentHtml);
if (!ProjectConstant.ENV.equals(env) && defaultStatus.equals(newArticle.getArticleStatus()) && articleContent.length() > MAX_PREVIEW * 3) { if (!ProjectConstant.ENV.equals(env) && defaultStatus.equals(newArticle.getArticleStatus()) && articleContent.length() >= MAX_PREVIEW) {
BaiDuUtils.sendUpdateSEOData(newArticle.getArticlePermalink()); BaiDuUtils.sendUpdateSEOData(newArticle.getArticlePermalink());
} }
} }