feat(api): real klines/trades from indexer + auto table creation

- charts.py: serve OHLCV bars & trades from Postgres (klines/trades tables written by indexer), no synthetic data
- entities.py: add TradeModel/KlineModel matching indexer schema
- main.py: idempotent create_all on startup
- config.py: unify default DATABASE_URL with docker-compose/indexer
This commit is contained in:
Bot
2026-08-31 02:41:20 +08:00
parent 13686de581
commit fef69fa4ba
4 changed files with 142 additions and 2 deletions
+2 -2
View File
@@ -9,8 +9,8 @@ class Settings(BaseSettings):
# 环境:development, staging, production
ENVIRONMENT: str = "development"
# 数据库配置 (PostgreSQL)
DATABASE_URL: str = "postgresql+asyncpg://postgres:postgres@localhost:5432/wtfx"
# 数据库配置 (PostgreSQL) — 与 docker-compose / indexer 保持一致
DATABASE_URL: str = "postgresql+asyncpg://wtfx_user:wtfx_pass@localhost:5432/wtfx_db"
# Redis 配置
REDIS_URL: str = "redis://localhost:6379/0"