diff --git a/main.go b/main.go index 6a8e7a3..e93f718 100644 --- a/main.go +++ b/main.go @@ -20,7 +20,7 @@ func main() { InitCapacity: 2, MaxCapacity: 4, Dial: func() (*grpc.ClientConn, error) { - return grpc.Dial("192.168.1.101:50006", grpc.WithInsecure()) + return grpc.Dial("192.168.1.103:13234", grpc.WithInsecure()) }, NewClient: func(conn *grpc.ClientConn) (interface{}, error) { return grpcAPI.NewOverflowApiServerClient(conn), nil @@ -49,8 +49,11 @@ func main() { s.Route("POST", "/account/signin", member.SignIn) s.Route("POST", "/account/signup", member.SignUp) + s.Route("POST", "/account/modify", member.Modify) + s.Route("POST", "/account/read", member.SignUp) + s.Route("POST", "/account/pw_confirm", member.ConfirmPW) s.Route("POST", "/account/forgot_password", member.ForgotPassword) - s.Route("POST", "/account/check_email", member.CheckEmail) + s.Route("GET", "/account/check_email", member.CheckEmail) fasthttp.ListenAndServe(":19080", s.Handler) } diff --git a/module/member/check_email.go b/module/member/check_email.go index 9683a0f..3dd02a0 100644 --- a/module/member/check_email.go +++ b/module/member/check_email.go @@ -7,6 +7,7 @@ import ( "github.com/valyala/fasthttp" "git.loafle.net/overflow/overflow_server_app/backend" + "net/url" ) func CheckEmail(sctx *server.ServerContext, ctx *fasthttp.RequestCtx) { @@ -21,10 +22,16 @@ func CheckEmail(sctx *server.ServerContext, ctx *fasthttp.RequestCtx) { fmt.Fprintf(ctx, "avail: %d\n", grpcPool.Available()) - signinId := string(ctx.FormValue("signinId")) - params := []string{signinId} + key := string(ctx.FormValue("key")) + + params := []string{url.QueryEscape(key)} + + r, err := c.Exec("EmailAuthService", "readByAuthKey", params) + + if err != nil { + fmt.Fprintf(ctx, "Error!!!!: %s\n", err) + } + - r, err := c.Exec("MemberService", "read", params) - fmt.Fprintf(ctx, "Welcome!!!!: %s \n", r) }