router.go 9.0 KB

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