7242bc86 by astaxie

improve main login performance

1 parent bc0d4ac7
Showing 1 changed file with 20 additions and 3 deletions
...@@ -709,9 +709,26 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) ...@@ -709,9 +709,26 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
709 709
710 if !w.started { 710 if !w.started {
711 //exec main logic 711 //exec main logic
712 in := make([]reflect.Value, 0) 712 switch runMethod {
713 method := vc.MethodByName(runMethod) 713 case "Get":
714 method.Call(in) 714 execController.Get()
715 case "Post":
716 execController.Post()
717 case "Delete":
718 execController.Delete()
719 case "Put":
720 execController.Put()
721 case "Head":
722 execController.Head()
723 case "Patch":
724 execController.Patch()
725 case "Options":
726 execController.Options()
727 default:
728 in := make([]reflect.Value, 0)
729 method := vc.MethodByName(runMethod)
730 method.Call(in)
731 }
715 732
716 //render template 733 //render template
717 if !w.started && !context.Input.IsWebsocket() { 734 if !w.started && !context.Input.IsWebsocket() {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!