This commit is contained in:
geek 2017-08-24 15:06:09 +09:00
parent cdd1f00d01
commit 272f3e503d

View File

@ -5,12 +5,39 @@ import (
"git.loafle.net/overflow/overflow_server_app/server" "git.loafle.net/overflow/overflow_server_app/server"
"git.loafle.net/overflow/overflow_server_app/backend"
"github.com/valyala/fasthttp" "github.com/valyala/fasthttp"
"encoding/json"
) )
func SignUp(sctx *server.ServerContext, ctx *fasthttp.RequestCtx) { type Member struct {
msg := sctx.Value("key1") Id string `json:"id"`
Email string `json:"email"`
fmt.Fprintf(ctx, "Welcome!: %s \n", msg) Pw string `json:"pw"`
Name string `json:"name"`
CompanyName string `json:"companyName"`
Phone string `json:"phone"`
}
func SignUp(sctx *server.ServerContext, ctx *fasthttp.RequestCtx) {
grpcPool := sctx.Value("grpc").(backend.Pool)
c, err := grpcPool.Get()
if nil != err {
}
defer c.Close()
m := &Member{}
m.Email = string(ctx.FormValue("email"))
m.Name = string(ctx.FormValue("name"))
m.CompanyName = string(ctx.FormValue("companyName"))
m.Phone = string(ctx.FormValue("phone"))
m.Pw = string(ctx.FormValue("pw"))
mm,_ := json.Marshal(m)
params := []string{string(mm), string(m.Pw)}
r, err := c.Exec("MemberService", "signup", params)
fmt.Fprintf(ctx, "Welcome!!!!: %s\n", r)
} }