router.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. "eta/eta_forum_hub/controllers"
  11. "eta/eta_forum_hub/controllers/eta_trial"
  12. "eta/eta_forum_hub/controllers/system"
  13. "github.com/beego/beego/v2/server/web"
  14. )
  15. func init() {
  16. ns := web.NewNamespace("/v1",
  17. web.NSNamespace("/chart",
  18. web.NSInclude(
  19. &controllers.ChartInfoController{},
  20. &controllers.ChartThemeController{},
  21. ),
  22. ),
  23. web.NSNamespace("/auth",
  24. web.NSInclude(
  25. &controllers.AuthController{},
  26. ),
  27. ),
  28. web.NSNamespace("/admin",
  29. web.NSInclude(
  30. &controllers.AdminController{},
  31. ),
  32. ),
  33. web.NSNamespace("/chart_collect",
  34. web.NSInclude(
  35. &controllers.ChartCollectController{},
  36. ),
  37. ),
  38. web.NSNamespace("/system",
  39. web.NSInclude(
  40. &system.SysRoleController{},
  41. &system.SysGroupController{},
  42. &system.SysDepartmentController{},
  43. ),
  44. ),
  45. web.NSNamespace("/eta_trial",
  46. web.NSInclude(
  47. &eta_trial.EtaTrialController{},
  48. ),
  49. ),
  50. )
  51. web.AddNamespace(ns)
  52. }