router.go 7.6 KB

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