feat: 添加按部门ID查询用户列表接口

This commit is contained in:
Hvemi_han
2024-12-20 16:48:32 +08:00
parent 2ac66ed9eb
commit 58c41317ce
4 changed files with 73 additions and 0 deletions

View File

@ -221,6 +221,54 @@
}
```
### 7. 查询部门用户列表
- **接口**`GET /api/users/department/{departmentId}`
- **描述**:获取指定部门下的所有正常状态用户列表
- **认证**:需要
- **路径参数**
- `departmentId`: 部门 ID
- **成功响应**
```json
{
"code": 10000,
"message": "成功",
"data": [
{
"id": 2,
"username": "普通管理员账号2",
"email": "user2@qq.com",
"password": null,
"departmentId": 1,
"roles": 2,
"jobs": 2,
"avatar": null,
"creatorId": 1,
"status": 1,
"createdAt": 1734504506,
"updatedAt": 1734504506,
"enabled": true,
"authorities": [
{
"authority": "ROLE_USER"
}
],
"accountNonExpired": true,
"accountNonLocked": true,
"credentialsNonExpired": true
}
]
}
```
- **错误响应**
```json
{
"code": 50000,
"message": "获取部门用户列表失败",
"data": null
}
```
## 课程任务接口
### 1. 获取课程任务列表