Refactor config, logging, and startup structure

Introduced pkg modules for environment config, logging, and startup initialization. Replaced direct config and logging setup in main.py with modularized functions. Updated database and migration modules to use environment variables and improved DEBUG handling. Removed tool.py and migrated password utilities to pkg. Cleaned up legacy comments and unused code in models and routes.
This commit is contained in:
2025-10-03 15:00:45 +08:00
parent 815e709339
commit c1c36c606f
16 changed files with 214 additions and 185 deletions

View File

@@ -1,13 +1,9 @@
from pydantic import BaseModel
from passlib.context import CryptContext
# FastAPI 鉴权模型
# FastAPI authentication model
class Token(BaseModel):
access_token: str
token_type: str
class TokenData(BaseModel):
username: str | None = None
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
username: str | None = None