| | |
| | | import com.doumee.biz.system.SystemRoleBiz; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.constants.OperaType; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.service.business.third.model.ApiResponse; |
| | | import com.doumee.service.business.third.model.PageData; |
| | | import com.doumee.service.business.third.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.system.dto.CreateRoleMenuDTO; |
| | | import com.doumee.dao.system.dto.CreateRolePermissionDTO; |
| | | import com.doumee.dao.system.dto.QuerySystemRoleDTO; |
| | |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import org.springframework.web.bind.annotation.*; |
| | | /** |
| | | * @author Eva.Caesar Liu |
| | | * @date 2023/03/21 14:49 |
| | |
| | | @ApiOperation("配置角色菜单") |
| | | @PostMapping("/createRoleMenu") |
| | | @RequiresPermissions("system:role:createRoleMenu") |
| | | public ApiResponse createRoleMenu (@Validated @RequestBody CreateRoleMenuDTO dto) { |
| | | public ApiResponse createRoleMenu (@Validated @RequestBody CreateRoleMenuDTO dto, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | dto.setCreateUser(this.getLoginUser(token).getId()); |
| | | systemRoleBiz.createRoleMenu(dto); |
| | | return ApiResponse.success(null); |
| | | } |
| | |
| | | @ApiOperation("配置角色权限") |
| | | @PostMapping("/createRolePermission") |
| | | @RequiresPermissions("system:role:createRolePermission") |
| | | public ApiResponse createRolePermission (@Validated @RequestBody CreateRolePermissionDTO dto) { |
| | | public ApiResponse createRolePermission (@Validated @RequestBody CreateRolePermissionDTO dto, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | dto.setCreateUser(this.getLoginUser(token).getId()); |
| | | systemRoleBiz.createRolePermission(dto); |
| | | return ApiResponse.success(null); |
| | | } |
| | |
| | | @ApiOperation("新建") |
| | | @PostMapping("/create") |
| | | @RequiresPermissions("system:role:create") |
| | | public ApiResponse create(@Validated(OperaType.Create.class) @RequestBody SystemRole systemRole) { |
| | | public ApiResponse create(@Validated(OperaType.Create.class) @RequestBody SystemRole systemRole, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | systemRole.setCreateUser(this.getLoginUser(token).getId()); |
| | | return ApiResponse.success(systemRoleBiz.create(systemRole)); |
| | | } |
| | | |
| | |
| | | @ApiOperation("修改") |
| | | @PostMapping("/updateById") |
| | | @RequiresPermissions("system:role:update") |
| | | public ApiResponse updateById(@Validated(OperaType.Update.class) @RequestBody SystemRole systemRole) { |
| | | public ApiResponse updateById(@Validated(OperaType.Update.class) @RequestBody SystemRole systemRole, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | systemRole.setUpdateUser(this.getLoginUser(token).getId()); |
| | | systemRoleBiz.updateById(systemRole); |
| | | return ApiResponse.success(null); |
| | | } |