刘涛 8c0a5f489d Initial commit: hulai admin API backend
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 22:01:23 +08:00

27 行
539 B
Python

from __future__ import annotations
from pydantic import BaseModel
class NewsSchema(BaseModel):
title: str
cover_image: str | None = None
summary: str | None = None
content: str | None = None
source: str | None = None
source_url: str | None = None
published_at: str | None = None
is_visible: bool = True
class NewsResponse(NewsSchema):
id: int
sort_order: int = 0
class Config:
from_attributes = True
class NewsListResponse(BaseModel):
items: list[NewsResponse]
total: int