diff --git a/module/member/modify.go b/module/member/modify.go new file mode 100644 index 0000000..036b302 --- /dev/null +++ b/module/member/modify.go @@ -0,0 +1,38 @@ +package member + +import ( + "fmt" + + "git.loafle.net/overflow/overflow_server_app/backend" + "git.loafle.net/overflow/overflow_server_app/server" + "github.com/valyala/fasthttp" + "encoding/json" +) + +func Modify(sctx *server.ServerContext, ctx *fasthttp.RequestCtx) { + grpcPool := sctx.Value("grpc").(backend.Pool) + fmt.Fprintf(ctx, "avail: %d\n", grpcPool.Available()) + c, err := grpcPool.Get() + if nil != err { + + } + defer c.Close() + + fmt.Fprintf(ctx, "avail: %d\n", grpcPool.Available()) + + m := &Member{} + m.Id = string(ctx.FormValue("id")) + 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", "modify", params) + + fmt.Fprintf(ctx, "Welcome!!!!: %s\n", r) + +} \ No newline at end of file