update
This commit is contained in:
parent
8eaad30295
commit
4c035d7b05
10
xumu.py
10
xumu.py
|
@ -37,10 +37,9 @@ class RFIDQuery(BaseModel):
|
|||
|
||||
|
||||
# 数据查询接口
|
||||
@app.post("/api/xumu/data/query")
|
||||
async def data_query(params: DataQuery):
|
||||
@app.get("/api/xumu/data/query")
|
||||
async def data_query(deviceId):
|
||||
try:
|
||||
deviceId = params.deviceId
|
||||
if deviceId is None or deviceId == "" or len(deviceId) != 4:
|
||||
return BaseResponse(code=500, msg="参数错误")
|
||||
sql = f"select last * from root.farm.{deviceId}"
|
||||
|
@ -62,10 +61,9 @@ async def rest_query(request: Request):
|
|||
|
||||
|
||||
# RFID查询接口
|
||||
@app.post("/api/xumu/rfid/query")
|
||||
async def rfid_query(rfid_entity: RFIDQuery):
|
||||
@app.get("/api/xumu/rfid/query")
|
||||
async def rfid_query(rfid):
|
||||
try:
|
||||
rfid = rfid_entity.rfid
|
||||
sql = f"select deviceId from root.rfid where rfid='{rfid}'"
|
||||
send_json = {
|
||||
"sql": sql
|
||||
|
|
Loading…
Reference in New Issue