router.go 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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://beego.me/
  6. // @License Apache 2.0
  7. // @LicenseUrl http://www.apache.org/licenses/LICENSE-2.0.html
  8. package routers
  9. import (
  10. "github.com/beego/beego/v2/server/web"
  11. "github.com/beego/beego/v2/server/web/filter/cors"
  12. "hongze/hongze_cygx/controllers"
  13. )
  14. func init() {
  15. web.InsertFilter("*", web.BeforeRouter, cors.Allow(&cors.Options{
  16. AllowAllOrigins: true,
  17. AllowMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
  18. AllowHeaders: []string{"Origin", "Account", "Authorization", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
  19. ExposeHeaders: []string{"Content-Length", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type", "Sign"},
  20. AllowCredentials: true,
  21. }))
  22. ns := web.NewNamespace("/api",
  23. web.NSNamespace("/home",
  24. web.NSInclude(
  25. &controllers.HomeController{},
  26. ),
  27. web.NSInclude(
  28. &controllers.BaseHomeController{},
  29. ),
  30. ),
  31. web.NSNamespace("/wechat",
  32. web.NSInclude(
  33. &controllers.WechatController{},
  34. &controllers.WechatCommonController{},
  35. ),
  36. ),
  37. web.NSNamespace("/user",
  38. web.NSInclude(
  39. &controllers.UserController{},
  40. &controllers.UserCommonController{},
  41. ),
  42. ),
  43. web.NSNamespace("/permission",
  44. web.NSInclude(
  45. &controllers.ChartPermissionController{},
  46. &controllers.ChartPermissionAuthController{},
  47. ),
  48. ),
  49. web.NSNamespace("/article",
  50. web.NSInclude(
  51. &controllers.ArticleController{},
  52. &controllers.ArticleCommonController{},
  53. &controllers.ArticleControllerMobile{},
  54. ),
  55. ),
  56. web.NSNamespace("/config",
  57. web.NSInclude(
  58. &controllers.ConfigController{},
  59. ),
  60. web.NSInclude(
  61. &controllers.BaseConfigController{},
  62. ),
  63. ),
  64. web.NSNamespace("/search",
  65. web.NSInclude(
  66. &controllers.SearchController{},
  67. ),
  68. web.NSInclude(
  69. &controllers.BaseSearchController{},
  70. ),
  71. ),
  72. web.NSNamespace("/resource",
  73. web.NSInclude(
  74. &controllers.ResourceController{},
  75. ),
  76. ),
  77. web.NSNamespace("/advice",
  78. web.NSInclude(
  79. &controllers.AdviceController{},
  80. ),
  81. ),
  82. web.NSNamespace("/tactics",
  83. web.NSInclude(
  84. &controllers.TacticsController{},
  85. ),
  86. ),
  87. web.NSNamespace("/report",
  88. web.NSInclude(
  89. &controllers.ReportController{},
  90. ),
  91. ),
  92. web.NSNamespace("/activity",
  93. web.NSInclude(
  94. &controllers.ActivityCoAntroller{},
  95. &controllers.ActivityABaseController{},
  96. &controllers.ActivityNoLoginController{},
  97. ),
  98. ),
  99. web.NSNamespace("/research",
  100. web.NSInclude(
  101. &controllers.ResearchController{},
  102. ),
  103. ),
  104. web.NSNamespace("/chart",
  105. web.NSInclude(
  106. &controllers.BaseChartController{},
  107. &controllers.ChartController{},
  108. ),
  109. ),
  110. web.NSNamespace("/report_billboard",
  111. web.NSInclude(
  112. &controllers.ReportBillboardController{},
  113. ),
  114. ),
  115. web.NSNamespace("/htgj",
  116. web.NSInclude(
  117. &controllers.BaseHtgjController{},
  118. ),
  119. ),
  120. web.NSNamespace("/micro_roadshow",
  121. web.NSInclude(
  122. &controllers.MicroRoadShowController{},
  123. ),
  124. ),
  125. web.NSNamespace("/activity_special",
  126. web.NSInclude(
  127. &controllers.ActivitySpecialCoAntroller{},
  128. ),
  129. ),
  130. web.NSNamespace("/industry",
  131. web.NSInclude(
  132. &controllers.IndustryController{},
  133. ),
  134. ),
  135. web.NSNamespace("/report_selection",
  136. web.NSInclude(
  137. &controllers.ReportSelectionController{},
  138. ),
  139. ),
  140. web.NSNamespace("/activity_signin",
  141. web.NSInclude(
  142. &controllers.ActivitySignCoAntroller{},
  143. ),
  144. ),
  145. web.NSNamespace("/product_interior",
  146. web.NSInclude(
  147. &controllers.ProductInteriorController{},
  148. ),
  149. ),
  150. web.NSNamespace("/morning_meeting",
  151. web.NSInclude(
  152. &controllers.MorningMeetingController{},
  153. ),
  154. ),
  155. web.NSNamespace("/banner",
  156. web.NSInclude(
  157. &controllers.BannerController{},
  158. ),
  159. ),
  160. web.NSNamespace("/tag",
  161. web.NSInclude(
  162. &controllers.TagController{},
  163. ),
  164. ),
  165. web.NSNamespace("/yanxuan_special",
  166. web.NSInclude(
  167. &controllers.YanxuanSpecialController{},
  168. ),
  169. ),
  170. web.NSNamespace("/collection",
  171. web.NSInclude(
  172. &controllers.CollectionController{},
  173. ),
  174. ),
  175. web.NSNamespace("/questionnaire",
  176. web.NSInclude(
  177. &controllers.QuestionnaireController{},
  178. ),
  179. ),
  180. web.NSNamespace("/ficc_report",
  181. web.NSInclude(
  182. &controllers.FiccYbController{},
  183. ),
  184. ),
  185. )
  186. web.AddNamespace(ns)
  187. }