|
|
@ -1780,7 +1780,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void topArticle(String articleId, String type) { |
|
|
|
public void topArticle(String articleId, String type,String imgUrl) { |
|
|
|
ArticleEntity articleEntity = baseDao.selectById(articleId); |
|
|
|
if (null != articleEntity) { |
|
|
|
/** |
|
|
@ -1789,6 +1789,19 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit |
|
|
|
*/ |
|
|
|
if ("top".equals(type)) { |
|
|
|
articleEntity.setIsTop(NumConstant.ONE); |
|
|
|
if(StringUtils.isNotBlank(imgUrl)){ |
|
|
|
//如果没有封面图片的话,更新
|
|
|
|
LambdaQueryWrapper<ArticleCoverEntity> queryWrapper=new LambdaQueryWrapper(); |
|
|
|
queryWrapper.eq(ArticleCoverEntity::getArticleId,articleEntity); |
|
|
|
if (articleCoverDao.selectCount(queryWrapper) == 0) { |
|
|
|
ArticleCoverEntity articleCoverEntity=new ArticleCoverEntity(); |
|
|
|
articleCoverEntity.setCustomerId(articleEntity.getCustomerId()); |
|
|
|
articleCoverEntity.setArticleId(articleId); |
|
|
|
articleCoverEntity.setImgUrl(imgUrl); |
|
|
|
articleCoverEntity.setAuditStatus("pass"); |
|
|
|
articleCoverDao.insert(articleCoverEntity); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if ("cancel_top".equals(type)) { |
|
|
|
articleEntity.setIsTop(NumConstant.ZERO); |
|
|
|
} |
|
|
|