17 lines
711 B
Python
17 lines
711 B
Python
from datetime import datetime
|
|
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
from pydantic.alias_generators import to_camel
|
|
|
|
|
|
class ScanExceptionModel(BaseModel):
|
|
"""首页扫码异常记录。"""
|
|
|
|
model_config = ConfigDict(alias_generator=to_camel, from_attributes=True, populate_by_name=True)
|
|
|
|
oper_id: int = Field(gt=0, description='异常日志ID')
|
|
source: str = Field(min_length=1, max_length=50, description='扫码来源')
|
|
error_message: str = Field(min_length=1, max_length=2000, description='异常消息')
|
|
operator_name: str = Field(min_length=1, max_length=50, description='操作人员')
|
|
occurred_at: datetime | None = Field(default=None, description='异常时间')
|