/** * Created by Tony on 2017/4/20. */ var express = require("express"); var apiRouter =express.Router(); //var _rootDir = __dirname; import ViewsController from "../controllers/repository_views_controller"; import RationRepositoryController from "../controllers/ration_repository_controller"; import RationChapterTreeController from "../controllers/ration_section_tree_controller"; import RationController from "../controllers/ration_controller"; import RepositoryGljController from "../controllers/repository_glj_controller"; import CoeListController from "../controllers/coe_controller"; import SearchController from "../controllers/search_controller"; import GljController from "../../std_glj_lib/controllers/gljController"; let viewsController = new ViewsController(); let rationRepositoryController = new RationRepositoryController(); let rationChapterTreeController = new RationChapterTreeController(); let rationController = new RationController(); let coeListController = new CoeListController(); let searchController = new SearchController(); let repositoryGljController = new RepositoryGljController(); let gljController = new GljController(); module.exports = function (app) { app.get('/rationRepository/main', viewsController.auth, viewsController.init, viewsController.redirectMain); app.get('/rationRepository/ration',viewsController.auth, viewsController.init, viewsController.redirectRation); app.get('/rationRepository/lmm', viewsController.auth, viewsController.init, viewsController.redirectGlj); app.get('/rationRepository/coeList', viewsController.auth, viewsController.init, viewsController.redirectCoeList); apiRouter.post("/getCompilationList", rationRepositoryController.auth, rationRepositoryController.init, rationRepositoryController.getCompilationList); apiRouter.post("/getRationLib",rationRepositoryController.auth, rationRepositoryController.init, rationRepositoryController.getRationLib); apiRouter.post("/getRationDisplayNames",rationRepositoryController.auth, rationRepositoryController.init, rationRepositoryController.getDisPlayRationLibs); apiRouter.post("/editRationLibs",rationRepositoryController.auth, rationRepositoryController.init, rationRepositoryController.updateRationRepositoryName); apiRouter.post("/addRationRepository",rationRepositoryController.auth, rationRepositoryController.init, rationRepositoryController.addRationRepository); apiRouter.post("/deleteRationLibs",rationRepositoryController.auth, rationRepositoryController.init, rationRepositoryController.deleteRationLib); apiRouter.post("/getRealLibName",rationRepositoryController.auth, rationRepositoryController.init, rationRepositoryController.getRealLibName); apiRouter.post("/getLibIDByName",rationRepositoryController.auth, rationRepositoryController.init, rationRepositoryController.getLibIDByName); apiRouter.post("/getRationTree",rationChapterTreeController.auth, rationChapterTreeController.init, rationChapterTreeController.getRationChapterTree); apiRouter.post("/createNewNode",rationChapterTreeController.auth, rationChapterTreeController.init, rationChapterTreeController.createNewNode); apiRouter.post("/updateNodes",rationChapterTreeController.auth, rationChapterTreeController.init, rationChapterTreeController.updateNodes); apiRouter.post("/deleteNodes",rationChapterTreeController.auth, rationChapterTreeController.init, rationChapterTreeController.deleteNodes); apiRouter.post("/updateExplanation",rationChapterTreeController.auth, rationChapterTreeController.init, rationChapterTreeController.updateExplanation); apiRouter.post("/updateRuleText",rationChapterTreeController.auth, rationChapterTreeController.init, rationChapterTreeController.updateRuleText); apiRouter.post("/updateSituation",rationChapterTreeController.auth, rationChapterTreeController.init, rationChapterTreeController.updateSituation); apiRouter.post("/updateAnnoSituation",rationChapterTreeController.auth, rationChapterTreeController.init, rationChapterTreeController.updateAnnoSituation); apiRouter.post("/getRationItems",rationController.auth, rationController.init, rationController.getRationItemsBySection); apiRouter.post("/mixUpdateRationItems",rationController.auth, rationController.init, rationController.mixUpdateRationItems); apiRouter.post("/updateRationBasePrc",rationController.auth, rationController.init, rationController.updateRationBasePrc); apiRouter.post("/getRationGljIds",rationController.auth, rationController.init, rationController.getRationGljIds); apiRouter.post("/getRationsCodes",rationController.auth, rationController.init, rationController.getRationsCodes); apiRouter.post("/updateJobContent",rationController.auth, rationController.init, rationController.updateJobContent); apiRouter.post("/updateAnnotation",rationController.auth, rationController.init, rationController.updateAnnotation); apiRouter.post("/createNewGljTypeNode",repositoryGljController.auth, gljController.init, gljController.createNewGljTypeNode); apiRouter.post("/updateGljNodes",repositoryGljController.auth, gljController.init, gljController.updateGljNodes); apiRouter.post("/deleteGljNodes",repositoryGljController.auth, gljController.init, gljController.deleteGljNodes); apiRouter.post("/getGljDistType",repositoryGljController.auth, gljController.init, gljController.getGljDistType); apiRouter.post("/getGljTree",repositoryGljController.auth, gljController.init, gljController.getGljTree); apiRouter.post("/getGljItems",repositoryGljController.auth, gljController.init, gljController.getGljItems); apiRouter.post("/mixUpdateGljItems",repositoryGljController.auth, gljController.init, gljController.mixUpdateGljItems); apiRouter.post("/getGljItemsByIds",repositoryGljController.auth, gljController.init, gljController.getGljItemsByIds); apiRouter.post("/getGljItemsByCodes",repositoryGljController.auth, gljController.init, gljController.getGljItemsByCodes); apiRouter.post("/getCoeList",coeListController.auth, coeListController.init, coeListController.getCoeList); apiRouter.post("/saveCoeList",coeListController.auth, coeListController.init, coeListController.saveCoeList); apiRouter.post("/getCoeItemsByIDs",coeListController.auth, coeListController.init, coeListController.getCoeItemsByIDs); apiRouter.post("/getCoeItemsByNos",coeListController.auth, coeListController.init, coeListController.getCoeItemsByNos); apiRouter.post('/getRationItem',searchController.auth, searchController.init, searchController.getRationItem); apiRouter.post('/findRation', searchController.auth, searchController.init, searchController.findRation); // 导入导出定额库相关 apiRouter.post('/upload', rationRepositoryController.auth, rationRepositoryController.init, rationRepositoryController.uploadSourceData); app.use("/rationRepository/api",apiRouter); }