update
This commit is contained in:
parent
55d146bcdc
commit
109e972fa6
13
main.py
13
main.py
|
@ -116,9 +116,16 @@ async def process_data(request: Request):
|
||||||
data = await request.body()
|
data = await request.body()
|
||||||
data = data.decode("utf-8")
|
data = data.decode("utf-8")
|
||||||
data = json.loads(data)
|
data = json.loads(data)
|
||||||
print(data)
|
event = data["event"]
|
||||||
|
if event == "client.connected":
|
||||||
|
print("已连接")
|
||||||
|
print(data["connected_at"])
|
||||||
|
elif event == "client.disconnected":
|
||||||
|
print("已断开")
|
||||||
|
print(data["disconnected_at"])
|
||||||
|
elif event == "message.publish":
|
||||||
|
print("消息接收")
|
||||||
|
print(data["timestamp"])
|
||||||
return 200
|
return 200
|
||||||
# try:
|
# try:
|
||||||
# data = await request.body()
|
# data = await request.body()
|
||||||
|
|
Loading…
Reference in New Issue