Features: - FastAPI backend with JWT authentication - MySQL database with SQLAlchemy ORM - KPI workflow: draft → pending → approved → evaluation → completed - Ollama LLM API integration for AI features - Gitea API integration for version control - Complete API endpoints for KPI, dashboard, notifications Tables: KPI_D_* prefix naming convention 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
38 lines
560 B
Python
38 lines
560 B
Python
"""
|
|
共用 Schemas
|
|
"""
|
|
from typing import Generic, TypeVar, Optional, List
|
|
from pydantic import BaseModel
|
|
|
|
T = TypeVar("T")
|
|
|
|
|
|
class ErrorDetail(BaseModel):
|
|
"""錯誤詳情"""
|
|
|
|
code: str
|
|
message: str
|
|
details: Optional[dict] = None
|
|
|
|
|
|
class ErrorResponse(BaseModel):
|
|
"""錯誤回應"""
|
|
|
|
error: ErrorDetail
|
|
|
|
|
|
class PaginatedResponse(BaseModel, Generic[T]):
|
|
"""分頁回應"""
|
|
|
|
items: List[T]
|
|
total: int
|
|
page: int
|
|
page_size: int
|
|
pages: int
|
|
|
|
|
|
class MessageResponse(BaseModel):
|
|
"""訊息回應"""
|
|
|
|
message: str
|