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