raj 2 years ago
commit 3e8ba7f5dd

@ -328,42 +328,43 @@ module.exports = function (fastify, opts, next) {
fastify.route({
method: "POST",
url: "/api/APIWrite",
schema: {
tags: ["Tank"],
description: "This is for cretae IOT Device",
summary: "This is for Create IOT Device.",
body: {
type: "object",
properties: {
hardwareId: { type: "string" },
tankHeight: { type: "string"},
maxLevel: { type: "string" },
minLevel: { type: "string" },
tankhardwareId:{ type: "string" },
mode: { type: "string" },
fastify.route({
method: "POST",
url: "/api/APIWrite",
schema: {
tags: ["Tank"],
description: "This is for creating an IOT Device",
summary: "Create IOT Device",
body: {
type: "object",
properties: {
hardwareId: { type: "string" },
mode: { type: "string" },
tanks: {
type: "array",
items: {
type: "object",
properties: {
tankhardwareId: { type: "string" },
tankHeight: { type: "string" },
maxLevel: { type: "string" },
minLevel: { type: "string" }
},
required: ["tankhardwareId", "tankHeight", "maxLevel", "minLevel"]
}
}
},
required: ["hardwareId", "mode", "tanks"]
},
security: [
{
basicAuth: []
}
]
},
security: [
{
basicAuth: [],
},
],
},
// preHandler: [
// fastify.auth([fastify.operatorAuthenticate]),
// validationHandler.validatePhoneFormat,
// ],
handler: tanksController.IotDevice
});
handler: tanksController.IotDevice,
});
fastify.get("/api/APIRead", {
schema: {

Loading…
Cancel
Save