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

@ -15,25 +15,20 @@ 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:
@ -43,7 +38,10 @@ 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:
@ -53,6 +51,7 @@ 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
@ -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) => {