router.go 8.6 KB

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