| | |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.constant.BladeConstant; |
| | | import org.springblade.core.tool.constant.RoleConstant; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.system.entity.Role; |
| | | import org.springblade.modules.system.entity.User; |
| | |
| | | @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; |
| | |
| | | @ApiOperation(value = "列表", notes = "传入role") |
| | | public R<List<RoleVO>> list(@ApiIgnore @RequestParam Map<String, Object> role, BladeUser bladeUser) { |
| | | QueryWrapper<Role> queryWrapper = Condition.getQueryWrapper(role, Role.class); |
| | | queryWrapper.orderByAsc("sort"); |
| | | List<Role> list = roleService.list((!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.lambda().eq(Role::getTenantId, bladeUser.getTenantId()) : queryWrapper); |
| | | return R.data(RoleWrapper.build().listNodeVO(list)); |
| | | } |