1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-22 20:50:49 +00:00

improve main login performance

This commit is contained in:
astaxie 2013-12-18 23:48:43 +08:00
parent bc0d4ac7cb
commit 7242bc862e

View File

@ -709,9 +709,26 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
if !w.started {
//exec main logic
in := make([]reflect.Value, 0)
method := vc.MethodByName(runMethod)
method.Call(in)
switch runMethod {
case "Get":
execController.Get()
case "Post":
execController.Post()
case "Delete":
execController.Delete()
case "Put":
execController.Put()
case "Head":
execController.Head()
case "Patch":
execController.Patch()
case "Options":
execController.Options()
default:
in := make([]reflect.Value, 0)
method := vc.MethodByName(runMethod)
method.Call(in)
}
//render template
if !w.started && !context.Input.IsWebsocket() {