refactor(user): 重构用户相关接口与实现

- 修改application.yaml中logic-not-delete-value为"null"
- 删除RoleController中无用的RoleResponse导入
- 修改RoleController的@GetMapping注解路径为/options
- UserController使用构造器注入替代@Autowired并添加@RequiredArgsConstructor
- UserController的@RequestMapping从/api/user改为/api/users
- UserController的获取用户列表接口路径从/all改为/并增加分页参数说明
- UserController新增根据ID获取用户信息接口GET /{id}
- UserController的重置用户密码接口路径从/setUserPassword改为/{userId}/password
- 删除UserController中已废弃的更新用户名接口/updateUsername
- UserController的获取当前用户信息接口路径从/profile改为/me
- UserController的更新用户信息接口路径从/profile改为/me
- UserController新增更新用户名接口PUT /me/username并标记为@Deprecated
- UserController的设置用户昵称接口路径改为/{userId}/nickname
- UserProfileService接口中的findUserWithRoles方法重命名为findUserWithRolesByUsername
- UserProfileService接口新增findUserWithRolesById方法定义
- UserProfileServiceImpl实现类中删除无用RoleResponse导入
- UserProfileServiceImpl中findUserWithRoles方法重命名为findUserWithRolesByUsername
- UserProfileServiceImpl中实现findUserWithRolesById方法逻辑并增加空值校验
This commit is contained in:
Chaos
2025-11-29 09:01:50 +08:00
parent b479304687
commit 6e2de46157
5 changed files with 77 additions and 50 deletions

View File

@@ -52,7 +52,7 @@ public interface UserProfileService {
* @param username 用户名
* @return 用户信息
*/
UserProfileResponse findUserWithRoles(String username);
UserProfileResponse findUserWithRolesByUsername(String username);
/**
* 设置用户昵称
@@ -90,4 +90,12 @@ public interface UserProfileService {
* @return 所有用户信息
*/
IPage<UserProfileResponse> getAllUsers(Integer pageNum, Integer pageSize);
/**
* 根据用户ID查询用户信息
*
* @param id 用户ID
* @return 用户信息
*/
UserProfileResponse findUserWithRolesById(Long id);
}