diff --git a/cryptoai/api/__pycache__/binance_api.cpython-313.pyc b/cryptoai/api/__pycache__/binance_api.cpython-313.pyc index a073857..aac98f7 100644 Binary files a/cryptoai/api/__pycache__/binance_api.cpython-313.pyc and b/cryptoai/api/__pycache__/binance_api.cpython-313.pyc differ diff --git a/cryptoai/api/binance_api.py b/cryptoai/api/binance_api.py index 76bdcf0..53bf486 100644 --- a/cryptoai/api/binance_api.py +++ b/cryptoai/api/binance_api.py @@ -84,7 +84,7 @@ class BinanceAPI: print(f"获取交易对大户持仓多空比时出错: {e}") return 0 - def get_historical_klines(self, symbol: str, interval: str, start_str: Optional[str] = None, end_str: Optional[str] = None, limit: int = 100) -> pd.DataFrame: + def get_historical_klines(self, symbol: str, interval: str, start_str: Optional[str] = None, end_str: Optional[str] = None, limit: int = 200) -> pd.DataFrame: """ 获取历史K线数据 diff --git a/cryptoai/routes/crypto.py b/cryptoai/routes/crypto.py index 96aade1..5235bbc 100644 --- a/cryptoai/routes/crypto.py +++ b/cryptoai/routes/crypto.py @@ -60,7 +60,7 @@ async def get_crypto_kline(symbol: str, timeframe: Optional[str] = None, limit: @router.get("/news") async def get_crypto_news(session: Session = Depends(get_db)): - url = 'https://api.blockbeats.cn/h5v1/newsflash/list?page=1&limit=0&ios=1&end_time=&detective=-2' + url = 'https://api.blockbeats.cn/h5v1/newsflash/list?page=1&limit=15&ios=1&end_time=&detective=-2' response = requests.get(url) data = response.json() @@ -73,9 +73,7 @@ async def get_crypto_news(session: Session = Depends(get_db)): result.append({ "title": item["title"], "content": item["content"], - "timestamp": timestamp, - "add_time": add_time, - "url" : item["url"] + "add_time": add_time }) return result \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 5351d8b..7455f4d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,7 +29,7 @@ services: cryptoai-api: build: . container_name: cryptoai-api - image: cryptoai-api:0.2.19 + image: cryptoai-api:0.2.20 restart: always ports: - "8000:8000"