Files
border-red-post-nalati/backend/app/schemas/knowledge.py
T

19 lines
544 B
Python

from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field, HttpUrl
class KnowledgeCreate(BaseModel):
title: str = Field(min_length=1, max_length=250)
category: str = Field(default="未分类", max_length=80)
content: str = Field(min_length=1)
source_url: HttpUrl | None = None
class KnowledgeRead(BaseModel):
model_config = ConfigDict(from_attributes=True)
id: int
title: str
category: str
content: str
source_url: str | None
verification_status: str
created_at: datetime