overflow_server_app/module/member/check_email.go
2017-08-30 12:22:37 +09:00

38 lines
716 B
Go

package member
import (
"fmt"
"git.loafle.net/overflow/overflow_server_app/server"
"github.com/valyala/fasthttp"
"git.loafle.net/overflow/overflow_server_app/backend"
"net/url"
)
func CheckEmail(sctx *server.ServerContext, ctx *fasthttp.RequestCtx) {
//msg := sctx.Value("key1")
grpcPool := sctx.Value("grpc").(backend.Pool)
c, err := grpcPool.Get()
if nil != err {
}
defer c.Close()
fmt.Fprintf(ctx, "avail: %d\n", grpcPool.Available())
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)
}
fmt.Fprintf(ctx, "Email Check!!!!: %s\n", r)
}