Surya:swagger

This commit is contained in:
surya 2021-08-17 18:52:29 +05:30
commit 96b992c367
2 changed files with 30 additions and 42 deletions

View File

@ -60,6 +60,8 @@ exports.findAllEntities = (req, res) => {
}); });
}; };
// FinantialsSummary // FinantialsSummary
exports.FinantialsSummary = async (req, res) => { exports.FinantialsSummary = async (req, res) => {
const id = req.params.id const id = req.params.id
@ -92,19 +94,7 @@ exports.FinantialsSummary = async (req, res) => {
exports.test = (req, res) => {
sequelize.query("select * from statementsmaster")
.then(data => {
res.send({'status':200,'message':"success",'data':data});
logMsg.info("Success :"(data));
})
.catch(err => {
res.status(500).send({
message:
err.message || "Some error occurred while retrieving tutorials."
});
});
};

View File

@ -5,7 +5,7 @@ module.exports = app => {
var router = require("express").Router(); var router = require("express").Router();
/** /**
* @openapi * @openapi
* /api/EntitiesList: * /api/EntitiesList:
* get: * get:
@ -15,26 +15,21 @@ module.exports = app => {
* description: Returns a mysterious string. * description: Returns a mysterious string.
*/ */
// Retrieve all Tutorials // Retrieve all Tutorials
router.get("/EntitiesList", financials.findAllEntities); router.get("/EntitiesList", financials.findAllEntities);
/**
* @openapi
* /FinantialsSummary/:id:
* get:
* description: Welcome to swagger-jsdoc!
* responses:
* 200:
* description: Returns a mysterious string.
*/
// get statment master data // get statment master data
router.get("/FinantialsSummary/:id", financials.FinantialsSummary); router.get("/FinantialsSummary/:id", financials.FinantialsSummary);
// get statment master data // get statment master data
router.get("/MenuList/:losid", financials.MenuList); router.get("/MenuList/:losid", financials.MenuList);
//master.controller api's //master.controller api's
// get statment master data // get statment master data
/**
router.get("/StatmentsList", master.StatmentList);
/**
* @openapi * @openapi
* /api/StatementsList: * /api/StatementsList:
* get: * get:
@ -43,8 +38,11 @@ module.exports = app => {
* 200: * 200:
* description: Returns a mysterious string. * description: Returns a mysterious string.
*/ */
router.get("/StatementsList", master.StatementsList); router.get("/StatementsList", master.StatementsList);
/**
/**
* @openapi * @openapi
* /api/Insertstatement: * /api/Insertstatement:
* get: * get:
@ -53,8 +51,9 @@ module.exports = app => {
* 200: * 200:
* description: Returns a mysterious string. * description: Returns a mysterious string.
*/ */
router.post("/Insertstatement", master.Insertstatement); router.post("/Insertstatement", master.Insertstatement);
/** /**
* @openapi * @openapi
* /api/Updatestatement/:id: * /api/Updatestatement/:id:
* get: * get:
@ -64,7 +63,7 @@ module.exports = app => {
* description: Returns a mysterious string. * description: Returns a mysterious string.
*/ */
router.put("/Updatestatement/:id", master.Updatestatement); router.put("/Updatestatement/:id", master.Updatestatement);
/** /**
* @openapi * @openapi
* /api/Deletestatement/:id: * /api/Deletestatement/:id:
* get: * get:
@ -77,7 +76,7 @@ module.exports = app => {
/** /**
* @openapi * @openapi
* /api/SectionList: * /api/SectionList:
* get: * get:
@ -88,7 +87,7 @@ module.exports = app => {
*/ */
router.get("/SectionList", master.SectionList); router.get("/SectionList", master.SectionList);
/** /**
* @openapi * @openapi
* /api/Insertsection: * /api/Insertsection:
* get: * get:
@ -98,7 +97,7 @@ module.exports = app => {
* description: Returns a mysterious string. * description: Returns a mysterious string.
*/ */
router.post("/Insertsection", master.Insertsection); router.post("/Insertsection", master.Insertsection);
/** /**
* @openapi * @openapi
* /api/Updatesection/:id: * /api/Updatesection/:id:
* get: * get:
@ -108,7 +107,7 @@ module.exports = app => {
* description: Returns a mysterious string. * description: Returns a mysterious string.
*/ */
router.put("/Updatesection/:id", master.Updatesection); router.put("/Updatesection/:id", master.Updatesection);
/** /**
* @openapi * @openapi
* /api/Deletesection/:id: * /api/Deletesection/:id:
* get: * get:
@ -120,7 +119,7 @@ module.exports = app => {
router.put("/Deletesection/:id", master.Deletesection); router.put("/Deletesection/:id", master.Deletesection);
/** /**
* @openapi * @openapi
* /api/SubsectionList: * /api/SubsectionList:
* get: * get:
@ -130,7 +129,7 @@ module.exports = app => {
* description: Returns a mysterious string. * description: Returns a mysterious string.
*/ */
router.get("/SubsectionList", master.SubsectionList); router.get("/SubsectionList", master.SubsectionList);
/** /**
* @openapi * @openapi
* /api/Insertsubsection: * /api/Insertsubsection:
* get: * get:
@ -140,7 +139,7 @@ module.exports = app => {
* description: Returns a mysterious string. * description: Returns a mysterious string.
*/ */
router.post("/Insertsubsection", master.Insertsubsection); router.post("/Insertsubsection", master.Insertsubsection);
/** /**
* @openapi * @openapi
* /api/Updatesubsection/:id: * /api/Updatesubsection/:id:
* get: * get:
@ -150,7 +149,7 @@ module.exports = app => {
* description: Returns a mysterious string. * description: Returns a mysterious string.
*/ */
router.put("/Updatesubsection/:id", master.Updatesubsection); router.put("/Updatesubsection/:id", master.Updatesubsection);
/** /**
* @openapi * @openapi
* /api/Deletesubsection/:id: * /api/Deletesubsection/:id:
* get: * get:
@ -162,7 +161,7 @@ module.exports = app => {
router.put("/Deletesubsection/:id", master.Deletesubsection); router.put("/Deletesubsection/:id", master.Deletesubsection);
/** /**
* @openapi * @openapi
* /api/ItemList: * /api/ItemList:
* get: * get:
@ -172,7 +171,7 @@ module.exports = app => {
* description: Returns a mysterious string. * description: Returns a mysterious string.
*/ */
router.get("/ItemList", master.ItemList); router.get("/ItemList", master.ItemList);
/** /**
* @openapi * @openapi
* /api/Insertitem: * /api/Insertitem:
* get: * get:
@ -182,7 +181,7 @@ module.exports = app => {
* description: Returns a mysterious string. * description: Returns a mysterious string.
*/ */
router.post("/Insertitem", master.Insertitem); router.post("/Insertitem", master.Insertitem);
/** /**
* @openapi * @openapi
* /api/Updateitem/:id: * /api/Updateitem/:id:
* get: * get:
@ -192,7 +191,7 @@ module.exports = app => {
* description: Returns a mysterious string. * description: Returns a mysterious string.
*/ */
router.put("/Updateitem/:id", master.Updateitem); router.put("/Updateitem/:id", master.Updateitem);
/** /**
* @openapi * @openapi
* /api/Deleteitem/:id: * /api/Deleteitem/:id:
* get: * get:
@ -211,8 +210,7 @@ module.exports = app => {
// query execution test
router.get("/test", financials.test);
// third party api call example // third party api call example
router.get('/third_party_api', (req, res) => { router.get('/third_party_api', (req, res) => {