overflow_server_app/module/member/check_email.go

28 lines
495 B
Go
Raw Permalink Normal View History

2017-08-23 09:19:21 +00:00
package member
import (
2017-11-23 08:06:44 +00:00
"context"
2017-08-23 09:19:21 +00:00
"fmt"
2017-09-05 06:37:33 +00:00
"net/url"
2017-08-23 09:19:21 +00:00
2017-11-23 08:06:44 +00:00
"git.loafle.net/overflow/overflow_server_app/external/grpc"
2017-08-23 09:19:21 +00:00
"github.com/valyala/fasthttp"
)
2017-09-05 06:37:33 +00:00
func CheckEmail(ctx *fasthttp.RequestCtx) {
2017-08-30 03:21:59 +00:00
key := string(ctx.FormValue("key"))
params := []string{url.QueryEscape(key)}
2017-11-23 08:06:44 +00:00
gRPCCtx := context.Background()
r, err := grpc.Exec(gRPCCtx, "EmailAuthService.readByAuthKey", params)
2017-08-30 03:21:59 +00:00
if err != nil {
fmt.Fprintf(ctx, "Error!!!!: %s\n", err)
}
2017-08-30 03:22:37 +00:00
fmt.Fprintf(ctx, "Email Check!!!!: %s\n", r)
2017-08-24 08:37:08 +00:00
2017-08-23 09:19:21 +00:00
}