From 5ba48622d6bc60615cec23babce6e39193175f3d Mon Sep 17 00:00:00 2001 From: xyj <10908227994@qq.com> Date: Fri, 26 Jan 2024 17:43:13 +0800 Subject: [PATCH] update --- xumu.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/xumu.py b/xumu.py index 345ffc2..1d1ef65 100644 --- a/xumu.py +++ b/xumu.py @@ -152,20 +152,20 @@ async def register(request: Request): if len(v) != 0: return BaseResponse(code=302, msg="该设备已经注册过了") # 创建该设备 - send_json = { - "devices": ["root.device"], - "timestamps": [int(time.time() * 1000)], - "measurements_list": [["iccid", "deviceId", "type"]], - "data_types_list": [["TEXT", "TEXT", "INT32"]], - "values_list": [[iccid, deviceId, type]], - "is_aligned": False - } - # TODO 测试 # send_json = { - # "sql": f"insert into root.device(iccid, deviceId, type) values('{iccid}', '{deviceId}', {type})" + # "devices": ["root.device"], + # "timestamps": [int(time.time() * 1000)], + # "measurements_list": [["iccid", "deviceId", "type"]], + # "data_types_list": [["TEXT", "TEXT", "INT32"]], + # "values_list": [[iccid, deviceId, type]], + # "is_aligned": False # } + # TODO 测试 + send_json = { + "sql": f"insert into root.device(iccid, deviceId, type) values('{iccid}', '{deviceId}', {type})" + } res = [] - r = requests.post(baseHost + insertUri, headers=headers, json=send_json) + r = requests.post(baseHost + nonQueryUri, headers=headers, json=send_json) res.append(r.json()) # 插入设备状态表 send_json = {