12345678910111213141516171819 |
- package routers
- import (
- "Medical_ERP/controllers"
- beego "github.com/beego/beego/v2/server/web"
- )
- func init() {
- // 分组
- product := beego.NewNamespace("/api/product",
- beego.NSRouter("/list", &controllers.ProductController{}, "*:List"),
- beego.NSRouter("/detail", &controllers.ProductController{}, "*:Detail"),
- beego.NSRouter("/add", &controllers.ProductController{}, "*:Add"),
- beego.NSRouter("/edit", &controllers.ProductController{}, "*:Edit"),
- beego.NSRouter("/delete", &controllers.ProductController{}, "*:Delete"),
- )
- //注册 namespace
- beego.AddNamespace(product)
- }
|