refactor(role): refactor role management API and service

- Remove unused imports and simplify controller annotations
- Change request mapping path from /api/role to /api/roles
- Update assignRolesToUser endpoint to use POST /users
- Update revokeRolesFromUser endpoint to use DELETE /users
- Modify getAllRoles method to return OptionResponse instead of RoleResponse
- Simplify database query in RoleServiceImpl using lambda query wrapper
- Add proper authorization checks for all role management endpoints
- Remove redundant getUserRole method with duplicate logic
This commit is contained in:
Chaos
2025-11-28 17:01:02 +08:00
parent f0d6279949
commit 647d5733ac
4 changed files with 28 additions and 19 deletions

View File

@@ -1,5 +1,6 @@
package cn.nopj.chaos_api.service;
import cn.nopj.chaos_api.dto.response.OptionResponse;
import cn.nopj.chaos_api.dto.response.RoleResponse;
import java.util.List;
@@ -9,5 +10,5 @@ public interface RoleService {
* 获取所有角色
* @return 所有角色
*/
List<RoleResponse> getAllRoles();
List<OptionResponse> getAllRoles();
}