mirror of
https://github.com/fastapi-practices/fastapi-best-architecture.git
synced 2026-09-21 21:15:13 +00:00
* Update return model of query interface * Update tree data return type hints * Update code generation and task return types * Fix inconsistency between ORM query result and schema
36 lines
799 B
Python
36 lines
799 B
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
from datetime import datetime
|
|
|
|
from pydantic import ConfigDict, Field
|
|
|
|
from backend.app.admin.schema.dict_type import GetDictTypeDetail
|
|
from backend.common.enums import StatusType
|
|
from backend.common.schema import SchemaBase
|
|
|
|
|
|
class DictDataSchemaBase(SchemaBase):
|
|
type_id: int
|
|
label: str
|
|
value: str
|
|
sort: int
|
|
status: StatusType = Field(default=StatusType.enable)
|
|
remark: str | None = None
|
|
|
|
|
|
class CreateDictDataParam(DictDataSchemaBase):
|
|
pass
|
|
|
|
|
|
class UpdateDictDataParam(DictDataSchemaBase):
|
|
pass
|
|
|
|
|
|
class GetDictDataDetail(DictDataSchemaBase):
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
id: int
|
|
type: GetDictTypeDetail | None = None
|
|
created_time: datetime
|
|
updated_time: datetime | None = None
|