main #24

Merged
ccyj merged 38 commits from sangge/tpre-python:main into main 2023-12-29 21:54:14 +08:00
Showing only changes of commit 8eee25500c - Show all commits

View File

@@ -36,6 +36,11 @@ def clean_env():
clear_database()
@app.get("/")
async def home():
return {"message": "Hello, World!"}
@app.get("/server/show_nodes")
async def show_nodes() -> list:
nodes_list = []
@@ -139,7 +144,7 @@ async def send_nodes_list(count: int) -> list:
# 查询数据库中的节点数据
cursor = db.execute("SELECT * FROM nodes LIMIT ?", (count,))
rows = cursor.fetchall()
for row in rows:
id, ip, last_heartbeat = row
nodes_list.append(ip)