router.go 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  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. "eta/eta_api/controllers"
  11. "eta/eta_api/controllers/data_manage"
  12. "eta/eta_api/controllers/data_manage/correlation"
  13. future_good2 "eta/eta_api/controllers/data_manage/future_good"
  14. "eta/eta_api/controllers/data_manage/line_equation"
  15. "eta/eta_api/controllers/data_manage/line_feature"
  16. "eta/eta_api/controllers/data_manage/supply_analysis"
  17. "eta/eta_api/controllers/english_report"
  18. "eta/eta_api/controllers/eta_trial"
  19. "eta/eta_api/controllers/roadshow"
  20. "eta/eta_api/controllers/sandbox"
  21. "eta/eta_api/controllers/semantic_analysis"
  22. "eta/eta_api/controllers/smart_report"
  23. "eta/eta_api/controllers/trade_analysis"
  24. "github.com/beego/beego/v2/server/web"
  25. "github.com/beego/beego/v2/server/web/filter/cors"
  26. )
  27. func init() {
  28. //解决跨域问题
  29. web.InsertFilter("*", web.BeforeRouter, cors.Allow(&cors.Options{
  30. AllowAllOrigins: true,
  31. AllowMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
  32. AllowHeaders: []string{"Origin", "Authorization", "Uuid", "Accesstoken", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
  33. ExposeHeaders: []string{"Content-Length", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
  34. AllowCredentials: true,
  35. }))
  36. ns := web.NewNamespace("/adminapi",
  37. web.NSNamespace("/sysuser",
  38. web.NSInclude(
  39. &controllers.SysUserController{},
  40. ),
  41. web.NSInclude(
  42. &controllers.SysUserAuthController{},
  43. ),
  44. ),
  45. web.NSNamespace("/classify",
  46. web.NSInclude(
  47. &controllers.ClassifyController{},
  48. ),
  49. ),
  50. web.NSNamespace("/banner",
  51. web.NSInclude(
  52. &controllers.BannerController{},
  53. ),
  54. ),
  55. web.NSNamespace("/report",
  56. web.NSInclude(
  57. &controllers.ReportController{},
  58. &controllers.ReportChapterTypeController{},
  59. ),
  60. web.NSInclude(
  61. &controllers.ReportCommonController{},
  62. ),
  63. web.NSInclude(
  64. &controllers.ReportUploadCommonController{},
  65. ),
  66. ),
  67. web.NSNamespace("/voice",
  68. web.NSInclude(
  69. &controllers.VoiceController{},
  70. ),
  71. web.NSInclude(
  72. &controllers.VoiceCommonController{},
  73. ),
  74. ),
  75. web.NSNamespace("/pptv2",
  76. web.NSInclude(
  77. &controllers.PptV2Controller{},
  78. &controllers.PptV2GroupController{},
  79. ),
  80. web.NSInclude(
  81. &controllers.PptV2CommonController{},
  82. ),
  83. ),
  84. web.NSNamespace("/ppt_english",
  85. web.NSInclude(
  86. &controllers.PptEnglishController{},
  87. &controllers.PptEnglishGroupController{},
  88. ),
  89. web.NSInclude(
  90. &controllers.PptEnglishCommonController{},
  91. ),
  92. ),
  93. web.NSNamespace("/entry",
  94. web.NSInclude(
  95. &controllers.TargetController{},
  96. ),
  97. web.NSInclude(
  98. &controllers.TargetCommonController{},
  99. ),
  100. web.NSInclude(
  101. &controllers.TradeCommonController{},
  102. ),
  103. ),
  104. web.NSNamespace("/system",
  105. web.NSInclude(
  106. &controllers.SysDepartmentController{},
  107. ),
  108. web.NSInclude(
  109. &controllers.SysGroupController{},
  110. ),
  111. web.NSInclude(
  112. &controllers.SysTeamController{},
  113. ),
  114. web.NSInclude(
  115. &controllers.SysAdminController{},
  116. ),
  117. web.NSInclude(
  118. &controllers.SysRoleController{},
  119. &controllers.SysRoleAdminController{},
  120. ),
  121. web.NSInclude(
  122. &controllers.SysMenuController{},
  123. ),
  124. web.NSInclude(
  125. &controllers.SysMenuButtonController{},
  126. ),
  127. web.NSInclude(
  128. &controllers.ResearchGroupController{},
  129. ),
  130. ),
  131. web.NSNamespace("/custom",
  132. web.NSInclude(
  133. &controllers.CompanySellerController{},
  134. &controllers.CompanyPermissionController{},
  135. ),
  136. ),
  137. web.NSNamespace("/resource",
  138. web.NSInclude(
  139. &controllers.ResourceController{},
  140. ),
  141. ),
  142. web.NSNamespace("/datamanage",
  143. web.NSInclude(
  144. &data_manage.EdbInfoController{},
  145. &data_manage.EdbClassifyController{},
  146. &data_manage.ChartClassifyController{},
  147. &data_manage.ChartInfoController{},
  148. &data_manage.ManualController{},
  149. &data_manage.BaseFromChangesVisitorsCovidController{},
  150. &data_manage.ExcelClassifyController{},
  151. &data_manage.ExcelInfoController{},
  152. &data_manage.PredictEdbClassifyController{},
  153. &data_manage.PredictEdbInfoController{},
  154. &data_manage.BaseFromNationalStatisticsController{},
  155. ),
  156. ),
  157. web.NSNamespace("/my_chart",
  158. web.NSInclude(
  159. &data_manage.MyChartController{},
  160. ),
  161. ),
  162. web.NSNamespace("/roadshow",
  163. web.NSInclude(
  164. &roadshow.CalendarController{},
  165. ),
  166. ),
  167. web.NSNamespace("/taglib",
  168. web.NSInclude(
  169. &controllers.VarietyTagController{},
  170. ),
  171. ),
  172. web.NSNamespace("/sandbox",
  173. web.NSInclude(
  174. &sandbox.SandboxController{},
  175. ),
  176. ),
  177. web.NSNamespace("/pdfToImg",
  178. web.NSInclude(
  179. &controllers.PdfToImgCommonController{},
  180. ),
  181. ),
  182. web.NSNamespace("/english_report",
  183. web.NSInclude(
  184. &english_report.EnglishReportController{},
  185. &english_report.EnglishPolicyReportController{},
  186. &english_report.EnglishReportEmailController{},
  187. &english_report.EnglishCompanyController{},
  188. &english_report.EnglishCompanyTodoController{},
  189. &english_report.EnglishAuthController{},
  190. &english_report.EnglishReportEmailCallBackController{},
  191. &english_report.EnglishVideoController{},
  192. ),
  193. ),
  194. web.NSNamespace("/report_author",
  195. web.NSInclude(
  196. &controllers.ReportAuthorCommonController{},
  197. ),
  198. web.NSInclude(
  199. &controllers.ReportAuthorController{},
  200. ),
  201. ),
  202. web.NSNamespace("/future_good",
  203. web.NSInclude(
  204. &future_good2.FutureGoodEdbInfoController{},
  205. &future_good2.FutureGoodChartClassifyController{},
  206. &future_good2.FutureGoodChartInfoController{},
  207. ),
  208. ),
  209. web.NSNamespace("/correlation",
  210. web.NSInclude(
  211. &correlation.CorrelationChartClassifyController{},
  212. &correlation.CorrelationChartInfoController{},
  213. ),
  214. ),
  215. web.NSNamespace("/line_equation",
  216. web.NSInclude(
  217. &line_equation.LineEquationChartClassifyController{},
  218. &line_equation.LineEquationChartInfoController{},
  219. ),
  220. ),
  221. web.NSNamespace("/line_feature",
  222. web.NSInclude(
  223. &line_feature.LineFeaturesChartClassifyController{},
  224. &line_feature.LineFeaturesChartInfoController{},
  225. ),
  226. ),
  227. web.NSNamespace("/cloud_disk",
  228. web.NSInclude(
  229. &controllers.CloudDiskController{},
  230. ),
  231. ),
  232. web.NSNamespace("/semantic_analysis",
  233. web.NSInclude(
  234. &semantic_analysis.SaLabelController{},
  235. &semantic_analysis.SaDocClassifyController{},
  236. &semantic_analysis.SaDocController{},
  237. &semantic_analysis.SaCompareClassifyController{},
  238. &semantic_analysis.SaCompareController{},
  239. ),
  240. ),
  241. web.NSNamespace("/supply_analysis",
  242. web.NSInclude(
  243. &supply_analysis.VarietyController{},
  244. ),
  245. ),
  246. web.NSNamespace("/en_permission",
  247. web.NSInclude(
  248. &english_report.EnPermissionController{},
  249. ),
  250. ),
  251. web.NSNamespace("/english_classify",
  252. web.NSInclude(
  253. &english_report.EnglishClassifyController{},
  254. ),
  255. ),
  256. web.NSNamespace("/business_conf",
  257. web.NSInclude(
  258. &controllers.BusinessConfController{},
  259. &controllers.BusinessConfOpenController{},
  260. ),
  261. ),
  262. web.NSNamespace("/trade_analysis",
  263. web.NSInclude(
  264. &trade_analysis.TradeAnalysisController{},
  265. ),
  266. ),
  267. web.NSNamespace("/out_link",
  268. web.NSInclude(
  269. &controllers.OutLinkController{},
  270. ),
  271. ),
  272. web.NSNamespace("/eta_trial",
  273. web.NSInclude(
  274. &eta_trial.EtaTrialController{},
  275. ),
  276. ),
  277. web.NSNamespace("/user_login",
  278. web.NSInclude(
  279. &controllers.UserLoginController{},
  280. &controllers.UserLoginAuthController{},
  281. ),
  282. ),
  283. web.NSNamespace("/smart_report",
  284. web.NSInclude(
  285. &smart_report.SmartReportController{},
  286. ),
  287. ),
  288. )
  289. web.AddNamespace(ns)
  290. }