任务分发接口优化

This commit is contained in:
liujianjiang 2025-07-17 11:42:53 +08:00
parent 7c4811d52c
commit 920208b4bb
1 changed files with 3 additions and 14 deletions

15
app.py
View File

@ -34,7 +34,6 @@ app.logger.addHandler(handler)
app.logger.setLevel(logging.INFO)
# H5 项目接口
@app.route('/h5', methods=['GET'])
def get_h5_account_info():
sql_str = "select account_id,keep_rate,task_total,account_name,is_active, countries, link_url from account_h5_info"
@ -163,15 +162,6 @@ def get_browser_info():
return jsonify({'status': "error", "message": str(e)})
@app.route('/get_account', methods=['GET'])
def get_account_id():
sql_str = "select account_id from account_h5_info where is_active=1 ORDER BY RAND() LIMIT 1"
result = db.execute_query(sql_str, )
if result:
return jsonify({'accountId': result[0][0]})
return jsonify({'status': "error", "message": "<UNK>"})
@app.route('/upload_task_status', methods=['GET'])
def upload_task_status():
account_id = request.args.get('accountId')
@ -193,9 +183,8 @@ def upload_task_status():
@app.route('/h5_issue_task', methods=['GET'])
def issue_task():
account_id = request.args.get('accountId')
sql_str = "select account_id,keep_rate,task_total,account_name,is_active,countries,link_url from account_h5_info where account_id=%s and is_active=1"
result = db.execute_query(sql_str, (account_id,))
sql_str = "select account_id,keep_rate,task_total,account_name,is_active,countries,link_url from account_h5_info where is_active=1 ORDER BY RAND() LIMIT 1"
result = db.execute_query(sql_str, )
if result:
countries = result[0][-2]
link_url = result[0][-1]