本文整理汇总了Golang中go2o/src/core/domain/interface/partner.IPartner.GetShop方法的典型用法代码示例。如果您正苦于以下问题:Golang IPartner.GetShop方法的具体用法?Golang IPartner.GetShop怎么用?Golang IPartner.GetShop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类go2o/src/core/domain/interface/partner.IPartner
的用法示例。
在下文中一共展示了IPartner.GetShop方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: GetSettleData
// 获取结算数据
func (this *Cart) GetSettleData() (s partner.IShop, d member.IDeliver, paymentOpt, deliverOpt int) {
var err error
if this.value.ShopId > 0 && this._shop == nil {
var pt partner.IPartner
pt, err = this.partnerRep.GetPartner(this.partnerId)
if err == nil {
this._shop = pt.GetShop(this.value.ShopId)
}
}
if this.value.DeliverId > 0 && this._deliver == nil {
var m member.IMember
m, err = this.memberRep.GetMember(this.value.BuyerId)
if err == nil {
this._deliver = m.GetDeliver(this.value.DeliverId)
}
}
return this._shop, this._deliver, this.value.PaymentOpt, this.value.DeliverOpt
}
示例2: SettlePersist
// 结算数据持久化
func (this *Cart) SettlePersist(shopId, paymentOpt, deliverOpt, deliverId int) error {
var shop partner.IShop
var deliver member.IDeliver
var err error
if shopId > 0 {
var pt partner.IPartner
pt, err = this._partnerRep.GetPartner(this._partnerId)
if err != nil {
return err
}
shop = pt.GetShop(shopId)
if shop == nil {
return partner.ErrNoSuchShop
}
this._shop = shop
this._value.ShopId = shopId
}
if this._value.BuyerId > 0 && deliverId > 0 {
var m member.IMember
m, err = this._memberRep.GetMember(this._value.BuyerId)
if err != nil {
return err
}
deliver = m.GetDeliver(deliverId)
fmt.Println("-----", m.GetAggregateRootId(), deliverId)
if deliver == nil {
return member.ErrInvalidSession
}
this._deliver = deliver
this._value.DeliverId = deliverId
}
this._value.PaymentOpt = paymentOpt
this._value.DeliverOpt = deliverOpt
return nil
}