update
This commit is contained in:
parent
d6df3dd865
commit
27f8001874
@ -32,12 +32,13 @@ class CryptoAnalysisRequest(BaseModel):
|
||||
timeframe: Optional[str] = None
|
||||
|
||||
@router.get("/kline/{symbol}")
|
||||
async def get_crypto_kline(symbol: str, timeframe: Optional[str] = None, limit: Optional[int] = 200):
|
||||
|
||||
if symbol.endswith("USDT"):
|
||||
symbol = symbol
|
||||
else:
|
||||
symbol = symbol + "USDT"
|
||||
async def get_crypto_kline(symbol: str, timeframe: Optional[str] = None, limit: Optional[int] = 100):
|
||||
# 检查symbol是否存在
|
||||
tokens = get_db_manager().search_token(symbol)
|
||||
if not tokens or len(tokens) == 0:
|
||||
raise HTTPException(status_code=400, detail="您输入的币种在币安不存在,请检查后重新输入。")
|
||||
|
||||
symbol = tokens[0]["symbol"]
|
||||
|
||||
binance_api = get_binance_api()
|
||||
result = {}
|
||||
@ -54,11 +55,12 @@ async def get_crypto_kline(symbol: str, timeframe: Optional[str] = None, limit:
|
||||
@router.post("/analysis_v2")
|
||||
async def analysis_crypto_v2(request: CryptoAnalysisRequest,
|
||||
current_user: dict = Depends(get_current_user)):
|
||||
|
||||
if request.symbol.endswith("USDT"):
|
||||
symbol = request.symbol
|
||||
else:
|
||||
symbol = request.symbol + "USDT"
|
||||
# 检查symbol是否存在
|
||||
tokens = get_db_manager().search_token(request.symbol)
|
||||
if not tokens or len(tokens) == 0:
|
||||
raise HTTPException(status_code=400, detail="您输入的币种在币安不存在,请检查后重新输入。")
|
||||
|
||||
symbol = tokens[0]["symbol"]
|
||||
|
||||
url = 'https://mate.aimateplus.com/v1/workflows/run'
|
||||
token = 'app-BbaqIAMPi0ktgaV9IizMlc2N'
|
||||
|
||||
@ -1784,7 +1784,7 @@ class DBManager:
|
||||
session = self.Session()
|
||||
|
||||
# 使用 SQLAlchemy 的 ORM 查询
|
||||
tokens = session.query(Token).filter(Token.symbol.like(f"{key}%")).limit(limit).all()
|
||||
tokens = session.query(Token).filter(Token.symbol.like(f"{key}%") | Token.base_asset.like(f"{key}%")).limit(limit).all()
|
||||
|
||||
return [{
|
||||
'symbol': token.symbol,
|
||||
|
||||
@ -29,7 +29,7 @@ services:
|
||||
cryptoai-api:
|
||||
build: .
|
||||
container_name: cryptoai-api
|
||||
image: cryptoai-api:0.1.8
|
||||
image: cryptoai-api:0.1.9
|
||||
restart: always
|
||||
ports:
|
||||
- "8000:8000"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user