XiaoRuby
2023-08-26 eb34edfc7cf46e5cb5e3969d04315e6129dcbbd2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package com.yuanchu.limslaboratory.controller;
 
import com.yuanchu.limslaboratory.pojo.dto.GetAllRoleAndMenuByConditionPageDto;
import com.yuanchu.limslaboratory.pojo.dto.RoleInfoDto;
import com.yuanchu.limslaboratory.service.RoleManagerService;
import com.yuanchu.limslaboratory.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
 
/**
 * @Author 张宾
 * @Date 2023/8/23
 */
@Api(tags = "实验室-->3、角色管理")
@RestController
@RequestMapping("/role-manager")
public class RoleMangerController {
 
    @Resource
    private RoleManagerService roleManagerService;
 
    @ApiOperation("获取菜单功能树")
    @GetMapping("/getMenusTree")
    public Result<?>getMenusTree() {
      return Result.success(roleManagerService.getMenusTree());
    };
 
    @ApiOperation("新增角色")
    @PostMapping("/addRoleInfo")
    public Result<?>addRoleInfo(@RequestBody RoleInfoDto dto){
        return Result.success(roleManagerService.addRoleInfo(dto));
    }
 
    @ApiOperation("查询角色名重复")
    @GetMapping("/assertRepeat")
    public Result<?> assertRepeat(String roleName){
        return Result.success(roleManagerService.assertRepeat(roleName));
    }
 
    @ApiOperation("获取角色信息")
    @GetMapping("/getAllRoleAndMenuInfo")
    public Result<?> getAllRoleAndMenuInfo(GetAllRoleAndMenuByConditionPageDto dto){
        return Result.success(roleManagerService.getAllRoleAndMenuInfo(dto));
    }
}