Skip to content

Commit

Permalink
change the api base route by user defined (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
lxy1992 authored Mar 3, 2024
1 parent 34a2c27 commit a2d8d86
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
db_config = config['database']
bot_config = config['telegram_bot']
TOKEN = bot_config['token']
API = config["fund_api"]

DATABASE_URL = db_config['url']
# SSL参数
Expand All @@ -31,7 +32,7 @@


class FundApi:
BASE_URL = 'https://api.doctorxiong.club/v1/fund' # 请替换为实际的API基础URL
BASE_URL = API["base_url"]

@staticmethod
def search_funds(keyword):
Expand Down Expand Up @@ -193,6 +194,8 @@ async def get_daily_report(user_id, need_diagram=False):
FundDetail.day_growth).where(FundDetail.code == fund_code)
)
fund_detail = fund_detail.first()
if not fund_detail:
continue
data = FundApi().get_real_time_fund([fund_code])

# 计算估计的涨跌金额
Expand Down
2 changes: 1 addition & 1 deletion config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ telegram_bot:
token: ""

fund_api:
base_url: "https://api.doctorxiong.club/v1/fund"
base_url: ""

0 comments on commit a2d8d86

Please sign in to comment.