overflow_server_app/module/member/check_email.go

38 lines
671 B
Go
Raw Normal View History

2017-08-23 09:19:21 +00:00
package member
import (
"fmt"
"git.loafle.net/overflow/overflow_server_app/server"
"github.com/valyala/fasthttp"
2017-08-24 08:37:08 +00:00
"git.loafle.net/overflow/overflow_server_app/backend"
2017-08-30 03:21:59 +00:00
"net/url"
2017-08-23 09:19:21 +00:00
)
func CheckEmail(sctx *server.ServerContext, ctx *fasthttp.RequestCtx) {
2017-08-24 08:37:08 +00:00
//msg := sctx.Value("key1")
2017-08-23 09:19:21 +00:00
2017-08-24 08:37:08 +00:00
grpcPool := sctx.Value("grpc").(backend.Pool)
c, err := grpcPool.Get()
if nil != err {
2017-08-23 09:19:21 +00:00
2017-08-24 08:37:08 +00:00
}
defer c.Close()
fmt.Fprintf(ctx, "avail: %d\n", grpcPool.Available())
2017-08-30 03:21:59 +00:00
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)
}
2017-08-24 08:37:08 +00:00
2017-08-23 09:19:21 +00:00
}