improve main login performance
Showing
1 changed file
with
17 additions
and
0 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 | switch runMethod { | ||
| 713 | case "Get": | ||
| 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: | ||
| 712 | in := make([]reflect.Value, 0) | 728 | in := make([]reflect.Value, 0) |
| 713 | method := vc.MethodByName(runMethod) | 729 | method := vc.MethodByName(runMethod) |
| 714 | method.Call(in) | 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() { | ... | ... |
-
Please register or sign in to post a comment