feat: 开发采集、采集箱和商品编辑功能
This commit is contained in:
@@ -18,22 +18,50 @@ class Settings(BaseSettings):
|
||||
extra="ignore",
|
||||
)
|
||||
|
||||
# ── AI 密钥 ──
|
||||
deepseek_api_key: str = ""
|
||||
openai_api_key: str = ""
|
||||
dashscope_api_key: str = ""
|
||||
# 华北2(北京)业务空间时需填:https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1
|
||||
# 普通 API Key 调用留空即可。
|
||||
dashscope_base_http_api_url: str = ""
|
||||
|
||||
# ── 运行 ──
|
||||
host: str = "127.0.0.1"
|
||||
port: int = 8800
|
||||
cors_origins: str = ""
|
||||
|
||||
# ── V2:数据层 ──
|
||||
# 本地过渡用 SQLite;上线切 PostgreSQL:postgresql+asyncpg://user:pass@host:5432/ozon_seller
|
||||
database_url: str = "sqlite+aiosqlite:///./data/app.db"
|
||||
|
||||
# ── V2:鉴权 ──
|
||||
app_token: str = "" # MVP 单用户登录 token(换发 JWT 用)
|
||||
secret_key: str = "" # 店铺凭证 AES-GCM 加密密钥 + JWT 签名密钥
|
||||
jwt_expire_minutes: int = 60 * 24 * 7 # JWT 有效期(默认 7 天)
|
||||
|
||||
# ── V2:七牛(图片存储)──
|
||||
qiniu_access_key: str = ""
|
||||
qiniu_secret_key: str = ""
|
||||
qiniu_bucket: str = ""
|
||||
qiniu_domain: str = "" # 绑定域名,如 https://cdn.example.com
|
||||
# 为空时用本地文件系统兜底(开发期),不为空时走七牛
|
||||
storage_backend: str = "local" # local | qiniu
|
||||
|
||||
# ── V2:对外地址(插件/前端回写、生成图回调)──
|
||||
app_base_url: str = "http://127.0.0.1:8800"
|
||||
|
||||
@property
|
||||
def cors_origin_list(self) -> list[str]:
|
||||
if not self.cors_origins.strip():
|
||||
return []
|
||||
return [o.strip() for o in self.cors_origins.split(",") if o.strip()]
|
||||
|
||||
@property
|
||||
def use_qiniu(self) -> bool:
|
||||
return self.storage_backend == "qiniu" and bool(
|
||||
self.qiniu_access_key and self.qiniu_secret_key and self.qiniu_bucket
|
||||
)
|
||||
|
||||
|
||||
@lru_cache
|
||||
def get_settings() -> Settings:
|
||||
|
||||
Reference in New Issue
Block a user