router.go 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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_clpt/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", "From"},
  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("/wechat",
  24. web.NSInclude(
  25. &controllers.WechatController{},
  26. &controllers.WechatCommonController{},
  27. &controllers.MobileWechatController{},
  28. ),
  29. ),
  30. web.NSNamespace("/user",
  31. web.NSInclude(
  32. &controllers.UserController{},
  33. &controllers.UserCommonController{},
  34. ),
  35. ),
  36. web.NSNamespace("/permission",
  37. web.NSInclude(
  38. &controllers.ChartPermissionController{},
  39. &controllers.ChartPermissionAuthController{},
  40. &controllers.MobileChartPermissionAuthController{},
  41. ),
  42. ),
  43. web.NSNamespace("/resource",
  44. web.NSInclude(
  45. &controllers.BaseResourceController{},
  46. ),
  47. web.NSInclude(
  48. &controllers.ResourceController{},
  49. ),
  50. ),
  51. web.NSNamespace("/home",
  52. web.NSInclude(
  53. &controllers.MobileHomeController{},
  54. ),
  55. ),
  56. web.NSNamespace("/article",
  57. web.NSInclude(
  58. &controllers.ArticleController{},
  59. ),
  60. ),
  61. web.NSNamespace("/search",
  62. web.NSInclude(
  63. &controllers.MobileSearchController{},
  64. &controllers.BaseSearchController{},
  65. ),
  66. ),
  67. web.NSNamespace("/report",
  68. web.NSInclude(
  69. &controllers.ReportController{},
  70. &controllers.ReportCommonController{},
  71. &controllers.MobileReportController{},
  72. ),
  73. ),
  74. web.NSNamespace("/report_billboard",
  75. web.NSInclude(
  76. &controllers.ReportBillboardController{},
  77. &controllers.ReportBillboardCommonController{},
  78. &controllers.MobileReportBillboardController{},
  79. ),
  80. ),
  81. web.NSNamespace("/micro_roadshow",
  82. web.NSInclude(
  83. &controllers.MicroRoadShowController{},
  84. ),
  85. ),
  86. web.NSNamespace("/activity",
  87. web.NSInclude(
  88. &controllers.ActivityController{},
  89. &controllers.ActivityNoLoginController{},
  90. ),
  91. ),
  92. web.NSNamespace("/activity_special",
  93. web.NSInclude(
  94. &controllers.ActivitySpecialController{},
  95. ),
  96. ),
  97. web.NSNamespace("/advice",
  98. web.NSInclude(
  99. &controllers.AdviceController{},
  100. ),
  101. ),
  102. web.NSNamespace("/research",
  103. web.NSInclude(
  104. &controllers.MobileResearchController{},
  105. ),
  106. ),
  107. web.NSNamespace("/tactics",
  108. web.NSInclude(
  109. &controllers.MobileTacticsController{},
  110. ),
  111. ),
  112. web.NSNamespace("/report_selection",
  113. web.NSInclude(
  114. &controllers.ReportSelectionController{},
  115. ),
  116. ),
  117. web.NSNamespace("/morning_meeting",
  118. web.NSInclude(
  119. &controllers.MorningMeetingController{},
  120. ),
  121. ),
  122. web.NSNamespace("/product_interior",
  123. web.NSInclude(
  124. &controllers.ProductInteriorController{},
  125. ),
  126. ),
  127. web.NSNamespace("/config",
  128. web.NSInclude(
  129. &controllers.ConfigController{},
  130. &controllers.BaseConfigController{},
  131. ),
  132. ),
  133. web.NSNamespace("/tactics",
  134. web.NSInclude(
  135. &controllers.MobileTacticsController{},
  136. ),
  137. ),
  138. web.NSNamespace("/gushou",
  139. web.NSInclude(
  140. &controllers.MobileGushouController{},
  141. ),
  142. ),
  143. web.NSNamespace("/banner",
  144. web.NSInclude(
  145. &controllers.BannerController{},
  146. &controllers.BaseBannerController{},
  147. ),
  148. ),
  149. web.NSNamespace("/tag",
  150. web.NSInclude(
  151. &controllers.TagController{},
  152. &controllers.TagCommonController{},
  153. ),
  154. ),
  155. web.NSNamespace("/collection",
  156. web.NSInclude(
  157. &controllers.CollectionController{},
  158. &controllers.BaseCollectionController{},
  159. ),
  160. ),
  161. web.NSNamespace("/yanxuan_special",
  162. web.NSInclude(
  163. &controllers.YanxuanSpecialController{},
  164. ),
  165. web.NSInclude(
  166. &controllers.YanxuanSpecialNoLoginController{},
  167. ),
  168. ),
  169. web.NSNamespace("/ficc_report",
  170. web.NSInclude(
  171. &controllers.FiccYbController{},
  172. ),
  173. ),
  174. )
  175. web.AddNamespace(ns)
  176. }