router.go 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. // @APIVersion 1.0.0
  2. // @Title utimes API docs
  3. // @Description This is utimes API docs,iOS、Android、Server developers can test every API in this page.
  4. // @License Apache 2.0
  5. // @LicenseUrl http://www.apache.org/licenses/LICENSE-2.0.html
  6. package routers
  7. import (
  8. "gd_management_gateway/controllers/ctrl_v1"
  9. "gd_management_gateway/routers/middleware"
  10. "github.com/astaxie/beego"
  11. )
  12. func init() {
  13. beego.ErrorHandler("404", notFound)
  14. ns_v1 := beego.NewNamespace("/api/v1",
  15. beego.NSNamespace("/base_api",
  16. beego.NSBefore(middleware.JwtAuth),
  17. beego.NSInclude(
  18. &ctrl_v1.BaseApiController{},
  19. ),
  20. ),
  21. beego.NSNamespace("/user_merchant",
  22. beego.NSBefore(middleware.JwtAuth),
  23. beego.NSInclude(
  24. &ctrl_v1.UserMerchantController{},
  25. ),
  26. ),
  27. beego.NSNamespace("/merchant_api",
  28. beego.NSBefore(middleware.JwtAuth),
  29. beego.NSInclude(
  30. &ctrl_v1.MerchantApiController{},
  31. ),
  32. ),
  33. beego.NSNamespace("/merchant_order",
  34. beego.NSInclude(
  35. &ctrl_v1.MerchantOrderController{},
  36. ),
  37. ),
  38. beego.NSNamespace("/merchant_h5",
  39. beego.NSBefore(middleware.JwtAuth),
  40. beego.NSInclude(
  41. &ctrl_v1.MerchantH5Controller{},
  42. ),
  43. ),
  44. beego.NSNamespace("/admin",
  45. beego.NSInclude(
  46. &ctrl_v1.BaseAdminController{},
  47. ),
  48. ),
  49. beego.NSNamespace("/data_api",
  50. beego.NSBefore(middleware.JwtAuth),
  51. beego.NSInclude(
  52. &ctrl_v1.BaseDataApiController{},
  53. ),
  54. ),
  55. beego.NSNamespace("/provider",
  56. beego.NSBefore(middleware.JwtAuth),
  57. beego.NSInclude(
  58. &ctrl_v1.BaseProviderController{},
  59. ),
  60. ),
  61. beego.NSNamespace("/access_log",
  62. beego.NSInclude(
  63. &ctrl_v1.BaseAccessLogController{},
  64. ),
  65. ),
  66. beego.NSNamespace("/error_code",
  67. beego.NSBefore(middleware.JwtAuth),
  68. beego.NSInclude(
  69. &ctrl_v1.ErrorController{},
  70. ),
  71. ),
  72. beego.NSNamespace("/h5",
  73. beego.NSBefore(middleware.JwtAuth),
  74. beego.NSInclude(
  75. &ctrl_v1.H5ApiController{},
  76. ),
  77. beego.NSInclude(
  78. &ctrl_v1.H5ServiceController{},
  79. ),
  80. ),
  81. beego.NSNamespace("/service_order",
  82. beego.NSBefore(middleware.JwtAuth),
  83. beego.NSInclude(
  84. &ctrl_v1.ServiceOrderController{},
  85. ),
  86. ),
  87. beego.NSNamespace("/action_log",
  88. beego.NSBefore(middleware.JwtAuth),
  89. beego.NSInclude(
  90. &ctrl_v1.ActionLogController{},
  91. ),
  92. ),
  93. beego.NSNamespace("/auth",
  94. beego.NSBefore(middleware.JwtAuth),
  95. beego.NSInclude(
  96. &ctrl_v1.AuthController{},
  97. ),
  98. ),
  99. beego.NSNamespace("/crontab",
  100. beego.NSBefore(middleware.JwtAuth),
  101. beego.NSInclude(
  102. &ctrl_v1.CrontabController{},
  103. ),
  104. ),
  105. beego.NSNamespace("/data_editor",
  106. beego.NSBefore(middleware.JwtAuth),
  107. beego.NSInclude(
  108. &ctrl_v1.DataSupplementController{},
  109. ),
  110. ),
  111. beego.NSNamespace("/accounting",
  112. beego.NSBefore(middleware.JwtAuth),
  113. beego.NSInclude(
  114. &ctrl_v1.AccountingController{},
  115. ),
  116. ),
  117. )
  118. beego.AddNamespace(ns_v1)
  119. }