router.go 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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("/gushou",
  88. web.NSInclude(
  89. &controllers.GushouController{},
  90. ),
  91. ),
  92. web.NSNamespace("/report",
  93. web.NSInclude(
  94. &controllers.ReportController{},
  95. ),
  96. ),
  97. web.NSNamespace("/activity",
  98. web.NSInclude(
  99. &controllers.ActivityCoAntroller{},
  100. &controllers.ActivityABaseController{},
  101. &controllers.ActivityNoLoginController{},
  102. ),
  103. ),
  104. web.NSNamespace("/research",
  105. web.NSInclude(
  106. &controllers.ResearchController{},
  107. ),
  108. ),
  109. web.NSNamespace("/chart",
  110. web.NSInclude(
  111. &controllers.BaseChartController{},
  112. &controllers.ChartController{},
  113. ),
  114. ),
  115. web.NSNamespace("/report_billboard",
  116. web.NSInclude(
  117. &controllers.ReportBillboardController{},
  118. ),
  119. ),
  120. web.NSNamespace("/htgj",
  121. web.NSInclude(
  122. &controllers.BaseHtgjController{},
  123. ),
  124. ),
  125. web.NSNamespace("/micro_roadshow",
  126. web.NSInclude(
  127. &controllers.MicroRoadShowController{},
  128. ),
  129. ),
  130. web.NSNamespace("/activity_special",
  131. web.NSInclude(
  132. &controllers.ActivitySpecialCoAntroller{},
  133. ),
  134. ),
  135. web.NSNamespace("/industry",
  136. web.NSInclude(
  137. &controllers.IndustryController{},
  138. ),
  139. ),
  140. web.NSNamespace("/report_selection",
  141. web.NSInclude(
  142. &controllers.ReportSelectionController{},
  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("/activity_signin",
  156. web.NSInclude(
  157. &controllers.ActivitySignCoAntroller{},
  158. ),
  159. ),
  160. web.NSNamespace("/banner",
  161. web.NSInclude(
  162. &controllers.BannerController{},
  163. ),
  164. ),
  165. web.NSNamespace("/tag",
  166. web.NSInclude(
  167. &controllers.TagController{},
  168. ),
  169. ),
  170. web.NSNamespace("/collection",
  171. web.NSInclude(
  172. &controllers.CollectionController{},
  173. ),
  174. ),
  175. web.NSNamespace("/yanxuan_special",
  176. web.NSInclude(
  177. &controllers.YanxuanSpecialController{},
  178. ),
  179. ),
  180. web.NSNamespace("/questionnaire",
  181. web.NSInclude(
  182. &controllers.QuestionnaireController{},
  183. ),
  184. ),
  185. web.NSNamespace("/ficc_report",
  186. web.NSInclude(
  187. &controllers.FiccYbController{},
  188. ),
  189. ),
  190. )
  191. web.AddNamespace(ns)
  192. }