mirror of
https://github.com/astaxie/beego.git
synced 2025-07-04 09:50:18 +00:00
support autorouter
This commit is contained in:
10
beego.go
10
beego.go
@ -138,6 +138,11 @@ func (app *App) Router(path string, c ControllerInterface, mappingMethods ...str
|
||||
return app
|
||||
}
|
||||
|
||||
func (app *App) AutoRouter(c ControllerInterface) *App {
|
||||
app.Handlers.AddAuto(c)
|
||||
return app
|
||||
}
|
||||
|
||||
func (app *App) Filter(filter http.HandlerFunc) *App {
|
||||
app.Handlers.Filter(filter)
|
||||
return app
|
||||
@ -192,6 +197,11 @@ func RESTRouter(rootpath string, c ControllerInterface) *App {
|
||||
return BeeApp
|
||||
}
|
||||
|
||||
func AutoRouter(c ControllerInterface) *App {
|
||||
BeeApp.AutoRouter(c)
|
||||
return BeeApp
|
||||
}
|
||||
|
||||
func RouterHandler(path string, c http.Handler) *App {
|
||||
BeeApp.Handlers.AddHandler(path, c)
|
||||
return BeeApp
|
||||
|
Reference in New Issue
Block a user