feat(backend): 添加服务管理脚本并配置应用基础参数

- 更新 .gitignore 忽略后端日志目录和 PID 文件
- 新增 app_name 配置项并替换主程序中硬编码的应用名称
- 为配置模型添加 extra: ignore 以兼容额外环境变量
- 新增完整的后端服务管理脚本 serv.sh,支持常用管理操作
This commit is contained in:
2026-05-22 00:51:48 +08:00
parent ded7ea1228
commit 53128a6f02
4 changed files with 402 additions and 4 deletions

View File

@@ -2,6 +2,8 @@ from pydantic_settings import BaseSettings
class Settings(BaseSettings):
app_name: str = "孕育无忧"
# Path Prefix
api_prefix: str = "/api"
uploads_prefix: str = "/uploads"
@@ -37,7 +39,7 @@ class Settings(BaseSettings):
port: int = 8000
debug: bool = True
model_config = {"env_file": ".env", "env_file_encoding": "utf-8"}
model_config = {"env_file": ".env", "env_file_encoding": "utf-8", "extra": "ignore"}
settings = Settings()