spec.go 565 B

12345678910111213141516171819
  1. package routers
  2. import (
  3. "Medical_ERP/controllers"
  4. beego "github.com/beego/beego/v2/server/web"
  5. )
  6. func init() {
  7. // 分组
  8. spec := beego.NewNamespace("/api/spec",
  9. beego.NSRouter("/list", &controllers.SpecController{}, "*:List"),
  10. beego.NSRouter("/detail", &controllers.SpecController{}, "*:Detail"),
  11. beego.NSRouter("/add", &controllers.SpecController{}, "*:Add"),
  12. beego.NSRouter("/edit", &controllers.SpecController{}, "*:Edit"),
  13. beego.NSRouter("/delete", &controllers.SpecController{}, "*:Delete"),
  14. )
  15. //注册 namespace
  16. beego.AddNamespace(spec)
  17. }