feat: 实现后端核心业务逻辑 (Auth鉴权、二维码服务、看板与产品端点)
This commit is contained in:
24
backend/app/schemas/order.py
Normal file
24
backend/app/schemas/order.py
Normal file
@ -0,0 +1,24 @@
|
||||
"""生产订单 Pydantic Schemas"""
|
||||
from __future__ import annotations
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class OrderCreate(BaseModel):
|
||||
"""创建订单"""
|
||||
order_no: str = Field(..., max_length=64, description="订单编号")
|
||||
customer_info: str | None = Field(None, max_length=500, description="客户信息")
|
||||
|
||||
model_config = {"from_attributes": True}
|
||||
|
||||
|
||||
class OrderResponse(BaseModel):
|
||||
"""订单响应"""
|
||||
id: uuid.UUID
|
||||
order_no: str
|
||||
customer_info: str | None
|
||||
status: str
|
||||
created_at: datetime
|
||||
|
||||
model_config = {"from_attributes": True}
|
||||
17
backend/app/schemas/task_log.py
Normal file
17
backend/app/schemas/task_log.py
Normal file
@ -0,0 +1,17 @@
|
||||
"""任务操作日志 Pydantic Schemas"""
|
||||
from __future__ import annotations
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class TaskLogResponse(BaseModel):
|
||||
"""任务日志响应"""
|
||||
id: uuid.UUID
|
||||
task_id: uuid.UUID
|
||||
operator_id: str | None
|
||||
action_type: str
|
||||
remark: str | None
|
||||
created_at: datetime
|
||||
|
||||
model_config = {"from_attributes": True}
|
||||
24
backend/app/schemas/user.py
Normal file
24
backend/app/schemas/user.py
Normal file
@ -0,0 +1,24 @@
|
||||
"""用户 Schemas — 对接 MOM sys_user 表"""
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class LoginRequest(BaseModel):
|
||||
username: str = Field(..., max_length=64)
|
||||
password: str = Field(..., max_length=128)
|
||||
|
||||
|
||||
class UserResponse(BaseModel):
|
||||
id: str
|
||||
username: str
|
||||
display_name: str
|
||||
role: str
|
||||
is_active: bool = True
|
||||
created_at: str | None = None
|
||||
|
||||
model_config = {"from_attributes": True}
|
||||
|
||||
|
||||
class LoginResponse(BaseModel):
|
||||
access_token: str
|
||||
token_type: str = "bearer"
|
||||
user: UserResponse
|
||||
Reference in New Issue
Block a user