123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- 'use strict';
- /**
- * @param {Egg.Application} app - egg application
- */
- module.exports = app => {
- // session验证中间件
- const sessionAuth = app.middlewares.sessionAuth();
- // 登入登出
- app.get('/login', 'loginController.index');
- app.get('/', 'loginController.index');
- app.get('/logout', 'loginController.logout');
- app.post('/login', 'loginController.login');
- // 指标库
- app.get('/lib', sessionAuth, 'libController.index');
- app.post('/lib/upload', sessionAuth, 'libController.upload');
- app.get('/lib/detail/:id', sessionAuth, 'libController.detail');
- app.post('/lib/detail/get-children', sessionAuth, 'libController.getChildren');
- app.get('/lib/global/:id', sessionAuth, 'libController.global');
- app.post('/lib/updateParamValue', sessionAuth, 'libController.updateParamValue');
- app.post('/lib/getParamAndIndex', sessionAuth, 'libController.getParamAndIndex');
- app.post('/lib/delete', sessionAuth, 'libController.delete');
- app.post('/lib/enter', sessionAuth, 'libController.enter');
- app.get('/lib/refresh', sessionAuth, 'libController.refresh');
- // 指标模板
- app.get('/template', sessionAuth, 'templateController.index');
- app.post('/template/uploadExcel', sessionAuth, 'templateController.uploadExcel');
- app.post('/template/updateNodeMatch', sessionAuth, 'templateController.updateNodeMatch');
- app.post('/template/setIndexRule', sessionAuth, 'templateController.setIndexRule');
- app.post('/template/updateParamMatch', sessionAuth, 'templateController.updateParamMatch');
- // 指标对比
- app.get('/compare', sessionAuth, 'compareController.index');
- app.post('/compare/search', sessionAuth, 'compareController.search');
- app.post('/compare/searchClass', sessionAuth, 'compareController.searchClass');
- // 单元指标对比
- app.get('/unitCompare', sessionAuth, 'unitCompareController.index');
- app.post('/unitCompare/parent', sessionAuth, 'unitCompareController.getParent');
- app.post('/unitCompare/search', sessionAuth, 'unitCompareController.search');
- };
|