项目基础模块代码
This commit is contained in:
15
app/model/schemas/project_image_schemas.py
Normal file
15
app/model/schemas/project_image_schemas.py
Normal file
@ -0,0 +1,15 @@
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class ProjectImage(BaseModel):
|
||||
id: Optional[int] = Field(None, description="id")
|
||||
project_id: Optional[int] = Field(..., description="项目id")
|
||||
image_url: Optional[str] = Field(..., description="原图路径")
|
||||
thumb_image_url: Optional[str] = Field(..., description="缩略图路径")
|
||||
|
||||
|
||||
class ProjectImagePager(BaseModel):
|
||||
project_id: Optional[int] = Field(..., description="项目id")
|
||||
pagerNum: Optional[int] = Field(1, description="当前页码")
|
||||
pagerSize: Optional[int] = Field(10, description="每页数量")
|
32
app/model/schemas/project_info_schemas.py
Normal file
32
app/model/schemas/project_info_schemas.py
Normal file
@ -0,0 +1,32 @@
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class ProjectInfoIn(BaseModel):
|
||||
"""项目信息输入"""
|
||||
id: Optional[int] = Field(None, description="项目id")
|
||||
project_name: Optional[str] = Field(..., description="项目名称")
|
||||
type_code: Optional[str] = Field(..., description="项目类型编码")
|
||||
description: Optional[str] = Field(None, description="项目描述")
|
||||
|
||||
|
||||
class ProjectInfoOut(BaseModel):
|
||||
"""项目信息输出"""
|
||||
id: Optional[int] = Field(None, description="项目id")
|
||||
project_no: Optional[str] = Field(..., description="项目编号")
|
||||
project_name: Optional[str] = Field(..., description="项目名称")
|
||||
type_code: Optional[str] = Field(..., description="项目类型编码")
|
||||
description: Optional[str] = Field(None, description="项目描述")
|
||||
user_name: Optional[str] = Field(None, description="创建人")
|
||||
train_version: Optional[int] = Field(None, description="训练版本号")
|
||||
project_status: Optional[str] = Field(None, description="项目状态")
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
|
||||
|
||||
class ProjectInfoPager(BaseModel):
|
||||
project_name: Optional[str] = Field(None, description="项目名称")
|
||||
pagerNum: Optional[int] = Field(1, description="当前页码")
|
||||
pagerSize: Optional[int] = Field(10, description="每页数量")
|
||||
|
12
app/model/schemas/project_label_schemas.py
Normal file
12
app/model/schemas/project_label_schemas.py
Normal file
@ -0,0 +1,12 @@
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class ProjectLabel(BaseModel):
|
||||
"""项目标签输入输出"""
|
||||
id: Optional[int] = Field(None, description="id")
|
||||
project_id: Optional[int] = Field(..., description="项目id")
|
||||
label_name: Optional[str] = Field(..., description="标签名称")
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
26
app/model/schemas/project_type_schemas.py
Normal file
26
app/model/schemas/project_type_schemas.py
Normal file
@ -0,0 +1,26 @@
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class ProjectTypeIn(BaseModel):
|
||||
"""
|
||||
项目类型输入
|
||||
"""
|
||||
type_code: Optional[str] = Field(..., description="类型code", max_length=20)
|
||||
type_name: Optional[str] = Field(..., description="类型名称", max_length=20, min_length=4)
|
||||
icon_path: Optional[str] = Field(None, description="iconPath", max_length=255)
|
||||
description: Optional[str] = Field(None, description="类型描述", max_length=255)
|
||||
|
||||
|
||||
class ProjectTypeOut(BaseModel):
|
||||
"""
|
||||
项目类型输出
|
||||
"""
|
||||
id: Optional[int] = Field(..., description="id")
|
||||
type_code: Optional[str] = Field(..., description="类型code", max_length=20)
|
||||
type_name: Optional[str] = Field(..., description="类型名称", max_length=20, min_length=4)
|
||||
icon_path: Optional[str] = Field(None, description="iconPath", max_length=255)
|
||||
description: Optional[str] = Field(None, description="类型描述", max_length=255)
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
@ -3,10 +3,9 @@ from typing import Optional
|
||||
|
||||
|
||||
# 用户相关的原型
|
||||
class SysUserIN(BaseModel):
|
||||
class SysUserIn(BaseModel):
|
||||
username: Optional[str] = Field(..., description="用户名", max_length=50)
|
||||
password: Optional[str] = Field(..., description="密码", max_length=30, min_length=6)
|
||||
dept_id: Optional[str] = Field(None, description="部门id")
|
||||
login_name: Optional[str] = Field(None, description="昵称", max_length=20)
|
||||
|
||||
|
||||
@ -18,9 +17,8 @@ class SysUserLogin(BaseModel):
|
||||
class SysUserOut(BaseModel):
|
||||
id: Optional[int] = Field(..., description="id")
|
||||
username: Optional[str] = Field(..., description="用户名")
|
||||
dept_id: Optional[str] = Field(None, description="部门id")
|
||||
dept_name: Optional[str] = Field(None, description="部门名称")
|
||||
login_name: Optional[str] = Field(None, description="昵称")
|
||||
user_status: Optional[str] = Field(None, description="用户状态")
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
@ -34,7 +32,6 @@ class SysUserUpdatePw(BaseModel):
|
||||
|
||||
class SysUserPager(BaseModel):
|
||||
username: Optional[str] = Field(None, description="用户名")
|
||||
dept_id: Optional[str] = Field(None, description="部门id")
|
||||
login_name: Optional[str] = Field(None, description="昵称")
|
||||
pagerNum: Optional[int] = Field(1, description="当前页码")
|
||||
pagerSize: Optional[int] = Field(10, description="每页数量")
|
||||
|
Reference in New Issue
Block a user