linwe
2024-09-03 764d883b5ea3bdc06abbec548b6df0511e567978
src/main/java/org/springblade/modules/system/controller/RoleController.java
@@ -39,6 +39,7 @@
import org.springblade.modules.system.entity.User;
import org.springblade.modules.system.service.IRoleService;
import org.springblade.modules.system.vo.GrantVO;
import org.springblade.modules.system.vo.RoleParam;
import org.springblade.modules.system.vo.RoleVO;
import org.springblade.modules.system.wrapper.RoleWrapper;
import org.springframework.web.bind.annotation.*;
@@ -60,7 +61,7 @@
@AllArgsConstructor
@RequestMapping(AppConstant.APPLICATION_SYSTEM_NAME + "/role")
@Api(value = "角色", tags = "角色")
@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
//@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
public class RoleController extends BladeController {
   private final IRoleService roleService;
@@ -168,4 +169,28 @@
      return R.data(list);
   }
   /**
    * 获取角色列表
    */
   @GetMapping("/getRoleListByIds")
   @ApiOperation(value = "获取角色列表", notes = "传入id集合")
   public R<List<Role>> getRoleListByIds(String roleIds) {
      List<Role> list =  roleService.getRoleListByIds(roleIds);
      return R.data(list);
   }
   /**
    * 自定义列表(只获取当前角色下级角色)
    * @param roleParam
    * @return
    */
   @GetMapping("/getRoleList")
   public R<List<RoleVO>> getRoleList(RoleParam roleParam) {
      List<Role> list = roleService.getRoleList(roleParam);
      return R.data(RoleWrapper.build().listNodeVO(list));
   }
}