func RestRoute(path string, action beego.ControllerInterface) {
beego.Router(path, action,"get:Index")
beego.Router(path + "/add", action,"get:Add")
beego.Router(path + "/create", action,"post:Create")
beego.Router(path + "/edit/:id", action,"get:Edit")
beego.Router(path + "/update/:id", action,"post:Update")
beego.Router(path + "/delete/:id", action,"post:Delete")
}
使用
RestRoute("/backend/friendlink", &backend.FriendlinkController{});