changes reverted to normal

master^2
Varun 9 months ago
parent a442382263
commit 57a4995308

File diff suppressed because it is too large Load Diff

@ -821,13 +821,54 @@ module.exports = function (fastify, opts, next) {
handler: tanksController.deletemotordatarecordsbefore7days,
});
fastify.get("/api/getTankmotordata", {
// fastify.get("/api/getTankmotordata", {
// schema: {
// tags: ["Tank"],
// description: "This is for Get Tank Motor Data",
// summary: "This is for to Get Tank Motor Data",
// querystring: {
// customerId: {type: 'string'}
// },
// security: [
// {
// basicAuth: [],
// },
// ],
// },
// preHandler: fastify.auth([fastify.authenticate]),
// handler: tanksController.getTankmotordata,
// });
fastify.route({
method: "PUT",
url: "/api/getTankmotordata/:customerId",
schema: {
tags: ["Tank"],
description: "This is for Get Tank Motor Data",
summary: "This is for to Get Tank Motor Data",
querystring: {
customerId: {type: 'string'}
summary: "This is for Get Tank Motor Data",
params: {
required: ["customerId"],
type: "object",
properties: {
customerId: {
type: "string",
description: "customerId",
},
},
},
body: {
type: "object",
// required: ['phone'],
properties: {
startDate:{ type: "string" },
stopDate:{type:"string"},
block:{type:"string"},
},
},
security: [
{
@ -835,7 +876,7 @@ module.exports = function (fastify, opts, next) {
},
],
},
preHandler: fastify.auth([fastify.authenticate]),
//preHandler: fastify.auth([fastify.authenticate]),
handler: tanksController.getTankmotordata,
});
@ -843,6 +884,7 @@ module.exports = function (fastify, opts, next) {
fastify.post('/api/motor/write', {
schema: {
tags: ["Tank"],
@ -1070,6 +1112,7 @@ module.exports = function (fastify, opts, next) {
auto_min_percentage: { type: "string", default: null },
auto_max_percentage: { type: "string", default: null },
tankLocation: { type: "string", default: null },
auto_mode_type: { type: "string", default: "default" },
},
},
@ -1188,6 +1231,70 @@ module.exports = function (fastify, opts, next) {
});
fastify.route({
method: "PUT",
url: "/api/updatetankstatus/:customerId",
schema: {
tags: ["Tank"],
summary: "This is for updating tank status to active or inactive",
params: {
required: ["customerId"],
type: "object",
properties: {
customerId: {
type: "string",
description: "customerId",
},
},
},
body: {
type: "object",
// required: ['phone'],
properties: {
tankName:{ type: "string" },
tankLocation:{type:"string"},
status:{type:"string"},
},
},
security: [
{
basicAuth: [],
},
],
},
//preHandler: fastify.auth([fastify.authenticate]),
handler: tanksController.updatetankstatus,
});
fastify.route({
method: "GET",
url: "/api/listofactiveandinactivetankstatus/:customerId",
schema: {
tags: ["Tank"],
summary: "Get list of active or inactive tanks",
params: {
required: ["customerId"],
type: "object",
properties: {
customerId: { type: "string", description: "Customer ID" },
},
},
querystring: {
type: "object",
properties: {
status: { type: "string"},
},
},
security: [{ basicAuth: [] }],
},
handler: tanksController.listofactiveandinactivetankstatus,
});
next();
}

Loading…
Cancel
Save