router.go 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. // @APIVersion 1.0.0
  2. // @Title beego Test API
  3. // @Description beego has a very cool tools to autogenerate documents for your API
  4. // @Contact astaxie@gmail.com
  5. // @TermsOfServiceUrl http://web.me/
  6. // @License Apache 2.0
  7. // @LicenseUrl http://www.apache.org/licenses/LICENSE-2.0.html
  8. package routers
  9. import (
  10. "github.com/beego/beego/v2/server/web"
  11. "github.com/beego/beego/v2/server/web/filter/cors"
  12. "hongze/hz_eta_api/controllers"
  13. "hongze/hz_eta_api/controllers/ai"
  14. "hongze/hz_eta_api/controllers/data_manage"
  15. "hongze/hz_eta_api/controllers/data_manage/correlation"
  16. future_good2 "hongze/hz_eta_api/controllers/data_manage/future_good"
  17. "hongze/hz_eta_api/controllers/data_manage/line_equation"
  18. "hongze/hz_eta_api/controllers/data_manage/line_feature"
  19. "hongze/hz_eta_api/controllers/data_manage/supply_analysis"
  20. "hongze/hz_eta_api/controllers/english_report"
  21. "hongze/hz_eta_api/controllers/roadshow"
  22. "hongze/hz_eta_api/controllers/sandbox"
  23. "hongze/hz_eta_api/controllers/semantic_analysis"
  24. )
  25. func init() {
  26. //解决跨域问题
  27. web.InsertFilter("*", web.BeforeRouter, cors.Allow(&cors.Options{
  28. AllowAllOrigins: true,
  29. AllowMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
  30. AllowHeaders: []string{"Origin", "Authorization", "Uuid", "Accesstoken", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
  31. ExposeHeaders: []string{"Content-Length", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
  32. AllowCredentials: true,
  33. }))
  34. ns := web.NewNamespace("/adminapi",
  35. web.NSNamespace("/sysuser",
  36. web.NSInclude(
  37. &controllers.SysUserController{},
  38. ),
  39. web.NSInclude(
  40. &controllers.SysUserAuthController{},
  41. ),
  42. ),
  43. web.NSNamespace("/classify",
  44. web.NSInclude(
  45. &controllers.ClassifyController{},
  46. ),
  47. ),
  48. web.NSNamespace("/report",
  49. web.NSInclude(
  50. &controllers.ReportController{},
  51. &controllers.ReportChapterTypeController{},
  52. ),
  53. web.NSInclude(
  54. &controllers.ReportCommonController{},
  55. ),
  56. web.NSInclude(
  57. &controllers.ReportUploadCommonController{},
  58. ),
  59. ),
  60. web.NSNamespace("/voice",
  61. web.NSInclude(
  62. &controllers.VoiceController{},
  63. ),
  64. web.NSInclude(
  65. &controllers.VoiceCommonController{},
  66. ),
  67. ),
  68. web.NSNamespace("/pptv2",
  69. web.NSInclude(
  70. &controllers.PptV2Controller{},
  71. &controllers.PptV2GroupController{},
  72. ),
  73. web.NSInclude(
  74. &controllers.PptV2CommonController{},
  75. ),
  76. ),
  77. web.NSNamespace("/ppt_english",
  78. web.NSInclude(
  79. &controllers.PptEnglishController{},
  80. &controllers.PptEnglishGroupController{},
  81. ),
  82. web.NSInclude(
  83. &controllers.PptEnglishCommonController{},
  84. ),
  85. ),
  86. web.NSNamespace("/entry",
  87. web.NSInclude(
  88. &controllers.TargetController{},
  89. ),
  90. web.NSInclude(
  91. &controllers.TargetCommonController{},
  92. ),
  93. web.NSInclude(
  94. &controllers.TradeCommonController{},
  95. ),
  96. ),
  97. web.NSNamespace("/system",
  98. web.NSInclude(
  99. &controllers.SysDepartmentController{},
  100. ),
  101. web.NSInclude(
  102. &controllers.SysGroupController{},
  103. ),
  104. web.NSInclude(
  105. &controllers.SysTeamController{},
  106. ),
  107. web.NSInclude(
  108. &controllers.SysAdminController{},
  109. ),
  110. web.NSInclude(
  111. &controllers.SysRoleController{},
  112. &controllers.SysRoleAdminController{},
  113. ),
  114. web.NSInclude(
  115. &controllers.SysMenuController{},
  116. ),
  117. web.NSInclude(
  118. &controllers.SysMenuButtonController{},
  119. ),
  120. web.NSInclude(
  121. &controllers.ResearchGroupController{},
  122. ),
  123. ),
  124. web.NSNamespace("/custom",
  125. web.NSInclude(
  126. &controllers.CompanySellerController{},
  127. &controllers.CompanyPermissionController{},
  128. ),
  129. ),
  130. web.NSNamespace("/resource",
  131. web.NSInclude(
  132. &controllers.ResourceController{},
  133. ),
  134. ),
  135. web.NSNamespace("/datamanage",
  136. web.NSInclude(
  137. &data_manage.EdbInfoController{},
  138. &data_manage.EdbClassifyController{},
  139. &data_manage.ChartClassifyController{},
  140. &data_manage.ChartInfoController{},
  141. &data_manage.ManualController{},
  142. &data_manage.BaseFromChangesVisitorsCovidController{},
  143. &data_manage.ExcelClassifyController{},
  144. &data_manage.ExcelInfoController{},
  145. &data_manage.PredictEdbClassifyController{},
  146. &data_manage.PredictEdbInfoController{},
  147. &data_manage.BaseFromNationalStatisticsController{},
  148. ),
  149. ),
  150. web.NSNamespace("/my_chart",
  151. web.NSInclude(
  152. &data_manage.MyChartController{},
  153. ),
  154. ),
  155. web.NSNamespace("/roadshow",
  156. web.NSInclude(
  157. &roadshow.CalendarController{},
  158. ),
  159. ),
  160. web.NSNamespace("/taglib",
  161. web.NSInclude(
  162. &controllers.VarietyTagController{},
  163. ),
  164. ),
  165. web.NSNamespace("/sandbox",
  166. web.NSInclude(
  167. &sandbox.SandboxController{},
  168. ),
  169. ),
  170. web.NSNamespace("/pdfToImg",
  171. web.NSInclude(
  172. &controllers.PdfToImgCommonController{},
  173. ),
  174. ),
  175. web.NSNamespace("/english_report",
  176. web.NSInclude(
  177. &english_report.EnglishReportController{},
  178. &english_report.EnglishPolicyReportController{},
  179. &english_report.EnglishReportEmailController{},
  180. &english_report.EnglishCompanyController{},
  181. &english_report.EnglishCompanyTodoController{},
  182. &english_report.EnglishAuthController{},
  183. &english_report.EnglishReportEmailCallBackController{},
  184. &english_report.EnglishVideoController{},
  185. ),
  186. ),
  187. web.NSNamespace("/report_author",
  188. web.NSInclude(
  189. &controllers.ReportAuthorCommonController{},
  190. ),
  191. web.NSInclude(
  192. &controllers.ReportAuthorController{},
  193. ),
  194. ),
  195. web.NSNamespace("/future_good",
  196. web.NSInclude(
  197. &future_good2.FutureGoodEdbInfoController{},
  198. &future_good2.FutureGoodChartClassifyController{},
  199. &future_good2.FutureGoodChartInfoController{},
  200. ),
  201. ),
  202. web.NSNamespace("/correlation",
  203. web.NSInclude(
  204. &correlation.CorrelationChartClassifyController{},
  205. &correlation.CorrelationChartInfoController{},
  206. ),
  207. ),
  208. web.NSNamespace("/line_equation",
  209. web.NSInclude(
  210. &line_equation.LineEquationChartClassifyController{},
  211. &line_equation.LineEquationChartInfoController{},
  212. ),
  213. ),
  214. web.NSNamespace("/line_feature",
  215. web.NSInclude(
  216. &line_feature.LineFeaturesChartClassifyController{},
  217. &line_feature.LineFeaturesChartInfoController{},
  218. ),
  219. ),
  220. web.NSNamespace("/cloud_disk",
  221. web.NSInclude(
  222. &controllers.CloudDiskController{},
  223. ),
  224. ),
  225. web.NSNamespace("/semantic_analysis",
  226. web.NSInclude(
  227. &semantic_analysis.SaLabelController{},
  228. &semantic_analysis.SaDocClassifyController{},
  229. &semantic_analysis.SaDocController{},
  230. &semantic_analysis.SaCompareClassifyController{},
  231. &semantic_analysis.SaCompareController{},
  232. ),
  233. ),
  234. web.NSNamespace("/supply_analysis",
  235. web.NSInclude(
  236. &supply_analysis.VarietyController{},
  237. ),
  238. ),
  239. web.NSNamespace("/ai",
  240. web.NSInclude(
  241. &ai.AiController{},
  242. ),
  243. ),
  244. web.NSNamespace("/en_permission",
  245. web.NSInclude(
  246. &english_report.EnPermissionController{},
  247. ),
  248. ),
  249. web.NSNamespace("/english_classify",
  250. web.NSInclude(
  251. &english_report.EnglishClassifyController{},
  252. ),
  253. ),
  254. )
  255. web.AddNamespace(ns)
  256. }