微信小程序直播V0.2

This commit is contained in:
lifenlong
2021-05-18 23:34:05 +08:00
parent 0173ba814e
commit 02827a2f8b
7 changed files with 67 additions and 103 deletions

View File

@@ -1,6 +1,7 @@
package cn.lili.controller.member;
import cn.lili.common.enums.ResultCode;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.utils.PageUtil;
import cn.lili.common.utils.ResultUtil;
import cn.lili.common.vo.PageVO;
@@ -53,7 +54,7 @@ public class MemberGradeManagerController {
if (memberGradeService.updateById(memberGrade)) {
return ResultUtil.success(ResultCode.SUCCESS);
}
return ResultUtil.error(ResultCode.ERROR);
throw new ServiceException(ResultCode.ERROR);
}
@ApiOperation(value = "删除会员等级")
@@ -61,10 +62,10 @@ public class MemberGradeManagerController {
@PutMapping(value = "/delete/{id}")
public ResultMessage<IPage<Object>> delete(@PathVariable String id) {
if(memberGradeService.getById(id).getIsDefault()){
return ResultUtil.error(ResultCode.USER_GRADE_IS_DEFAULT);
throw new ServiceException(ResultCode.USER_GRADE_IS_DEFAULT);
}else if(memberGradeService.removeById(id)){
return ResultUtil.success(ResultCode.SUCCESS);
}
return ResultUtil.error(ResultCode.ERROR);
throw new ServiceException(ResultCode.ERROR);
}
}