intellif-aihub 0.1.5__py3-none-any.whl → 0.1.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of intellif-aihub might be problematic. Click here for more details.
- aihub/__init__.py +1 -1
- aihub/client.py +35 -12
- aihub/models/data_warehouse.py +95 -0
- aihub/models/dataset_management.py +99 -61
- aihub/models/document_center.py +26 -18
- aihub/models/eval.py +20 -11
- aihub/models/labelfree.py +12 -38
- aihub/models/model_center.py +141 -0
- aihub/models/model_training_platform.py +183 -149
- aihub/models/quota_schedule_management.py +201 -150
- aihub/models/tag_resource_management.py +30 -24
- aihub/models/task_center.py +39 -36
- aihub/models/user_system.py +159 -125
- aihub/models/workflow_center.py +461 -0
- aihub/services/artifact.py +22 -15
- aihub/services/data_warehouse.py +97 -0
- aihub/services/dataset_management.py +142 -23
- aihub/services/document_center.py +24 -5
- aihub/services/eval.py +14 -7
- aihub/services/labelfree.py +11 -0
- aihub/services/model_center.py +183 -0
- aihub/services/model_training_platform.py +99 -29
- aihub/services/quota_schedule_management.py +104 -7
- aihub/services/tag_resource_management.py +33 -2
- aihub/services/task_center.py +23 -9
- aihub/services/user_system.py +237 -2
- aihub/services/workflow_center.py +522 -0
- aihub/utils/download.py +19 -3
- {intellif_aihub-0.1.5.dist-info → intellif_aihub-0.1.6.dist-info}/METADATA +3 -3
- intellif_aihub-0.1.6.dist-info/RECORD +42 -0
- intellif_aihub-0.1.5.dist-info/RECORD +0 -36
- {intellif_aihub-0.1.5.dist-info → intellif_aihub-0.1.6.dist-info}/WHEEL +0 -0
- {intellif_aihub-0.1.5.dist-info → intellif_aihub-0.1.6.dist-info}/licenses/LICENSE +0 -0
- {intellif_aihub-0.1.5.dist-info → intellif_aihub-0.1.6.dist-info}/top_level.txt +0 -0
aihub/models/task_center.py
CHANGED
|
@@ -8,10 +8,7 @@ from pydantic import BaseModel, Field, field_serializer, field_validator
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class TaskCenterPriorityEnum(Enum):
|
|
11
|
-
"""
|
|
12
|
-
任务优先级枚举
|
|
13
|
-
"""
|
|
14
|
-
|
|
11
|
+
"""任务优先级枚举"""
|
|
15
12
|
low = "low"
|
|
16
13
|
medium = "medium"
|
|
17
14
|
high = "high"
|
|
@@ -22,7 +19,6 @@ class LabelProjectTypeEnum(Enum):
|
|
|
22
19
|
任务类型枚举
|
|
23
20
|
1 - 目标检测 2 - 语义分割 3 - 图片分类 4 - 实例分割 5 - 视频标注 6 - 人类偏好文本标注 7- 敏感预料文本标注 8 - 文本标注 9 - 关键点标注
|
|
24
21
|
"""
|
|
25
|
-
|
|
26
22
|
OBJECT_DETECTION = 1
|
|
27
23
|
SEGMENTATION = 2
|
|
28
24
|
IMAGE_CLASSIFICATION = 3
|
|
@@ -35,36 +31,43 @@ class LabelProjectTypeEnum(Enum):
|
|
|
35
31
|
|
|
36
32
|
|
|
37
33
|
class CreateTaskOtherInfo(BaseModel):
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
"""创建任务附加信息"""
|
|
35
|
+
label_project_type: LabelProjectTypeEnum = Field(LabelProjectTypeEnum.IMAGE_CLASSIFICATION, description="标注枚举")
|
|
36
|
+
dataset_id: int = Field(alias="dataset_id", description="数据集ID")
|
|
37
|
+
dataset_version_id: int = Field(alias="dataset_version_id", description="数据集版本ID")
|
|
38
|
+
doc_id: int = Field(alias="doc_id", description="文档中心文档ID")
|
|
39
|
+
doc_type: str = Field(alias="doc_type", default="doc_center", description="文档类型")
|
|
40
|
+
|
|
41
|
+
model_config = {"use_enum_values": True}
|
|
43
42
|
|
|
44
43
|
|
|
45
44
|
class ProjectInfo(BaseModel):
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
"""项目信息"""
|
|
46
|
+
label_project_id: int = Field(alias="label_project_id", description="项目ID")
|
|
47
|
+
label_project_name: str = Field(alias="label_project_name", description="项目名称")
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
class TaskDetailOtherInfo(BaseModel):
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
"""任务详情附加信息"""
|
|
52
|
+
label_project_type: LabelProjectTypeEnum = Field(LabelProjectTypeEnum.IMAGE_CLASSIFICATION, description="标注枚举")
|
|
53
|
+
dataset_id: int = Field(alias="dataset_id", description="数据集ID")
|
|
54
|
+
dataset_version_id: int = Field(alias="dataset_version_id", description="数据集版本ID")
|
|
55
|
+
doc_id: int = Field(alias="doc_id", description="文档中心文档ID")
|
|
56
|
+
doc_type: str = Field(alias="doc_type", default="doc_center", description="文档类型")
|
|
57
|
+
label_projects: Optional[List[ProjectInfo]] = Field(alias="label_projects", default=None,
|
|
58
|
+
description="关联标注项目列表")
|
|
57
59
|
|
|
58
60
|
|
|
59
61
|
class CreateTaskReq(BaseModel):
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
"""创建标注任务请求"""
|
|
63
|
+
name: str = Field(description="任务名称")
|
|
64
|
+
description: Optional[str] = Field(None, description="任务描述")
|
|
65
|
+
task_priority: Optional[str] = Field(None, alias="task_priority", description="优先级")
|
|
66
|
+
type: Optional[str] = Field(None, description="任务类型")
|
|
67
|
+
receiver_id: Optional[int] = Field(None, description="接收人ID")
|
|
68
|
+
project_id: Optional[int] = Field(None, description="项目ID")
|
|
69
|
+
other_info: CreateTaskOtherInfo = Field(alias="other_info", description="附加信息")
|
|
70
|
+
estimated_delivery_at: Optional[int] = Field(None, description="预计交付时间")
|
|
68
71
|
|
|
69
72
|
@field_serializer("other_info")
|
|
70
73
|
def serialize_other_info(self, value: CreateTaskOtherInfo) -> str:
|
|
@@ -73,20 +76,20 @@ class CreateTaskReq(BaseModel):
|
|
|
73
76
|
|
|
74
77
|
|
|
75
78
|
class CreateTaskResp(BaseModel):
|
|
76
|
-
|
|
79
|
+
"""创建标注任务返回"""
|
|
80
|
+
id: int = Field(alias="id", description="任务ID")
|
|
77
81
|
|
|
78
82
|
|
|
79
83
|
class LabelTaskDetail(BaseModel):
|
|
80
84
|
"""任务详情"""
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
estimated_delivery_at: Optional[int] = None
|
|
85
|
+
name: str = Field(description="任务名称")
|
|
86
|
+
description: Optional[str] = Field(alias="description", description="任务描述")
|
|
87
|
+
task_priority: Optional[str] = Field(alias="task_priority", description="优先级")
|
|
88
|
+
type: Optional[str] = Field(alias="type", description="任务类型")
|
|
89
|
+
receiver_id: Optional[int] = Field(alias="receiver_id", description="接收人ID")
|
|
90
|
+
project_id: Optional[int] = Field(None, description="项目ID")
|
|
91
|
+
other_info: TaskDetailOtherInfo = Field(alias="other_info", description="附加信息")
|
|
92
|
+
estimated_delivery_at: Optional[int] = Field(None, description="预计交付时间")
|
|
90
93
|
|
|
91
94
|
@field_serializer("other_info")
|
|
92
95
|
def serialize_other_info(self, value: TaskDetailOtherInfo) -> str:
|
aihub/models/user_system.py
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
# !/usr/bin/env python
|
|
2
|
-
# -*-coding:utf-8 -*-
|
|
3
1
|
from __future__ import annotations
|
|
4
2
|
|
|
5
3
|
from typing import List, Optional
|
|
@@ -12,31 +10,35 @@ from pydantic import BaseModel, Field
|
|
|
12
10
|
# ======================================================================
|
|
13
11
|
|
|
14
12
|
class Role(BaseModel):
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
"""角色"""
|
|
14
|
+
id: int = Field(description="角色ID")
|
|
15
|
+
name: str = Field(description="角色名称")
|
|
16
|
+
role_type: int = Field(alias="role_type", description="角色类型,1-管理员,2-普通")
|
|
17
|
+
menu_ids: Optional[List[int]] = Field(None, alias="menu_ids", description="菜单列表")
|
|
19
18
|
|
|
20
19
|
|
|
21
20
|
class Menu(BaseModel):
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
"""菜单"""
|
|
22
|
+
id: int = Field(description="菜单ID")
|
|
23
|
+
name: str = Field(description="菜单名称")
|
|
24
|
+
parent: int = Field(description="父级菜单ID")
|
|
25
|
+
auth: str = Field(description="权限")
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
class TreeMenu(BaseModel):
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
"""菜单(树形)"""
|
|
30
|
+
id: int = Field(description="菜单ID")
|
|
31
|
+
name: str = Field(description="菜单名称")
|
|
32
|
+
parent: int = Field(description="父级菜单ID")
|
|
33
|
+
auth: str = Field(description="权限")
|
|
34
|
+
children: Optional[List["TreeMenu"]] = Field(None, description="子菜单")
|
|
35
|
+
roles: Optional[List[Role]] = Field(None, description="绑定角色列表")
|
|
35
36
|
|
|
36
37
|
|
|
37
38
|
class TagBrief(BaseModel):
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
"""标签"""
|
|
40
|
+
id: int = Field(description="标签ID")
|
|
41
|
+
name: str = Field(description="标签名称")
|
|
40
42
|
|
|
41
43
|
|
|
42
44
|
# ======================================================================
|
|
@@ -44,78 +46,91 @@ class TagBrief(BaseModel):
|
|
|
44
46
|
# ======================================================================
|
|
45
47
|
|
|
46
48
|
class LoginRequest(BaseModel):
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
"""登录请求"""
|
|
50
|
+
username: str = Field(alias="username", description="用户名")
|
|
51
|
+
password: str = Field(alias="password", description="密码")
|
|
49
52
|
|
|
50
53
|
|
|
51
54
|
class LoginResponse(BaseModel):
|
|
52
|
-
|
|
53
|
-
|
|
55
|
+
"""登录返回"""
|
|
56
|
+
id: int = Field(alias="id", description="用户ID")
|
|
57
|
+
token: str = Field(alias="token", description="JWT Token")
|
|
54
58
|
|
|
55
59
|
|
|
56
60
|
class SignupRequest(BaseModel):
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
"""注册请求"""
|
|
62
|
+
username: str = Field(alias="username", description="用户名")
|
|
63
|
+
password: str = Field(alias="password", description="密码")
|
|
64
|
+
nickname: str = Field(alias="nickname", description="昵称")
|
|
65
|
+
email: str = Field(alias="email", description="邮箱")
|
|
66
|
+
role_ids: List[int] = Field(alias="role_ids", description="角色列表")
|
|
62
67
|
|
|
63
68
|
|
|
64
69
|
class SignupResponse(BaseModel):
|
|
65
|
-
|
|
70
|
+
"""注册返回"""
|
|
71
|
+
id: int = Field(alias="id", description="用户ID")
|
|
66
72
|
|
|
67
73
|
|
|
68
74
|
# ======================================================================
|
|
69
75
|
# ------------------------------- MENU ---------------------------------
|
|
70
76
|
# ======================================================================
|
|
71
77
|
class ListMenusRequest(BaseModel):
|
|
72
|
-
|
|
78
|
+
"""查询菜单列表请求"""
|
|
79
|
+
need_roles: Optional[bool] = Field(None, alias="need_roles", description="是否同时返回菜单绑定的角色信息")
|
|
73
80
|
|
|
74
81
|
|
|
75
82
|
class ListMenusResponse(BaseModel):
|
|
76
|
-
|
|
83
|
+
"""查询菜单列表返回"""
|
|
84
|
+
menus: List[TreeMenu] = Field(alias="menus", description="菜单树列表")
|
|
77
85
|
|
|
78
86
|
|
|
79
87
|
class CreateMenuRequest(BaseModel):
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
88
|
+
"""创建菜单请求"""
|
|
89
|
+
name: str = Field(alias="name", description="菜单名称")
|
|
90
|
+
parent: int = Field(alias="parent", description="父级菜单ID")
|
|
91
|
+
auth: str = Field(alias="auth", description="权限")
|
|
92
|
+
role_ids: Optional[List[int]] = Field(None, alias="role_ids", description="绑定的角色列表")
|
|
84
93
|
|
|
85
94
|
|
|
86
95
|
class CreateMenuResponse(BaseModel):
|
|
87
|
-
|
|
96
|
+
"""创建菜单返回"""
|
|
97
|
+
id: int = Field(alias="id", description="菜单ID")
|
|
88
98
|
|
|
89
99
|
|
|
90
100
|
class UpdateMenuRequest(BaseModel):
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
101
|
+
"""更新菜单请求"""
|
|
102
|
+
name: Optional[str] = Field(None, alias="name", description="菜单名称")
|
|
103
|
+
parent: Optional[int] = Field(None, alias="parent", description="父级菜单ID")
|
|
104
|
+
auth: str = Field(alias="auth", description="权限")
|
|
105
|
+
role_ids: Optional[List[int]] = Field(None, alias="role_ids", description="绑定的角色列表")
|
|
95
106
|
|
|
96
107
|
|
|
97
108
|
class GetMenuRolesResponse(BaseModel):
|
|
98
|
-
|
|
109
|
+
"""获取菜单角色返回"""
|
|
110
|
+
role_ids: List[int] = Field(alias="role_ids", description="菜单绑定的角色ID")
|
|
99
111
|
|
|
100
112
|
|
|
101
113
|
class SetMenuRolesRequest(BaseModel):
|
|
102
|
-
|
|
114
|
+
"""设置菜单角色请求"""
|
|
115
|
+
role_ids: List[int] = Field(alias="role_ids", description="绑定的角色列表")
|
|
103
116
|
|
|
104
117
|
|
|
105
118
|
class SearchMenusRequest(BaseModel):
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
119
|
+
"""搜索菜单请求"""
|
|
120
|
+
page_size: int = Field(20, alias="page_size", description="单页条数")
|
|
121
|
+
page_num: int = Field(1, alias="page_num", description="页码")
|
|
122
|
+
name: Optional[str] = Field(None, description="名称过滤")
|
|
123
|
+
parent_ids: Optional[List[int]] = Field(None, alias="parent_ids", description="父级ID过滤")
|
|
124
|
+
auth: Optional[str] = Field(None, description="权限过滤")
|
|
125
|
+
menu_ids: Optional[List[int]] = Field(None, alias="menu_ids", description="菜单过滤")
|
|
112
126
|
|
|
113
127
|
|
|
114
128
|
class SearchMenusResponse(BaseModel):
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
129
|
+
"""搜索菜单返回"""
|
|
130
|
+
total: int = Field(description="总数")
|
|
131
|
+
page_size: int = Field(alias="page_size", description="单页条数")
|
|
132
|
+
page_num: int = Field(alias="page_num", description="当前页")
|
|
133
|
+
data: List[Menu] = Field(description="菜单列表")
|
|
119
134
|
|
|
120
135
|
|
|
121
136
|
# ======================================================================
|
|
@@ -124,56 +139,65 @@ class SearchMenusResponse(BaseModel):
|
|
|
124
139
|
|
|
125
140
|
|
|
126
141
|
class CreateRoleRequest(BaseModel):
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
142
|
+
"""创建角色请求"""
|
|
143
|
+
id: Optional[int] = Field(None, description="自定义ID")
|
|
144
|
+
name: str = Field(description="角色名称")
|
|
145
|
+
role_type: int = Field(alias="role_type", description="角色类型")
|
|
146
|
+
menu_ids: Optional[List[int]] = Field(None, alias="menu_ids", description="绑定菜单")
|
|
131
147
|
|
|
132
148
|
|
|
133
149
|
class CreateRoleResponse(BaseModel):
|
|
134
|
-
|
|
150
|
+
"""创建角色返回"""
|
|
151
|
+
id: int = Field(description="角色ID")
|
|
135
152
|
|
|
136
153
|
|
|
137
154
|
class UpdateRoleRequest(BaseModel):
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
155
|
+
"""更新角色请求"""
|
|
156
|
+
name: Optional[str] = Field(None, description="角色名称")
|
|
157
|
+
role_type: Optional[int] = Field(None, alias="role_type", description="角色类型")
|
|
158
|
+
menu_ids: Optional[List[int]] = Field(None, alias="menu_ids", description="菜单列表")
|
|
141
159
|
|
|
142
160
|
|
|
143
161
|
class GetRoleMenusResponse(BaseModel):
|
|
144
|
-
|
|
162
|
+
"""获取角色菜单返回"""
|
|
163
|
+
menu_ids: List[int] = Field(alias="menu_ids", description="菜单ID")
|
|
145
164
|
|
|
146
165
|
|
|
147
166
|
class SetRoleMenusRequest(BaseModel):
|
|
148
|
-
|
|
167
|
+
"""设置角色菜单请求"""
|
|
168
|
+
menu_ids: List[int] = Field(alias="menu_ids", description="菜单ID")
|
|
149
169
|
|
|
150
170
|
|
|
151
171
|
class ListRolesRequest(BaseModel):
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
172
|
+
"""查询角色列表请求"""
|
|
173
|
+
page_size: int = Field(20, alias="page_size", description="单页条数")
|
|
174
|
+
page_num: int = Field(1, alias="page_num", description="页码")
|
|
175
|
+
role_type: Optional[int] = Field(None, alias="role_type", description="角色类型过滤")
|
|
155
176
|
|
|
156
177
|
|
|
157
178
|
class ListRolesResponse(BaseModel):
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
179
|
+
"""查询角色列表返回"""
|
|
180
|
+
total: int = Field(description="总数")
|
|
181
|
+
page_size: int = Field(alias="page_size", description="单页条数")
|
|
182
|
+
page_num: int = Field(alias="page_num", description="当前页")
|
|
183
|
+
data: List[Role] = Field(description="角色列表")
|
|
162
184
|
|
|
163
185
|
|
|
164
186
|
class SearchRolesRequest(BaseModel):
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
187
|
+
"""搜索角色请求"""
|
|
188
|
+
page_size: int = Field(20, alias="page_size", description="单页条数")
|
|
189
|
+
page_num: int = Field(1, alias="page_num", description="页码")
|
|
190
|
+
name: Optional[str] = Field(None, description="名字过滤")
|
|
191
|
+
role_ids: Optional[List[int]] = Field(None, alias="role_ids", description="角色ID过滤")
|
|
192
|
+
menu_ids: Optional[List[int]] = Field(None, alias="menu_ids", description="菜单ID过滤")
|
|
170
193
|
|
|
171
194
|
|
|
172
195
|
class SearchRolesResponse(BaseModel):
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
196
|
+
"""搜索角色返回"""
|
|
197
|
+
total: int = Field(description="总数")
|
|
198
|
+
page_size: int = Field(alias="page_size", description="单页条数")
|
|
199
|
+
page_num: int = Field(alias="page_num", description="当前页")
|
|
200
|
+
data: List[Role] = Field(description="角色列表")
|
|
177
201
|
|
|
178
202
|
|
|
179
203
|
# ======================================================================
|
|
@@ -181,81 +205,91 @@ class SearchRolesResponse(BaseModel):
|
|
|
181
205
|
# ======================================================================
|
|
182
206
|
|
|
183
207
|
class User(BaseModel):
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
208
|
+
"""用户信息"""
|
|
209
|
+
id: int = Field(description="用户ID")
|
|
210
|
+
username: str = Field(description="用户名")
|
|
211
|
+
nickname: str = Field(description="昵称")
|
|
212
|
+
email: str = Field(description="邮箱")
|
|
213
|
+
roles: Optional[List[Role]] = Field(None, alias="roles", description="角色列表")
|
|
214
|
+
status: int = Field(description="状态,1-可用,2-禁用")
|
|
215
|
+
tags: Optional[List[TagBrief]] = Field(None, alias="tags", description="标签")
|
|
216
|
+
created_at: int = Field(alias="created_at", description="创建时间戳(ms)")
|
|
192
217
|
|
|
193
218
|
|
|
194
219
|
class ListUsersRequest(BaseModel):
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
220
|
+
"""查询用户列表请求"""
|
|
221
|
+
page_size: int = Field(20, alias="page_size", description="单页条数")
|
|
222
|
+
page_num: int = Field(1, alias="page_num", description="页码")
|
|
223
|
+
search_key: Optional[str] = Field(None, alias="search_key", description="搜索关键字")
|
|
198
224
|
|
|
199
225
|
|
|
200
226
|
class ListUsersResponse(BaseModel):
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
227
|
+
"""查询用户列表返回"""
|
|
228
|
+
total: int = Field(description="总数")
|
|
229
|
+
page_size: int = Field(alias="page_size", description="单页条数")
|
|
230
|
+
page_num: int = Field(alias="page_num", description="当前页")
|
|
231
|
+
data: List[User] = Field(description="用户列表")
|
|
205
232
|
|
|
206
233
|
|
|
207
234
|
class CreateUserRequest(BaseModel):
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
235
|
+
"""创建用户请求"""
|
|
236
|
+
id: int = Field(description="用户id")
|
|
237
|
+
username: str = Field(description="用户名")
|
|
238
|
+
password: str = Field(description="密码")
|
|
239
|
+
nickname: str = Field(description="昵称")
|
|
240
|
+
email: str = Field(description="邮箱")
|
|
241
|
+
role_ids: Optional[List[int]] = Field(None, alias="role_ids", description="角色列表")
|
|
242
|
+
created_at: Optional[int] = Field(None, alias="created_at", description="创建时间戳")
|
|
243
|
+
updated_at: Optional[int] = Field(None, alias="updated_at", description="更新时间戳")
|
|
244
|
+
status: Optional[int] = Field(None, description="状态,1-可用,2-禁用")
|
|
245
|
+
tag_ids: Optional[List[int]] = Field(None, alias="tag_ids", description="标签列表")
|
|
218
246
|
|
|
219
247
|
|
|
220
248
|
class CreateUserResponse(BaseModel):
|
|
221
|
-
|
|
249
|
+
"""创建用户返回"""
|
|
250
|
+
id: int = Field(description="用户ID")
|
|
222
251
|
|
|
223
252
|
|
|
224
253
|
class UpdateUserRequest(BaseModel):
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
254
|
+
"""更新用户请求"""
|
|
255
|
+
username: Optional[str] = Field(None, description="用户名")
|
|
256
|
+
nickname: Optional[str] = Field(None, description="昵称")
|
|
257
|
+
email: Optional[str] = Field(None, description="邮箱")
|
|
258
|
+
password: Optional[str] = Field(None, description="密码")
|
|
259
|
+
role_ids: Optional[List[int]] = Field(default_factory=list, alias="role_ids", description="角色列表")
|
|
260
|
+
status: Optional[int] = Field(None, description="状态,1-可用,2-禁用")
|
|
261
|
+
tag_ids: Optional[List[int]] = Field(default_factory=list, alias="tag_ids", description="标签列表")
|
|
232
262
|
|
|
233
263
|
|
|
234
264
|
class SetUserRolesRequest(BaseModel):
|
|
235
|
-
|
|
265
|
+
"""设置用户角色请求"""
|
|
266
|
+
role_ids: List[int] = Field(alias="role_ids", description="角色列表")
|
|
236
267
|
|
|
237
268
|
|
|
238
269
|
class GetUserMenusResponse(BaseModel):
|
|
239
|
-
|
|
270
|
+
"""获取用户菜单返回"""
|
|
271
|
+
menus: List[TreeMenu] = Field(description="菜单树")
|
|
240
272
|
|
|
241
273
|
|
|
242
274
|
class SearchUsersRequest(BaseModel):
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
275
|
+
"""搜索用户请求"""
|
|
276
|
+
page_size: int = Field(20, alias="page_size", description="单页条数")
|
|
277
|
+
page_num: int = Field(1, alias="page_num", description="当前页")
|
|
278
|
+
username: Optional[str] = Field(None, description="用户名过滤")
|
|
279
|
+
nickname: Optional[str] = Field(None, description="昵称过滤")
|
|
280
|
+
email: Optional[str] = Field(None, description="邮箱过滤")
|
|
281
|
+
user_ids: Optional[List[int]] = Field(None, alias="user_ids", description="用户ID过滤")
|
|
282
|
+
role_ids: Optional[List[int]] = Field(None, alias="role_ids", description="角色ID过滤")
|
|
283
|
+
role_names: Optional[List[str]] = Field(None, alias="role_names", description="角色名过滤")
|
|
284
|
+
status: Optional[int] = Field(None, description="状态过滤")
|
|
252
285
|
|
|
253
286
|
|
|
254
287
|
class SearchUsersResponse(BaseModel):
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
288
|
+
"""搜索用户返回"""
|
|
289
|
+
total: int = Field(description="总数")
|
|
290
|
+
page_size: int = Field(alias="page_size", description="单页条数")
|
|
291
|
+
page_num: int = Field(alias="page_num", description="当前页")
|
|
292
|
+
data: List[User] = Field(description="用户列表")
|
|
259
293
|
|
|
260
294
|
|
|
261
295
|
# 此行放在文件末尾,否则序列化报错
|