bug
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.PointCategoryEntity;
|
||||
@@ -50,6 +51,12 @@ public class PointController {
|
||||
@RequestMapping("/delPointCategory")
|
||||
public R delPointCategory(@RequestBody Map<String,Object> map){
|
||||
Integer id = Integer.valueOf(map.get("pointCategoryId").toString());
|
||||
LambdaQueryWrapper<PointEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(PointEntity::getPointCategoryId,id);
|
||||
List<PointEntity> list = pointService.list(wrapper);
|
||||
if(list.size()>0){
|
||||
return R.error("此分类下存在文章,请先清空文章后再尝试删除!");
|
||||
}
|
||||
pointCategoryService.removeById(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user