[backend] feat: 添加项目基础配置

This commit is contained in:
xsl
2026-01-26 08:09:35 +08:00
parent e4b59c5ee4
commit 827549fa0d
7 changed files with 86 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
from pydantic_settings import BaseSettings
from functools import lru_cache
class Settings(BaseSettings):
APP_NAME: str = "海洋项目管理系统"
APP_VERSION: str = "1.0.0"
DEBUG: bool = True
DB_HOST: str = "localhost"
DB_PORT: int = 3306
DB_USER: str = "root"
DB_PASSWORD: str = "rootpassword"
DB_NAME: str = "project_manager"
DB_CHARSET: str = "utf8mb4"
SECRET_KEY: str = "your-secret-key-change-this-in-production"
ALGORITHM: str = "HS256"
ACCESS_TOKEN_EXPIRE_MINUTES: int = 1440
CORS_ORIGINS: list[str] = ["http://localhost:3000", "http://127.0.0.1:3000"]
class Config:
env_file = ".env"
case_sensitive = True
@lru_cache()
def get_settings():
return Settings()