router.go 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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("/report_selection",
  108. web.NSInclude(
  109. &controllers.ReportSelectionController{},
  110. ),
  111. ),
  112. web.NSNamespace("/morning_meeting",
  113. web.NSInclude(
  114. &controllers.MorningMeetingController{},
  115. ),
  116. ),
  117. web.NSNamespace("/product_interior",
  118. web.NSInclude(
  119. &controllers.ProductInteriorController{},
  120. ),
  121. ),
  122. web.NSNamespace("/config",
  123. web.NSInclude(
  124. &controllers.ConfigController{},
  125. &controllers.BaseConfigController{},
  126. ),
  127. ),
  128. web.NSNamespace("/tactics",
  129. web.NSInclude(
  130. &controllers.MobileTacticsController{},
  131. ),
  132. ),
  133. web.NSNamespace("/banner",
  134. web.NSInclude(
  135. &controllers.BannerController{},
  136. &controllers.BaseBannerController{},
  137. ),
  138. ),
  139. web.NSNamespace("/tag",
  140. web.NSInclude(
  141. &controllers.TagController{},
  142. &controllers.TagCommonController{},
  143. ),
  144. ),
  145. web.NSNamespace("/collection",
  146. web.NSInclude(
  147. &controllers.CollectionController{},
  148. &controllers.BaseCollectionController{},
  149. ),
  150. ),
  151. web.NSNamespace("/yanxuan_special",
  152. web.NSInclude(
  153. &controllers.YanxuanSpecialController{},
  154. ),
  155. web.NSInclude(
  156. &controllers.YanxuanSpecialNoLoginController{},
  157. ),
  158. ),
  159. web.NSNamespace("/ficc_report",
  160. web.NSInclude(
  161. &controllers.FiccYbController{},
  162. ),
  163. ),
  164. )
  165. web.AddNamespace(ns)
  166. }