刘涛 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

39 行
691 B
Python

from __future__ import annotations
from pydantic import BaseModel
from typing import Any
class RelatedLink(BaseModel):
text: str
url: str
class FaqQuestionSchema(BaseModel):
question_id: str
question: str
answer: str
related_links: list[RelatedLink] = []
class FaqQuestionResponse(FaqQuestionSchema):
id: int
category_id: int
sort_order: int = 0
class Config:
from_attributes = True
class FaqCategorySchema(BaseModel):
category_id: str
name: str
class FaqCategoryResponse(FaqCategorySchema):
id: int
sort_order: int = 0
questions: list[FaqQuestionResponse] = []
class Config:
from_attributes = True