code review add comment

This commit is contained in:
陈维伟 2023-09-14 16:19:53 +08:00
parent 9af061131f
commit 675e1bd065
2 changed files with 6 additions and 3 deletions

View File

@ -7,6 +7,7 @@ import cn.axzo.tyr.client.model.res.QueryBatchByIdentityIdTypeRes;
import cn.axzo.tyr.client.model.vo.SaasRoleVO;
import cn.axzo.tyr.client.model.vo.SaveOrUpdateRoleVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -27,7 +28,7 @@ public interface TyrSaasRoleApi {
* 如果权限列表不为空则创建通用权限
*/
@PostMapping("/api/saasRole/saveOrUpdate")
ApiResult<Long> saveOrUpdate(@RequestBody SaveOrUpdateRoleVO saveOrUpdateRole);
ApiResult<Long> saveOrUpdate(@RequestBody @Validated SaveOrUpdateRoleVO saveOrUpdateRole);
/**
* 根据id查询详情

View File

@ -99,8 +99,10 @@ public class SaasRoleGroupServiceImpl implements SaasRoleGroupService {
if (CollectionUtils.isEmpty(ids)) {
return;
}
int relationCount = saasRoleGroupRelationDao.lambdaQuery().in(SaasRoleGroupRelation::getSaasRoleGroupId, ids)
.eq(SaasRoleGroupRelation::getIsDelete, TableIsDeleteEnum.NORMAL.value).count();
int relationCount = saasRoleGroupRelationDao.lambdaQuery()
.in(SaasRoleGroupRelation::getSaasRoleGroupId, ids)
.eq(SaasRoleGroupRelation::getIsDelete, TableIsDeleteEnum.NORMAL.value)
.count();
if (relationCount > 0) {
throw new BizException(BaseCode.BAD_REQUEST, "分组关联角色,不能删除");
}