Merge branch 'master' of gitee.com:beijing_hongye_huicheng/lilishop
This commit is contained in:
@@ -53,7 +53,7 @@ public interface ArticleService extends IService<Article> {
|
||||
Article updateArticle(Article article);
|
||||
|
||||
/**
|
||||
* 删除文章
|
||||
* 删除文章--id
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
@@ -87,4 +87,20 @@ public interface ArticleService extends IService<Article> {
|
||||
*/
|
||||
@CacheEvict(key = "#id")
|
||||
Boolean updateArticleStatus(String id, boolean status);
|
||||
|
||||
/**
|
||||
* 修改文章--文章类型修改
|
||||
* @param article
|
||||
* @return
|
||||
*/
|
||||
@CacheEvict(key = "#article.type")
|
||||
Article updateArticleType(Article article);
|
||||
|
||||
/**
|
||||
* 删除文章--类型
|
||||
* @param type
|
||||
* @param id
|
||||
*/
|
||||
@CacheEvict(key = "#type")
|
||||
void delAllByType(String type, String id);
|
||||
}
|
||||
@@ -91,4 +91,17 @@ public class ArticleServiceImpl extends ServiceImpl<ArticleMapper, Article> impl
|
||||
article.setOpenStatus(status);
|
||||
return this.updateById(article);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Article updateArticleType(Article article) {
|
||||
Article oldArticle = this.getById(article.getId());
|
||||
BeanUtil.copyProperties(article, oldArticle);
|
||||
this.updateById(oldArticle);
|
||||
return oldArticle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delAllByType(String type,String id) {
|
||||
this.removeById(id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user