20250904-初步功能已完成
This commit is contained in:
@@ -2,6 +2,7 @@ import json
|
||||
import os
|
||||
import socket
|
||||
import threading
|
||||
import time
|
||||
from pathlib import Path
|
||||
from queue import Queue
|
||||
from typing import Any, Dict
|
||||
@@ -87,6 +88,7 @@ def start_socket_listener():
|
||||
listener_thread = threading.Thread(target=start_socket_listener, daemon=True)
|
||||
listener_thread.start()
|
||||
|
||||
|
||||
# 获取设备列表
|
||||
@app.route('/deviceList', methods=['GET'])
|
||||
def deviceList():
|
||||
@@ -358,6 +360,7 @@ def queryAnchorList():
|
||||
data = []
|
||||
return ResultData(data=data).toJson()
|
||||
|
||||
|
||||
# 删除主播
|
||||
@app.route("/deleteAnchorWithIds", methods=['POST'])
|
||||
def deleteAnchorWithIds():
|
||||
@@ -366,6 +369,7 @@ def deleteAnchorWithIds():
|
||||
deleted = AiUtils.delete_anchors_by_ids(ids)
|
||||
return ResultData(data={"deleted": deleted}).toJson()
|
||||
|
||||
|
||||
@app.route("/aiConfig", methods=['POST'])
|
||||
def aiConfig():
|
||||
data = request.get_json()
|
||||
@@ -384,6 +388,7 @@ def aiConfig():
|
||||
JsonUtils.write_json("aiConfig", dict)
|
||||
return ResultData(data="").toJson()
|
||||
|
||||
|
||||
# 查询主播聊天发送的最后一条信息
|
||||
@app.route("/select_last_message", methods=['GET'])
|
||||
def select_last_message():
|
||||
@@ -427,5 +432,19 @@ def delete_last_message():
|
||||
return ResultData(data=updated_count, msg="修改失败").toJson()
|
||||
|
||||
|
||||
# @app.route("/killWda", methods=['POST'])
|
||||
# def killWda():
|
||||
# data = request.get_json() # 解析 JSON
|
||||
# udid = data.get("device")
|
||||
# print(udid)
|
||||
#
|
||||
#
|
||||
# AiUtils.kill_wda(udid)
|
||||
# time.sleep(10)
|
||||
# AiUtils.launch_wda(udid)
|
||||
#
|
||||
# return ResultData(data="", msg="WDA重新启动").toJson()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run("0.0.0.0", port=5000, debug=True, use_reloader=False)
|
||||
|
||||
Reference in New Issue
Block a user