feat(user): 添加查询用户审核信息接口
- 新增 `GET /api/system/user/audit/{userId}` 接口
- 实现根据用户ID查询用户审核状态和拒绝原因
- 接口仅允许拥有 'sys:auth:user' 权限的用户访问
- 当用户不存在时,返回相应失败提示
- 返回数据包含 userId、auditStatus 和 rejectReason 信息
This commit is contained in:
6
.workbuddy/memory/2026-07-11.md
Normal file
6
.workbuddy/memory/2026-07-11.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# 2026-07-11 工作日志
|
||||||
|
|
||||||
|
## 补充用户审核查询接口
|
||||||
|
- **问题**:`GET /api/system/user/audit/{userId}` 返回404,接口不存在
|
||||||
|
- **原因**:只有 `PUT /api/system/user/audit`(执行审核操作),缺少查询用户审核信息的GET接口
|
||||||
|
- **修复**:在 `UserController.java` 中新增 `getAuditInfo` 方法,返回 userId、auditStatus、rejectReason
|
||||||
@@ -304,6 +304,21 @@ public class UserController extends BaseController {
|
|||||||
return fail("修改失败");
|
return fail("修改失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('sys:auth:user')")
|
||||||
|
@Operation(summary = "查询用户审核信息")
|
||||||
|
@GetMapping("/audit/{userId}")
|
||||||
|
public ApiResult<Map<String, Object>> getAuditInfo(@PathVariable("userId") Integer userId) {
|
||||||
|
User user = userService.getByIdRel(userId);
|
||||||
|
if (user == null) {
|
||||||
|
return fail("用户不存在",null);
|
||||||
|
}
|
||||||
|
Map<String, Object> result = new HashMap<>();
|
||||||
|
result.put("userId", user.getUserId());
|
||||||
|
result.put("auditStatus", user.getAuditStatus());
|
||||||
|
result.put("rejectReason", user.getRejectReason());
|
||||||
|
return success(result);
|
||||||
|
}
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('sys:user:update')")
|
@PreAuthorize("hasAuthority('sys:user:update')")
|
||||||
@OperationLog
|
@OperationLog
|
||||||
@Operation(summary = "审核用户注册(通过/拒绝)")
|
@Operation(summary = "审核用户注册(通过/拒绝)")
|
||||||
|
|||||||
Reference in New Issue
Block a user