raj 2 years ago
commit 3e8ba7f5dd

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

Loading…
Cancel
Save