router.go 8.7 KB

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