|
|
|
|
@ -27,15 +27,19 @@ package com.nov.KgLowDurable.controller; |
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.nov.KgLowDurable.pojo.entity.Role; |
|
|
|
|
import com.nov.KgLowDurable.pojo.entity.User; |
|
|
|
|
import com.nov.KgLowDurable.pojo.vo.RoleVO; |
|
|
|
|
import com.nov.KgLowDurable.service.IRoleService; |
|
|
|
|
import com.nov.KgLowDurable.util.Condition; |
|
|
|
|
import com.nov.KgLowDurable.util.Result; |
|
|
|
|
import com.nov.KgLowDurable.wrapper.RoleWrapper; |
|
|
|
|
import io.swagger.annotations.*; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
@ -69,10 +73,10 @@ public class RoleController { |
|
|
|
|
@ApiImplicitParam(name = "roleAlias", value = "角色别名") |
|
|
|
|
}) |
|
|
|
|
@ApiOperation(value = "列表", notes = "传入role") |
|
|
|
|
public Result<List<Role>> list(@ApiParam(hidden = true) @RequestParam Map<String, Object> role) { |
|
|
|
|
public Result<List<RoleVO>> list(@ApiParam(hidden = true) @RequestParam Map<String, Object> role) { |
|
|
|
|
QueryWrapper<Role> queryWrapper = Condition.getQueryWrapper(role, Role.class); |
|
|
|
|
List<Role> list = roleService.list(queryWrapper); |
|
|
|
|
return Result.OK(list); |
|
|
|
|
return Result.OK(RoleWrapper.build().listNodeVO(list)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
@ -88,12 +92,12 @@ public class RoleController { |
|
|
|
|
/** |
|
|
|
|
* 获取指定角色树形结构 |
|
|
|
|
*/ |
|
|
|
|
// @GetMapping("/tree-by-id")
|
|
|
|
|
// @ApiOperation(value = "树形结构", notes = "树形结构")
|
|
|
|
|
// public Result<List<RoleVO>> treeById(Long roleId, Tuser bladeUser) {
|
|
|
|
|
// List<RoleVO> tree = roleService.tree(bladeUser.getUserId());
|
|
|
|
|
// return Result.OK(tree);
|
|
|
|
|
// }
|
|
|
|
|
@GetMapping("/tree-by-id") |
|
|
|
|
@ApiOperation(value = "树形结构", notes = "树形结构") |
|
|
|
|
public Result<List<RoleVO>> treeById(Long roleId, User bladeUser) { |
|
|
|
|
List<RoleVO> tree = roleService.tree(bladeUser.getUserId()); |
|
|
|
|
return Result.OK(tree); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 新增或修改 |
|
|
|
|
|