处理分类新增
This commit is contained in:
parent
c99bf5d950
commit
0f55e3f808
|
|
@ -34,7 +34,7 @@ public class ArticleController {
|
||||||
* @return Object
|
* @return Object
|
||||||
*/
|
*/
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public Object articleList(@Validated PageParam pageParam,
|
public Object list(@Validated PageParam pageParam,
|
||||||
@RequestParam Map<String, String> params) {
|
@RequestParam Map<String, String> params) {
|
||||||
PageResult<ArticleListVo> vos = iArticleArchivesService.list(pageParam, params);
|
PageResult<ArticleListVo> vos = iArticleArchivesService.list(pageParam, params);
|
||||||
return AjaxResult.success(vos);
|
return AjaxResult.success(vos);
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import com.mdd.admin.vo.article.ArticleCateVo;
|
||||||
import com.mdd.common.core.PageResult;
|
import com.mdd.common.core.PageResult;
|
||||||
import com.mdd.common.entity.article.Article;
|
import com.mdd.common.entity.article.Article;
|
||||||
import com.mdd.common.entity.article.ArticleCategory;
|
import com.mdd.common.entity.article.ArticleCategory;
|
||||||
|
import com.mdd.common.exception.OperateException;
|
||||||
import com.mdd.common.mapper.article.ArticleCategoryMapper;
|
import com.mdd.common.mapper.article.ArticleCategoryMapper;
|
||||||
import com.mdd.common.mapper.article.ArticleMapper;
|
import com.mdd.common.mapper.article.ArticleMapper;
|
||||||
import com.mdd.common.utils.TimeUtil;
|
import com.mdd.common.utils.TimeUtil;
|
||||||
|
|
@ -140,6 +141,10 @@ public class ArticleCategoryServiceImpl implements IArticleCategoryService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void add(CategoryParam categoryParam) {
|
public void add(CategoryParam categoryParam) {
|
||||||
|
if (categoryParam.getName().trim().equals("")) {
|
||||||
|
throw new OperateException("名称不允许为空值!");
|
||||||
|
}
|
||||||
|
|
||||||
ArticleCategory model = new ArticleCategory();
|
ArticleCategory model = new ArticleCategory();
|
||||||
model.setId(categoryParam.getId());
|
model.setId(categoryParam.getId());
|
||||||
model.setName(categoryParam.getName());
|
model.setName(categoryParam.getName());
|
||||||
|
|
@ -157,6 +162,10 @@ public class ArticleCategoryServiceImpl implements IArticleCategoryService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void edit(CategoryParam categoryParam) {
|
public void edit(CategoryParam categoryParam) {
|
||||||
|
if (categoryParam.getName().trim().equals("")) {
|
||||||
|
throw new OperateException("名称不允许为空值!");
|
||||||
|
}
|
||||||
|
|
||||||
ArticleCategory model = articleCategoryMapper.selectOne(
|
ArticleCategory model = articleCategoryMapper.selectOne(
|
||||||
new QueryWrapper<ArticleCategory>()
|
new QueryWrapper<ArticleCategory>()
|
||||||
.select(ArticleCategory.class, info->
|
.select(ArticleCategory.class, info->
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue