check email

This commit is contained in:
geek 2017-08-30 12:21:59 +09:00
parent bff1fdc9e7
commit cf7fc2de04
2 changed files with 16 additions and 6 deletions

View File

@ -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)
}

View File

@ -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)
}