commit susee
This commit is contained in:
parent
e07df196a9
commit
da2fe645a7
@ -1,23 +1,6 @@
|
||||
const { sequelize,Test,OblicationMaster,OblicationBurearBankStatement} = require('../models')
|
||||
const { logMsg } = require('../services/logger.js');
|
||||
|
||||
exports.Welcome = (req, res) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
const Msg = "Welcome....!";
|
||||
console.log(Msg);
|
||||
logMsg.info("Api Call Success");
|
||||
res.send({'status':200 , message:"Success." ,'data': Msg});
|
||||
|
||||
} catch(err) {
|
||||
res.status(500).send({'status':404,
|
||||
message: err.message || "Some error occurred while inserting statements." ,'data': "No data"
|
||||
});
|
||||
} //end of try catch
|
||||
|
||||
};
|
||||
|
||||
|
||||
exports.ObligationMaster = async (req, res) =>
|
||||
{
|
||||
@ -42,6 +25,30 @@ exports.ObligationMaster = async (req, res) =>
|
||||
|
||||
};
|
||||
|
||||
|
||||
exports.GetOblicationBurearBankStatement = async (req, res) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
await OblicationBurearBankStatement.findAll({where : {los_id : req.query.los_id , is_active : 1} })
|
||||
.then(data =>
|
||||
{
|
||||
res.send({'status':200,'message':"success",'data':data});
|
||||
logMsg.info("Master Data List api call Success");
|
||||
})
|
||||
.catch(err => {
|
||||
res.send({'status':404,
|
||||
message: err.message || "Some error occurred while fetching Obligation bank statement." ,'data': "No data" });
|
||||
});
|
||||
|
||||
} catch(err) {
|
||||
res.send({'status':404,
|
||||
message: err.message || "Some error occurred while fetching Obligation masterdata bank statement." ,'data': "No data"
|
||||
});
|
||||
} //end of try catch
|
||||
|
||||
};
|
||||
|
||||
exports.CreateObligationMaster = async (req, res) =>
|
||||
{
|
||||
try
|
||||
|
||||
@ -6,25 +6,6 @@ module.exports = app => {
|
||||
var router = require("express").Router();
|
||||
|
||||
|
||||
|
||||
|
||||
//demo api
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /api/demo:
|
||||
* get:
|
||||
* summary: Demo Api
|
||||
* description: Welcome Message
|
||||
* responses:
|
||||
* 200:
|
||||
* description: success
|
||||
*/
|
||||
router.get("/demo", Mycontroller.Welcome);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// get obligation masterdata
|
||||
|
||||
@ -41,12 +22,32 @@ module.exports = app => {
|
||||
router.get("/obligationmaster",Mycontroller.ObligationMaster)
|
||||
|
||||
|
||||
|
||||
// get oblication burear bankstatement
|
||||
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /api/getoblicationburearbankstatement:
|
||||
* get:
|
||||
* summary: Get Oblication Burear Bank Statement List
|
||||
* description: Get Oblication Burear Bank Statement
|
||||
* parameters:
|
||||
* - in: query
|
||||
* name: los_id
|
||||
* schema:
|
||||
* type: string
|
||||
* required: true
|
||||
* description: Oblication Burear Bank Statement
|
||||
* example: 12abc
|
||||
* responses:
|
||||
* 200:
|
||||
* description: success
|
||||
*/
|
||||
router.get("/getoblicationburearbankstatement",Mycontroller.GetOblicationBurearBankStatement)
|
||||
|
||||
|
||||
// create oblication burear bankstatement
|
||||
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* definitions:
|
||||
@ -131,7 +132,7 @@ router.post("/createobligationmaster",Mycontroller.CreateObligationMaster)
|
||||
* avg_peak_util_of_the_OD_or_CC:
|
||||
* type: string
|
||||
* description: avgPeakUtilOfTheOD_or_CC
|
||||
* example: 5000
|
||||
* example: abc
|
||||
* nature_of_loan:
|
||||
* type: string
|
||||
* description: natureOfLoan
|
||||
@ -275,7 +276,7 @@ router.post("/createobligationmaster",Mycontroller.CreateObligationMaster)
|
||||
* avg_peak_util_of_the_OD_or_CC:
|
||||
* type: string
|
||||
* description: avgPeakUtilOfTheOD_or_CC
|
||||
* example:5000
|
||||
* example: abc
|
||||
* nature_of_loan:
|
||||
* type: string
|
||||
* description: natureOfLoan
|
||||
|
||||
@ -19,7 +19,7 @@ const options = {
|
||||
definition: {
|
||||
openapi: '3.0.0',
|
||||
info: {
|
||||
title: 'Smc_cet_financials',
|
||||
title: 'Smc_cet_obligation',
|
||||
version: '1.0.0',
|
||||
},
|
||||
},
|
||||
@ -56,7 +56,7 @@ require("./app/routes/routes.js")(app);
|
||||
|
||||
const PORT_NUMBER = process.env.SERVER_PORT
|
||||
app.listen({ port: PORT_NUMBER }, async () => {
|
||||
console.log('Server up on http://localhost:7080')
|
||||
console.log('Server up on http://localhost:'+ PORT_NUMBER)
|
||||
|
||||
//await sequelize.authenticate()
|
||||
})
|
||||
Loading…
Reference in New Issue
Block a user