diff --git a/config/config.go b/config/config.go index ddf0913..b1ffa3a 100644 --- a/config/config.go +++ b/config/config.go @@ -1,9 +1,10 @@ package config import ( + "crypto/rsa" + occe "git.loafle.net/overflow/commons-go/config/external" ogrs "git.loafle.net/overflow/gateway_rest/server" - "crypto/rsa" ) type Config struct { diff --git a/server/server-handler.go b/server/server-handler.go index b860fbb..2d16a0c 100644 --- a/server/server-handler.go +++ b/server/server-handler.go @@ -1,12 +1,12 @@ package server import ( + ccf "git.loafle.net/commons/cors-go/fasthttp" cs "git.loafle.net/commons/server-go" oge "git.loafle.net/overflow/gateway/external" ogrs "git.loafle.net/overflow/gateway_rest/server" "git.loafle.net/overflow/member_gateway_rest/config" "github.com/valyala/fasthttp" - ccf "git.loafle.net/commons/cors-go/fasthttp" ) type ServerHandler interface { @@ -16,7 +16,7 @@ type ServerHandler interface { type ServerHandlers struct { ogrs.ServerHandlers - Config *config.Config + Config *config.Config corsHandler ccf.Cors } diff --git a/server/server.go b/server/server.go index 6dd5261..8f94343 100644 --- a/server/server.go +++ b/server/server.go @@ -14,7 +14,6 @@ func NewServer(_config *config.Config) *cswf.Server { cdr.RegisterResource("VerifyKey", _config.VerifyKey) cdr.RegisterResource("SignKey", _config.SignKey) - services, err := cdr.GetInstancesByAnnotationType(oca.RESTServiceAnnotationType) if nil != err { logging.Logger().Panic(err) diff --git a/service/member-service.go b/service/member-service.go index 11c7a9a..13f5750 100644 --- a/service/member-service.go +++ b/service/member-service.go @@ -16,29 +16,29 @@ import ( "git.loafle.net/overflow/gateway/external/grpc" "github.com/valyala/fasthttp" - "github.com/dgrijalva/jwt-go" "net/url" -) + "github.com/dgrijalva/jwt-go" +) var MemberServiceType = reflect.TypeOf((*MemberService)(nil)) -func init() { +func init() { cdr.RegisterType(MemberServiceType) } type MemberService struct { cda.TypeAnnotation `annotation:"@overflow:RESTService()"` - VerifyKey *rsa.PublicKey `annotation:"@Resource(name='VerifyKey')"` - SignKey *rsa.PrivateKey `annotation:"@Resource(name='SignKey')"` + VerifyKey *rsa.PublicKey `annotation:"@Resource(name='VerifyKey')"` + SignKey *rsa.PrivateKey `annotation:"@Resource(name='SignKey')"` - _Signin cda.MethodAnnotation `annotation:"@overflow:RequestMapping(method='POST', entry='/account/signin', params='[signinID, signinPW]')"` - _SigninByCookie cda.MethodAnnotation `annotation:"@overflow:RequestMapping(method='POST', entry='/account/signin_cookie', params='[authToken]')"` - _Signup cda.MethodAnnotation `annotation:"@overflow:RequestMapping(method='POST', entry='/account/signup', params='[member, pw]')"` - _EmailConfirm cda.MethodAnnotation `annotation:"@overflow:RequestMapping(method='GET', entry='/account/email_confirm', params='[token]')"` - _ForgotPassword cda.MethodAnnotation `annotation:"@overflow:RequestMapping(method='POST', entry='/account/forgot_password', params='[signinID]')"` - _ResetPwConfirm cda.MethodAnnotation `annotation:"@overflow:RequestMapping(method='POST', entry='/account/reset_pw_confirm', params='[pw, key]')"` + _Signin cda.MethodAnnotation `annotation:"@overflow:RequestMapping(method='POST', entry='/account/signin', params='[signinID, signinPW]')"` + _SigninByCookie cda.MethodAnnotation `annotation:"@overflow:RequestMapping(method='POST', entry='/account/signin_cookie', params='[authToken]')"` + _Signup cda.MethodAnnotation `annotation:"@overflow:RequestMapping(method='POST', entry='/account/signup', params='[member, pw]')"` + _EmailConfirm cda.MethodAnnotation `annotation:"@overflow:RequestMapping(method='GET', entry='/account/email_confirm', params='[token]')"` + _ForgotPassword cda.MethodAnnotation `annotation:"@overflow:RequestMapping(method='POST', entry='/account/forgot_password', params='[signinID]')"` + _ResetPwConfirm cda.MethodAnnotation `annotation:"@overflow:RequestMapping(method='POST', entry='/account/reset_pw_confirm', params='[pw, key]')"` } func (ms *MemberService) EmailConfirm(servletCtx server.ServletCtx, ctx *fasthttp.RequestCtx, token string) error { @@ -180,4 +180,4 @@ func (ms *MemberService) ResetPwConfirm(servletCtx server.ServletCtx, ctx *fasth ctx.SetBody([]byte(r)) return nil -} \ No newline at end of file +}