Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
# src/api/models/__init__.py
|
||||
"""API数据模型"""
|
||||
|
||||
from .document import (
|
||||
@@ -19,4 +18,4 @@ __all__ = [
|
||||
"SearchResponse",
|
||||
"DocumentStatusResponse",
|
||||
"ErrorResponse"
|
||||
]
|
||||
]
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# src/api/models/document.py
|
||||
"""文档相关Pydantic数据模型"""
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
@@ -60,4 +59,4 @@ class ErrorResponse(BaseModel):
|
||||
"""错误响应"""
|
||||
error: str = Field(..., description="错误类型")
|
||||
message: str = Field(..., description="错误消息")
|
||||
timestamp: datetime = Field(default_factory=datetime.now, description="时间戳")
|
||||
timestamp: datetime = Field(default_factory=datetime.now, description="时间戳")
|
||||
|
||||
Reference in New Issue
Block a user