func (this *accountC) Bank_info_post(ctx *web.Context) { m := this.GetMember(ctx) r := ctx.Request var msg gof.Message r.ParseForm() e := new(member.BankInfo) web.ParseFormToEntity(r.Form, e) e.MemberId = m.Id err := dps.MemberService.SaveBankInfo(e) if err != nil { msg.Message = err.Error() } else { msg.Result = true } ctx.Response.JsonOutput(msg) }
func (this *accountC) ApplyCash_post(ctx *web.Context) { m := this.GetMember(ctx) r, w := ctx.Request, ctx.ResponseWriter var result gof.Message r.ParseForm() e := new(member.BankInfo) web.ParseFormToEntity(r.Form, e) e.MemberId = m.Id err := goclient.Member.SaveBankInfo(m.Id, m.DynamicToken, e) if err != nil { result = gof.Message{Result: false, Message: err.Error()} } else { result = gof.Message{Result: true} } w.Write(result.Marshal()) }
func (this *Member) SaveBankInfo(m *jsv.Args, r *jsv.Result) error { memberId, err := Verify(m) if err != nil { return err } var e member.BankInfo err = jsv.UnmarshalMap((*m)["json"], &e) if err != nil { return err } e.MemberId = memberId err = dps.MemberService.SaveBankInfo(&e) if err != nil { jsv.LogErr(err) return err } else { r.Result = true } return nil }