router.go 8.8 KB

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