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