Files
Online-Topup-V1/application/routes/hsm.routes.js
T
2024-04-22 14:56:44 +07:00

83 lines
2.6 KiB
JavaScript

const { Router } = require('express');
const router = Router();
const auth = require('../middlewares/jwt.middleware');
// Topup
const _auth1 = require('../modules/hsm/topup/topup_1');
const _auth2 = require('../modules/hsm/topup/topup_2');
const _authResp = require('../modules/hsm/topup/topup_3');
const _readData = require('../modules/hsm/topup/topup_4');
const _readDataResp = require('../modules/hsm/topup/topup_5');
const _topup = require('../modules/hsm/topup/topup_6');
const _topupResp = require('../modules/hsm/topup/topup_7');
const _end = require('../modules/hsm/topup/topup_8');
const _getService = require('../modules/hsm/topup/service_block');
router.post('/topup1', auth.authenticateToken, _auth1);
router.post('/topup2', auth.authenticateToken, _auth2);
router.post('/topup3', auth.authenticateToken, _authResp);
router.post('/topup4', auth.authenticateToken, _readData);
router.post('/topup5', auth.authenticateToken, _readDataResp);
router.post(
'/topup6',
auth.authenticateToken,
_topup.validate('topup'),
_topup.controller
);
router.post(
'/topup7',
auth.authenticateToken,
_topupResp.validate('topupResponse'),
_topupResp.controller
);
router.post('/topup8', auth.authenticateToken, _end);
router.get('/getservice', auth.authenticateToken, _getService);
// Clear Card
const _authClear1 = require('../modules/hsm/clear_card/clear_1');
const _authClear2 = require('../modules/hsm/clear_card/clear_2');
const _authRespClear = require('../modules/hsm/clear_card/clear_3');
const _readDataClear = require('../modules/hsm/clear_card/clear_4');
const _readDataRespClear = require('../modules/hsm/clear_card/clear_5');
const _clear = require('../modules/hsm/clear_card/clear_6');
const _clearResp = require('../modules/hsm/clear_card/clear_7');
const _endClear = require('../modules/hsm/clear_card/clear_8');
const _getServiceClear = require('../modules/hsm/clear_card/service_block');
router.post('/clear1', auth.authenticateToken, _authClear1);
router.post('/clear2', auth.authenticateToken, _authClear2);
router.post('/clear3', auth.authenticateToken, _authRespClear);
router.post('/clear4', auth.authenticateToken, _readDataClear);
router.post('/clear5', auth.authenticateToken, _readDataRespClear);
router.post(
'/clear6',
auth.authenticateToken,
_clear.validate('clear'),
_clear.controller
);
router.post(
'/clear7',
auth.authenticateToken,
_clearResp.validate('clearResponse'),
_clearResp.controller
);
router.post('/clear8', auth.authenticateToken, _endClear);
router.get('/clear/getservice', auth.authenticateToken, _getServiceClear);
module.exports = router;