This commit is contained in:
aaron 2025-06-15 09:46:24 +08:00
parent 6ca2dd87a2
commit efaa43722c
4 changed files with 4 additions and 6 deletions

View File

@ -84,7 +84,7 @@ class BinanceAPI:
print(f"获取交易对大户持仓多空比时出错: {e}") print(f"获取交易对大户持仓多空比时出错: {e}")
return 0 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线数据 获取历史K线数据

View File

@ -60,7 +60,7 @@ async def get_crypto_kline(symbol: str, timeframe: Optional[str] = None, limit:
@router.get("/news") @router.get("/news")
async def get_crypto_news(session: Session = Depends(get_db)): 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) response = requests.get(url)
data = response.json() data = response.json()
@ -73,9 +73,7 @@ async def get_crypto_news(session: Session = Depends(get_db)):
result.append({ result.append({
"title": item["title"], "title": item["title"],
"content": item["content"], "content": item["content"],
"timestamp": timestamp, "add_time": add_time
"add_time": add_time,
"url" : item["url"]
}) })
return result return result

View File

@ -29,7 +29,7 @@ services:
cryptoai-api: cryptoai-api:
build: . build: .
container_name: cryptoai-api container_name: cryptoai-api
image: cryptoai-api:0.2.19 image: cryptoai-api:0.2.20
restart: always restart: always
ports: ports:
- "8000:8000" - "8000:8000"