本文整理汇总了Golang中go2o/src/core/domain/interface/member.DeliverAddress.MemberId方法的典型用法代码示例。如果您正苦于以下问题:Golang DeliverAddress.MemberId方法的具体用法?Golang DeliverAddress.MemberId怎么用?Golang DeliverAddress.MemberId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类go2o/src/core/domain/interface/member.DeliverAddress
的用法示例。
在下文中一共展示了DeliverAddress.MemberId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: SaveDeliver_post
func (this *basicC) SaveDeliver_post(ctx *web.Context) {
m := this.GetMember(ctx)
r := ctx.Request
r.ParseForm()
var e member.DeliverAddress
web.ParseFormToEntity(r.Form, &e)
e.MemberId = m.Id
_, err := dps.MemberService.SaveDeliverAddress(m.Id, &e)
if err != nil {
this.resultOutput(ctx, gof.Message{Result: false, Message: err.Error()})
} else {
this.resultOutput(ctx, gof.Message{Result: true})
}
}
示例2: SaveDeliver_post
func (this *basicC) SaveDeliver_post(ctx *web.Context) {
m := this.GetMember(ctx)
var result gof.Message
r := ctx.Request
r.ParseForm()
var e member.DeliverAddress
web.ParseFormToEntity(r.Form, &e)
e.MemberId = m.Id
_, err := dps.MemberService.SaveDeliverAddress(m.Id, &e)
if err != nil {
result.Message = err.Error()
} else {
result.Result = true
}
ctx.Response.JsonOutput(result)
}
示例3: SaveDeliver_post
func (this *basicC) SaveDeliver_post(ctx *web.Context) {
m := this.GetMember(ctx)
w, r := ctx.ResponseWriter, ctx.Request
r.ParseForm()
var e member.DeliverAddress
web.ParseFormToEntity(r.Form, &e)
e.MemberId = m.Id
b, err := goclient.Member.SaveDeliverAddr(m.Id, m.DynamicToken, &e)
if err == nil {
if b {
w.Write([]byte(`{"result":true}`))
} else {
w.Write([]byte(`{"result":false}`))
}
} else {
w.Write([]byte(fmt.Sprintf(`{"result":false,"message":"%s"}`, err.Error())))
}
}
示例4: SaveDeliverAddr_post
func (this *ShoppingC) SaveDeliverAddr_post(ctx *web.Context) {
if !this.prepare(ctx) {
return
}
m := this.GetMember(ctx)
r, w := ctx.Request, ctx.ResponseWriter
r.ParseForm()
var e member.DeliverAddress
web.ParseFormToEntity(r.Form, &e)
e.MemberId = m.Id
b, err := dps.MemberService.SaveDeliverAddress(m.Id, &e)
if err == nil {
if b > 0 {
w.Write([]byte(`{"result":true}`))
} else {
w.Write([]byte(`{"result":false}`))
}
} else {
w.Write([]byte(fmt.Sprintf(`{"result":false,"message":"%s"}`, err.Error())))
}
}
示例5: SaveDeliverAddr
func (this *Member) SaveDeliverAddr(m *jsv.Args, r *jsv.Result) error {
memberId, err := Verify(m)
if err != nil {
return err
}
var e member.DeliverAddress
err = jsv.UnmarshalMap((*m)["json"], &e)
if err != nil {
return err
}
e.MemberId = memberId
_, err = dps.MemberService.SaveDeliverAddress(memberId, &e)
if err != nil {
jsv.LogErr(err)
r.Message = err.Error()
} else {
r.Result = true
}
return nil
}