sendm money event
This commit is contained in:
@@ -33,6 +33,15 @@ var controllers = {
|
||||
res.status(200).json({'status': 'OK', 'internal_return': 0, 'result_list': dist.result,'total_record': dist.total_record })
|
||||
});
|
||||
},
|
||||
eventSendMoney: function(req, res) {
|
||||
ebroker.eventSendMoney(req, res, function(err, dist) {
|
||||
if (err) {
|
||||
res.send(err);
|
||||
}
|
||||
// res.json(dist);
|
||||
res.status(200).json({'status': 'OK', 'internal_return': 0, 'result_list': dist.result,'total_record': dist.total_record })
|
||||
});
|
||||
},
|
||||
getUsersKidsWallets: function(req, res) {
|
||||
wallets.getuserkidswallet(req, res, function(err, dist) {
|
||||
if (err) {
|
||||
|
||||
@@ -18,4 +18,7 @@ module.exports = function(app) {
|
||||
app.route('/flutterOkHook')
|
||||
.post(controller.flutterOkHook);
|
||||
|
||||
app.route('/eventSendMoney')
|
||||
.post(controller.eventSendMoney);
|
||||
|
||||
};
|
||||
@@ -32,7 +32,31 @@ var ebroker = {
|
||||
}
|
||||
next(null, resultItem ); // pass control to the next handler
|
||||
},
|
||||
eventSendMoney: function (req, res, next) {
|
||||
|
||||
try {
|
||||
const { message } = req.body;
|
||||
console.log('THIS-> req.body -> ', req.body);
|
||||
const kafkaConfig = new KafkaConfig();
|
||||
const messages = [{ key: "send", value: JSON.stringify(message) }];
|
||||
kafkaConfig.produce("SENDMONEY_RECEIVED", messages).then(r =>{
|
||||
console.log('THIS->RET-> ',r);
|
||||
} );
|
||||
|
||||
res.status(200).json({
|
||||
status: "Ok!",
|
||||
message: "Message successfully send!",
|
||||
});
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
let resultItem ={
|
||||
"result": [],
|
||||
"total_record": 0
|
||||
}
|
||||
next(null, resultItem ); // pass control to the next handler
|
||||
},
|
||||
eventConsumer: function (req, res, next) {
|
||||
|
||||
//console.log("REQ---->",req.body.uid);
|
||||
|
||||
Reference in New Issue
Block a user