|
@@ -3,7 +3,6 @@ package com.persagy.account.controller;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
-import com.persagy.account.pojo.vo.role.*;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
@@ -15,18 +14,23 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.google.common.collect.Lists;
|
|
|
-import com.persagy.common.constant.SaasCommonConstant;
|
|
|
-import com.persagy.common.enums.ResponseCode;
|
|
|
-import com.persagy.common.utils.ResponseResult;
|
|
|
-import com.persagy.common.utils.ResponseResultUtil;
|
|
|
-import com.persagy.common.utils.StringUtil;
|
|
|
import com.persagy.account.manage.SaasRoleMenuHandler;
|
|
|
import com.persagy.account.pojo.dto.SaasGroup;
|
|
|
import com.persagy.account.pojo.dto.SaasRole;
|
|
|
+import com.persagy.account.pojo.vo.role.SaasRoleCreateVO;
|
|
|
+import com.persagy.account.pojo.vo.role.SaasRoleDeleteVO;
|
|
|
+import com.persagy.account.pojo.vo.role.SaasRolePageVO;
|
|
|
+import com.persagy.account.pojo.vo.role.SaasRoleQueryByNameVO;
|
|
|
+import com.persagy.account.pojo.vo.role.SaasRoleQueryVO;
|
|
|
import com.persagy.account.service.ISaasAccountRoleService;
|
|
|
import com.persagy.account.service.ISaasGroupService;
|
|
|
import com.persagy.account.service.ISaasRoleMenuService;
|
|
|
import com.persagy.account.service.ISaasRoleService;
|
|
|
+import com.persagy.common.constant.SaasCommonConstant;
|
|
|
+import com.persagy.common.enums.ResponseCode;
|
|
|
+import com.persagy.common.utils.ResponseResult;
|
|
|
+import com.persagy.common.utils.ResponseResultUtil;
|
|
|
+import com.persagy.common.utils.StringUtil;
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
import io.swagger.annotations.Api;
|
|
@@ -179,6 +183,7 @@ public class SaasRoleController {
|
|
|
saasRole.setId(null);
|
|
|
saasRole.setUpdateUser(createVO.getAccountId());
|
|
|
|
|
|
+ this.saasRoleMenuHandler.validRoleMenus(createVO.getAuths());
|
|
|
result = this.saasRoleMenuHandler.createSaasRole(saasRole, createVO.getAuths());
|
|
|
return result ? ResponseResultUtil.successResult("保存成功", saasRole.getId()) : ResponseResultUtil.errorResult("保存失败");
|
|
|
}
|
|
@@ -217,6 +222,7 @@ public class SaasRoleController {
|
|
|
BeanUtils.copyProperties(createVO, saasRole);
|
|
|
saasRole.setUpdateUser(createVO.getAccountId());
|
|
|
|
|
|
+ this.saasRoleMenuHandler.validRoleMenus(createVO.getAuths());
|
|
|
result = this.saasRoleMenuHandler.updateSaasRole(saasRole, createVO.getAuths());
|
|
|
return result ? ResponseResultUtil.successResult("更新成功") : ResponseResultUtil.errorResult("更新失败");
|
|
|
}
|