router.go 597 B

1234567891011121314151617181920212223242526
  1. // @APIVersion 1.0
  2. // @Title Common API docs of GD.
  3. // @Description This is common API docs,any developer can test each API in the page.
  4. // @License Apache 2.0
  5. // @LicenseUrl http://www.apache.org/licenses/LICENSE-2.0.html
  6. package routers
  7. import (
  8. "gd_gateway/controllers/ctrl_v1"
  9. "gd_gateway/routers/middleware"
  10. "github.com/astaxie/beego"
  11. )
  12. func init() {
  13. beego.ErrorHandler("404", notFound)
  14. api := beego.NewNamespace("/api",
  15. beego.NSBefore(middleware.ExitCheck),
  16. beego.NSNamespace("/v1",
  17. beego.NSInclude(
  18. &ctrl_v1.CenterController{},
  19. ),
  20. ),
  21. )
  22. beego.AddNamespace(api)
  23. }