Bug 修复:
- T-019: 修复品牌API响应解析,正确解析 data[0].brand_name
- T-020: 添加品牌API Bearer Token认证
视频分析功能:
- T-021: SessionID池服务,从内部API获取Cookie列表
- T-022: SessionID自动重试,失效时自动切换重试
- T-023: 巨量云图API封装,支持超时和错误处理
- T-024: 视频分析数据接口 GET /api/v1/videos/{item_id}/analysis
- T-025: 数据库A3指标更新
- T-026: 视频分析前端页面,展示6大类25+指标
测试覆盖率:
- brand_api.py: 100%
- session_pool.py: 100%
- yuntu_api.py: 100%
- video_analysis.py: 99%
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
35 lines
955 B
Python
35 lines
955 B
Python
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
from typing import List
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
"""Application settings."""
|
|
|
|
model_config = SettingsConfigDict(
|
|
env_file=".env",
|
|
env_file_encoding="utf-8",
|
|
extra="ignore", # 忽略额外的环境变量
|
|
)
|
|
|
|
# Database
|
|
DATABASE_URL: str = "postgresql+asyncpg://user:password@localhost:5432/yuntu_kol"
|
|
|
|
# CORS
|
|
CORS_ORIGINS: List[str] = ["http://localhost:3000"]
|
|
|
|
# Brand API
|
|
BRAND_API_BASE_URL: str = "https://api.internal.intelligrow.cn"
|
|
BRAND_API_TOKEN: str = "" # Bearer Token for Brand API authentication
|
|
|
|
# Yuntu API (for SessionID pool)
|
|
YUNTU_API_TOKEN: str = "" # Bearer Token for Yuntu Cookie API
|
|
|
|
# API Settings
|
|
MAX_QUERY_LIMIT: int = 1000
|
|
BRAND_API_TIMEOUT: float = 3.0
|
|
BRAND_API_CONCURRENCY: int = 10
|
|
YUNTU_API_TIMEOUT: float = 10.0 # 巨量云图API超时
|
|
|
|
|
|
settings = Settings()
|