Initial commit: KPI Management System Backend
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>
This commit is contained in:
37
app/schemas/common.py
Normal file
37
app/schemas/common.py
Normal file
@@ -0,0 +1,37 @@
|
||||
"""
|
||||
共用 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
|
||||
Reference in New Issue
Block a user