This commit is contained in:
newtbot
2024-01-05 19:42:02 +08:00
parent b978f07867
commit a9912d4ddc
17 changed files with 628 additions and 353 deletions

View File

@ -20,11 +20,11 @@ router.post("/new", async (req, res, next) => {
description: "system generated location",
});
await sensorModel.create({
sensorname: `AQI-${Math.floor(Math.random()*898)+101}`,
name: `AQI-${Math.floor(Math.random()*898)+101}`,
added_by: "system",
mac_address: `${Math.floor(Math.random()*256).toString(16).padStart(2, '0')}-${Math.floor(Math.random()*256).toString(16).padStart(2, '0')}-${Math.floor(Math.random()*256).toString(16).padStart(2, '0')}-${Math.floor(Math.random()*256).toString(16).padStart(2, '0')}-${Math.floor(Math.random()*256).toString(16).padStart(2, '0')}-${Math.floor(Math.random()*256).toString(16).padStart(2, '0')}`,
description: "system generated sensor",
location: location.id
locationid: location.id
});
}