rfid_last_data_query

This commit is contained in:
xyj 2024-01-31 18:02:48 +08:00
parent 872d820a8f
commit 6006658de4
1 changed files with 2 additions and 1 deletions

View File

@ -86,6 +86,7 @@ async def rest_query(request: Request):
# RFID查询接口
@app.get("/api/xumu/rfid/query")
async def rfid_query(rfid):
# TODO 可能一个rfid有多个iccid设备上传需要获取所有的设备数据然后返回现在这个功能只有一个设备 不一定是最新的
try:
sql = f"select deviceId from root.rfid where rfid='{rfid}'"
send_json = {
@ -269,7 +270,7 @@ async def process_data(request: Request):
amatch1 = re.match(pattern, clientid)
# 如果两个都不满足,那就错误
if not amatch1:
return BaseResponse(code=200, msg="error")
return BaseResponse(code=500, msg="clientid error")
# 连接成功处理
if event == "client.connected":
return await client_change_status(clientid, True)