compilation_route.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. /**
  2. * 版本管理路由
  3. *
  4. * @author CaiAoLin
  5. * @date 2017/7/28
  6. * @version
  7. */
  8. import Express from "express";
  9. import CompilationController from "../controllers/compilation_controller";
  10. const router = Express.Router();
  11. const compilationController = new CompilationController();
  12. module.exports = function (app) {
  13. // action定义区域
  14. router.get(
  15. "/",
  16. compilationController.auth,
  17. compilationController.init,
  18. compilationController.index
  19. );
  20. router.get(
  21. "/valuation/:section/:id",
  22. compilationController.auth,
  23. compilationController.init,
  24. compilationController.editValuation
  25. );
  26. router.get(
  27. "/:section/:id/:engineerID",
  28. compilationController.auth,
  29. compilationController.init,
  30. compilationController.editEngineering
  31. );
  32. router.get(
  33. "/valuation/:section/delete/:id",
  34. compilationController.auth,
  35. compilationController.init,
  36. compilationController.deleteValuation
  37. );
  38. router.get(
  39. "/template/:section/:id/:engineering",
  40. compilationController.auth,
  41. compilationController.init,
  42. compilationController.billsTemplate
  43. );
  44. router.post(
  45. "/release",
  46. compilationController.auth,
  47. compilationController.init,
  48. compilationController.release
  49. );
  50. router.post(
  51. "/add",
  52. compilationController.auth,
  53. compilationController.init,
  54. compilationController.addCompilation
  55. );
  56. router.post(
  57. "/setDescription",
  58. compilationController.auth,
  59. compilationController.init,
  60. compilationController.setDescription
  61. );
  62. router.post(
  63. "/setEdition",
  64. compilationController.auth,
  65. compilationController.init,
  66. compilationController.setEdition
  67. );
  68. router.post(
  69. "/setSerialNumber",
  70. compilationController.auth,
  71. compilationController.init,
  72. compilationController.setSerialNumber
  73. );
  74. router.post(
  75. "/setOverWriteUrl",
  76. compilationController.auth,
  77. compilationController.init,
  78. compilationController.setOverWriteUrl
  79. );
  80. router.post(
  81. "/setExample",
  82. compilationController.auth,
  83. compilationController.init,
  84. compilationController.setExample
  85. );
  86. router.post(
  87. "/add-valuation",
  88. compilationController.auth,
  89. compilationController.init,
  90. compilationController.addValuation
  91. );
  92. router.post(
  93. "/save-valuation",
  94. compilationController.auth,
  95. compilationController.init,
  96. compilationController.saveValuation
  97. );
  98. router.post(
  99. "/update-engineer",
  100. compilationController.auth,
  101. compilationController.init,
  102. compilationController.updateEngineer
  103. );
  104. router.post(
  105. "/delete-engineer",
  106. compilationController.auth,
  107. compilationController.init,
  108. compilationController.deleteEngineer
  109. );
  110. router.post(
  111. "/copy-engineer",
  112. compilationController.auth,
  113. compilationController.init,
  114. compilationController.copyEngineer
  115. );
  116. router.post(
  117. "/save-lib",
  118. compilationController.auth,
  119. compilationController.init,
  120. compilationController.saveEngineering
  121. );
  122. router.post(
  123. "/valuation/:section/enable",
  124. compilationController.auth,
  125. compilationController.init,
  126. compilationController.enableSwitch
  127. );
  128. router.post(
  129. "/valuation/:section/fileTypes",
  130. compilationController.auth,
  131. compilationController.init,
  132. compilationController.setFileTypes
  133. );
  134. router.post(
  135. "/template/:section/:id/:engineering/update",
  136. compilationController.auth,
  137. compilationController.init,
  138. compilationController.updateBillsTemplate
  139. );
  140. router.post(
  141. "/addEngineer",
  142. compilationController.auth,
  143. compilationController.init,
  144. compilationController.addEngineer
  145. );
  146. router.post(
  147. "/copyRationLibs",
  148. compilationController.auth,
  149. compilationController.init,
  150. compilationController.copyRationLibs
  151. );
  152. router.post(
  153. "/copyValuation",
  154. compilationController.auth,
  155. compilationController.init,
  156. compilationController.copyValuation
  157. );
  158. router.post(
  159. "/changeCategory",
  160. compilationController.auth,
  161. compilationController.init,
  162. compilationController.changeCategory
  163. );
  164. router.post(
  165. "/changeLocation",
  166. compilationController.auth,
  167. compilationController.init,
  168. compilationController.changeLocation
  169. );
  170. router.post(
  171. "/changeFreeUse",
  172. compilationController.auth,
  173. compilationController.init,
  174. compilationController.changeFreeUse
  175. );
  176. router.post(
  177. "/changeCompilation",
  178. compilationController.auth,
  179. compilationController.init,
  180. compilationController.changeCompilation
  181. );
  182. app.use("/compilation", router);
  183. };