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
34 lines
657 B
Python
34 lines
657 B
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
from datetime import datetime
|
|
|
|
from pydantic import ConfigDict, Field
|
|
|
|
from backend.common.enums import StatusType
|
|
from backend.common.schema import SchemaBase
|
|
|
|
|
|
class NoticeSchemaBase(SchemaBase):
|
|
title: str
|
|
type: int
|
|
author: str
|
|
source: str
|
|
status: StatusType = Field(StatusType.enable)
|
|
content: str
|
|
|
|
|
|
class CreateNoticeParam(NoticeSchemaBase):
|
|
pass
|
|
|
|
|
|
class UpdateNoticeParam(NoticeSchemaBase):
|
|
pass
|
|
|
|
|
|
class GetNoticeDetail(NoticeSchemaBase):
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
id: int
|
|
created_time: datetime
|
|
updated_time: datetime | None = None
|