router.go 8.8 KB

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