26 lines
617 B
Python
26 lines
617 B
Python
"""应用配置模块"""
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
"""应用配置"""
|
|
|
|
# 库存数据库配置(只读)
|
|
DATABASE_URL_INVENTORY: str = "postgresql://user:password@host:port/inventory_db"
|
|
|
|
# PMS 数据库配置(可读写)
|
|
DATABASE_URL_PMS: str = "postgresql://user:password@host:port/pms_db"
|
|
|
|
# 兼容旧的单数据库配置(如果设置则优先使用)
|
|
DATABASE_URL: str = ""
|
|
|
|
# CORS配置
|
|
CORS_ORIGINS: list[str] = ["*"]
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
case_sensitive = True
|
|
|
|
|
|
settings = Settings()
|