|
|
|
const fastify = require("fastify");
|
|
|
|
const adminController = require('../controllers/admincontroller')
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = function (fastify, opts, next) {
|
|
|
|
fastify.route({
|
|
|
|
method: "POST",
|
|
|
|
url: "/api/adminSignup",
|
|
|
|
schema: {
|
|
|
|
tags: ["Admin"],
|
|
|
|
description: "This is for cretae New Admin Account",
|
|
|
|
summary: "This is for cretae New Admin Account",
|
|
|
|
body: {
|
|
|
|
type: "object",
|
|
|
|
properties: {
|
|
|
|
email: { type: "string" },
|
|
|
|
password: { type: "string" },
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
security: [
|
|
|
|
{
|
|
|
|
basicAuth: [],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
|
|
|
handler: adminController.adminSignUp,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
fastify.post("/api/adminLogin", {
|
|
|
|
schema: {
|
|
|
|
description: "This is for Login Admin",
|
|
|
|
tags: ["Admin"],
|
|
|
|
summary: "This is for Login Admin",
|
|
|
|
body: {
|
|
|
|
type: "object",
|
|
|
|
required: ["email", "password"],
|
|
|
|
properties: {
|
|
|
|
email: { type: "string" },
|
|
|
|
password: { type: "string" },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handler: adminController.adminLogin,
|
|
|
|
});
|
|
|
|
|
|
|
|
fastify.post("/api/integratingHardwareidToTank", {
|
|
|
|
schema: {
|
|
|
|
description: "This is for integrating hardwareId with tank",
|
|
|
|
tags: ["Admin"],
|
|
|
|
summary: "This is for integrating hardwareId with tank",
|
|
|
|
|
|
|
|
body: {
|
|
|
|
type: "object",
|
|
|
|
|
|
|
|
properties: {
|
|
|
|
hardwareId_company:{ type: "string" },
|
|
|
|
hardwareId_type:{ type: "string" },
|
|
|
|
customerId: { type: "string" },
|
|
|
|
tankName: { type: "string" },
|
|
|
|
tankLocation: { type: "string" },
|
|
|
|
hardwareId: { type: "string" },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handler: adminController.integratingHardwareidToTank,
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
next();
|
|
|
|
};
|