mirror of
https://github.com/xiaozhou233/RiverWaterQualityMonitoring.git
synced 2026-12-05 13:05:53 +08:00
25 lines
572 B
Python
25 lines
572 B
Python
from fastapi import APIRouter
|
|
import config
|
|
from utils import *
|
|
|
|
router = APIRouter()
|
|
|
|
@router.get("/data/upload")
|
|
def data_upload_get(token:str, ph:float, tds:float, turbidity:float):
|
|
# 验证token
|
|
if token != config.TOKEN:
|
|
return {
|
|
"code" : 403,
|
|
"status" : "error",
|
|
"message" : "token error",
|
|
"time" : timenow()
|
|
}
|
|
|
|
# TODO: Insert data into database
|
|
|
|
return {
|
|
"code" : 200,
|
|
"status" : "success",
|
|
"message" : "data upload success",
|
|
"time" : timenow()
|
|
} |