router.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. 'use strict';
  2. /**
  3. * @param {Egg.Application} app - egg application
  4. */
  5. module.exports = app => {
  6. // session验证中间件
  7. const sessionAuth = app.middlewares.sessionAuth();
  8. // 登入登出
  9. app.get('/login', 'loginController.index');
  10. app.get('/', 'loginController.index');
  11. app.get('/logout', 'loginController.logout');
  12. app.post('/login', 'loginController.login');
  13. // 指标库
  14. app.get('/lib', sessionAuth, 'libController.index');
  15. app.post('/lib/upload', sessionAuth, 'libController.upload');
  16. app.get('/lib/detail/:id', sessionAuth, 'libController.detail');
  17. app.post('/lib/detail/get-children', sessionAuth, 'libController.getChildren');
  18. app.get('/lib/global/:id', sessionAuth, 'libController.global');
  19. app.post('/lib/updateParamValue', sessionAuth, 'libController.updateParamValue');
  20. app.post('/lib/getParamAndIndex', sessionAuth, 'libController.getParamAndIndex');
  21. app.post('/lib/delete', sessionAuth, 'libController.delete');
  22. app.post('/lib/enter', sessionAuth, 'libController.enter');
  23. app.get('/lib/refresh', sessionAuth, 'libController.refresh');
  24. // 指标模板
  25. app.get('/template', sessionAuth, 'templateController.index');
  26. app.post('/template/uploadExcel', sessionAuth, 'templateController.uploadExcel');
  27. app.post('/template/updateNodeMatch', sessionAuth, 'templateController.updateNodeMatch');
  28. app.post('/template/setIndexRule', sessionAuth, 'templateController.setIndexRule');
  29. app.post('/template/updateParamMatch', sessionAuth, 'templateController.updateParamMatch');
  30. // 指标对比
  31. app.get('/compare', sessionAuth, 'compareController.index');
  32. app.post('/compare/search', sessionAuth, 'compareController.search');
  33. app.post('/compare/searchClass', sessionAuth, 'compareController.searchClass');
  34. // 单元指标对比
  35. app.get('/unitCompare', sessionAuth, 'unitCompareController.index');
  36. app.post('/unitCompare/parent', sessionAuth, 'unitCompareController.getParent');
  37. app.post('/unitCompare/search', sessionAuth, 'unitCompareController.search');
  38. };