| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.annotation.ValueAuth; |
| | | import com.yuanchu.mom.annotation.ValueClassify; |
| | | import com.yuanchu.mom.dto.RolePowerDto; |
| | | import com.yuanchu.mom.pojo.Role; |
| | | import com.yuanchu.mom.service.PowerService; |
| | |
| | | private RoleService roleService; |
| | | |
| | | private PowerService powerService; |
| | | |
| | | @ValueAuth |
| | | @ApiOperation(value = "获取角色列表枚举") |
| | | @GetMapping("/selectRoleList") |
| | | public Result selectRoleList(){ |
| | | return Result.success(roleService.selectList()); |
| | | } |
| | | |
| | | |
| | | @ValueAuth |
| | | @ApiOperation(value = "获取角色列表") |
| | | @PostMapping("/selectRoleLists") |
| | | public Result selectRoleLists(@RequestBody Map<String, Object> data) throws Exception { |
| | |
| | | Role role = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), Role.class); |
| | | return Result.success(roleService.selectUserList(page, role)); |
| | | } |
| | | |
| | | @ValueClassify("角色管理") |
| | | @ApiOperation(value = "删除角色列表") |
| | | @PostMapping("/delRole") |
| | | public Result delRole(Integer id){ |
| | | return Result.success(roleService.delRole(id)); |
| | | } |
| | | |
| | | @ValueAuth |
| | | @ApiOperation(value = "通过角色id查询权限列表") |
| | | @PostMapping("/selectPowerByRoleId") |
| | | public Result<?> selectPowerByRoleId(Integer id) { |
| | |
| | | public Result<?> selectMenuList() { |
| | | return Result.success(roleService.selectMenuList()); |
| | | } |
| | | |
| | | @ValueClassify("角色管理") |
| | | @ApiOperation(value = "添加角色") |
| | | @PostMapping("/addRole") |
| | | public Result<?> addRole(String str) { |
| | | RolePowerDto powers = JSON.parseObject(str, RolePowerDto.class); |
| | | return Result.success(roleService.addRole(powers)); |
| | | } |
| | | |
| | | @ValueClassify("角色管理") |
| | | @ApiOperation(value = "修改角色信息") |
| | | @PostMapping("/upRole") |
| | | public Result<?> upRole(String str) { |