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