routes.js 1.6 KB

12345678910111213141516171819202122232425262728293031
  1. 'use strict';
  2. /**
  3. *
  4. *
  5. * @author Zhong
  6. * @date 2018/5/29
  7. * @version
  8. */
  9. import express from 'express';
  10. import BillsGuideLibController from '../controllers/libController';
  11. import ViewsController from '../controllers/viewController';
  12. const router = express.Router();
  13. const billsGuideLibController = new BillsGuideLibController();
  14. const viewsController = new ViewsController();
  15. module.exports = function (app) {
  16. app.get('/billsGuidance/main', viewsController.auth, viewsController.init, viewsController.redirectMain);
  17. app.get('/billsGuidance/guidance', viewsController.auth, viewsController.init, viewsController.redirectGuidance);
  18. router.post('/getComBillsLibInfo', billsGuideLibController.auth, billsGuideLibController.init, billsGuideLibController.getComBillsLibInfo);
  19. router.post('/getBillsGuideLibs', billsGuideLibController.auth, billsGuideLibController.init, billsGuideLibController.getBillsGuideLibs);
  20. router.post('/updateBillsGuideLib', billsGuideLibController.auth, billsGuideLibController.init, billsGuideLibController.updateBillsGuideLib);
  21. router.post('/getLibWithBills', billsGuideLibController.auth, billsGuideLibController.init, billsGuideLibController.getLibWithBills);
  22. router.post('/getItemsByBills', billsGuideLibController.auth, billsGuideLibController.init, billsGuideLibController.getItemsByBills);
  23. router.post('/updateItems', billsGuideLibController.auth, billsGuideLibController.init, billsGuideLibController.updateItems);
  24. //test
  25. router.post('/testItems', billsGuideLibController.auth, billsGuideLibController.init, billsGuideLibController.testItems);
  26. app.use('/billsGuidance/api', router);
  27. };