update
This commit is contained in:
parent
b0fc098b62
commit
5ba48622d6
22
xumu.py
22
xumu.py
|
@ -152,20 +152,20 @@ async def register(request: Request):
|
||||||
if len(v) != 0:
|
if len(v) != 0:
|
||||||
return BaseResponse(code=302, msg="该设备已经注册过了")
|
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 = {
|
# 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 = []
|
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())
|
res.append(r.json())
|
||||||
# 插入设备状态表
|
# 插入设备状态表
|
||||||
send_json = {
|
send_json = {
|
||||||
|
|
Loading…
Reference in New Issue