package values import ( "fmt" "math/rand" "server/pb" "server/util" ) func PackPay(r *pb.InnerRechargeReq) { if len(r.Name) == 0 { // r.Name = randName() r.Name = util.GenerateRandomString(5) } r.Phone = util.CheckPhone(r.Phone) if len(r.Email) == 0 { r.Email = util.GetSimpleRandomString(5) + "@" + "gmail.com" } if r.IP == "" { r.IP = fmt.Sprintf("%d.%d.%d.%d", rand.Intn(255), rand.Intn(255), rand.Intn(255), rand.Intn(255)) } } func PackWithdraw(r *pb.InnerWithdrawReq) { if len(r.Name) == 0 { r.Name = randName() } r.Phone = util.CheckPhone(r.Phone) if len(r.Email) == 0 { r.Email = util.GetSimpleRandomString(5) + "@" + "gmail.com" } if len(r.Address) == 0 { r.Address = "SaoPaulo" } } func randName() string { return util.GenerateRandomString(5) }