modify
This commit is contained in:
parent
6b891496b1
commit
bff1fdc9e7
38
module/member/modify.go
Normal file
38
module/member/modify.go
Normal file
|
@ -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)
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user