From 36a4d42bb881a9d51d874d61510cd741f4bb14d7 Mon Sep 17 00:00:00 2001 From: crusader Date: Tue, 10 Apr 2018 22:19:20 +0900 Subject: [PATCH] ing --- servlet/rest-servlet.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/servlet/rest-servlet.go b/servlet/rest-servlet.go index 63796c9..eb6c4c5 100644 --- a/servlet/rest-servlet.go +++ b/servlet/rest-servlet.go @@ -27,17 +27,17 @@ type RESTServlet interface { type RESTServlets struct { cswf.Servlets - RESTRegistry crr.RESTRegistry + restRegistry crr.RESTRegistry - MethodMapping map[string]map[string]*MethodMapping + methodMapping map[string]map[string]*MethodMapping } func (s *RESTServlets) Init(serverCtx server.ServerCtx) error { if err := s.Servlets.Init(serverCtx); nil != err { return err } - if nil == s.MethodMapping { - s.MethodMapping = make(map[string]map[string]*MethodMapping) + if nil == s.methodMapping { + s.methodMapping = make(map[string]map[string]*MethodMapping) } return nil @@ -47,7 +47,7 @@ func (s *RESTServlets) Handle(servletCtx server.ServletCtx, ctx *fasthttp.Reques method := string(ctx.Method()) path := string(ctx.Path()) - es, ok := s.MethodMapping[method] + es, ok := s.methodMapping[method] if !ok { return csw.NewError(fasthttp.StatusNotFound, fmt.Errorf("Not Found for [%s]%s", method, path)) } @@ -83,7 +83,7 @@ func (s *RESTServlets) HandleGet(servletCtx server.ServletCtx, ctx *fasthttp.Req } } - _, err := s.RESTRegistry.Invoke(mapping.Method, params, servletCtx, ctx) + _, err := s.restRegistry.Invoke(mapping.Method, params, servletCtx, ctx) if nil != err { return csw.NewError(fasthttp.StatusInternalServerError, err) @@ -109,7 +109,7 @@ func (s *RESTServlets) HandlePost(servletCtx server.ServletCtx, ctx *fasthttp.Re } } - _, err := s.RESTRegistry.Invoke(mapping.Method, params, servletCtx, ctx) + _, err := s.restRegistry.Invoke(mapping.Method, params, servletCtx, ctx) if nil != err { return csw.NewError(fasthttp.StatusInternalServerError, err) @@ -123,8 +123,8 @@ func (s *RESTServlets) RegisterRESTServices(services []interface{}) error { return nil } - s.MethodMapping = make(map[string]map[string]*MethodMapping) - s.RESTRegistry = crr.NewRESTRegistry() + s.methodMapping = make(map[string]map[string]*MethodMapping) + s.restRegistry = crr.NewRESTRegistry() LOOP: for _, service := range services { @@ -133,7 +133,7 @@ LOOP: if nil == ta { return fmt.Errorf("Service[%s] is not RESTService, use @RESTService", t.Elem().Name()) } - s.RESTRegistry.RegisterService(service, "") + s.restRegistry.RegisterService(service, "") mas := cdr.GetMethodAnnotations(t, oca.RequestMappingAnnotationType) if nil == mas || 0 == len(mas) { @@ -142,10 +142,10 @@ LOOP: for methodName, v := range mas { ma := v.(*oca.RequestMappingAnnotation) - mm, ok := s.MethodMapping[ma.Method] + mm, ok := s.methodMapping[ma.Method] if !ok { mm = make(map[string]*MethodMapping) - s.MethodMapping[ma.Method] = mm + s.methodMapping[ma.Method] = mm } _, ok = mm[ma.Entry]