feat: 移除PDI和订单号字段,新增设备巡检模块
- 从物料跟踪页面移除订单号列和表单字段 - 从导航菜单移除PDI管理,添加设备巡检 - 新增InspectionLocation和InspectionRecord后端模型和API - 新增设备巡检前端页面(左侧点位列表,右侧设备和历史记录)
This commit is contained in:
30
backend/app/schemas/common.py
Normal file
30
backend/app/schemas/common.py
Normal file
@@ -0,0 +1,30 @@
|
||||
from pydantic import BaseModel
|
||||
from typing import Generic, TypeVar, Optional, List
|
||||
|
||||
T = TypeVar("T")
|
||||
|
||||
|
||||
class Response(BaseModel, Generic[T]):
|
||||
code: int = 200
|
||||
msg: str = "success"
|
||||
data: Optional[T] = None
|
||||
|
||||
@classmethod
|
||||
def ok(cls, data=None, msg="success"):
|
||||
return cls(code=200, msg=msg, data=data)
|
||||
|
||||
@classmethod
|
||||
def error(cls, msg="error", code=500):
|
||||
return cls(code=code, msg=msg, data=None)
|
||||
|
||||
|
||||
class PageParams(BaseModel):
|
||||
page: int = 1
|
||||
page_size: int = 20
|
||||
|
||||
|
||||
class PageResponse(BaseModel, Generic[T]):
|
||||
total: int
|
||||
page: int
|
||||
page_size: int
|
||||
items: List[T]
|
||||
Reference in New Issue
Block a user