product.go 589 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. product := beego.NewNamespace("/api/product",
  9. beego.NSRouter("/list", &controllers.ProductController{}, "*:List"),
  10. beego.NSRouter("/detail", &controllers.ProductController{}, "*:Detail"),
  11. beego.NSRouter("/add", &controllers.ProductController{}, "*:Add"),
  12. beego.NSRouter("/edit", &controllers.ProductController{}, "*:Edit"),
  13. beego.NSRouter("/delete", &controllers.ProductController{}, "*:Delete"),
  14. )
  15. //注册 namespace
  16. beego.AddNamespace(product)
  17. }