router.go 9.0 KB

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