本文整理汇总了Golang中go2o/src/core/domain/interface/promotion.IPromotion.GetAggregateRootId方法的典型用法代码示例。如果您正苦于以下问题:Golang IPromotion.GetAggregateRootId方法的具体用法?Golang IPromotion.GetAggregateRootId怎么用?Golang IPromotion.GetAggregateRootId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类go2o/src/core/domain/interface/promotion.IPromotion
的用法示例。
在下文中一共展示了IPromotion.GetAggregateRootId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: DeletePromotion
func DeletePromotion(p promotion.IPromotion) error {
var err error
var rep promotion.IPromotionRep = nil
if p.Type() == promotion.TypeFlagCashBack {
v := p.(*CashBackPromotion)
rep = v._promRep
err = rep.DeleteValueCashBack(v.GetAggregateRootId())
} else if p.Type() == promotion.TypeFlagCoupon {
v := p.(*Coupon)
rep = v._promRep
err = rep.DeleteValueCoupon(v.GetAggregateRootId())
}
if err == nil && rep != nil {
err = rep.DeletePromotion(p.GetAggregateRootId())
}
return err
}
示例2: bindPromotionOnSubmit
func (this *Order) bindPromotionOnSubmit(orderNo string, prom promotion.IPromotion) (int, error) {
var title string
var integral int
var fee int
//todo: 需要重构,其他促销
if prom.Type() == promotion.TypeFlagCashBack {
fee = prom.GetRelationValue().(*promotion.ValueCashBack).BackFee
title = prom.TypeName() + ":" + prom.GetValue().ShortName
}
v := &shopping.OrderPromotionBind{
PromotionId: prom.GetAggregateRootId(),
PromotionType: prom.Type(),
OrderNo: orderNo,
Title: title,
SaveFee: float32(fee),
PresentIntegral: integral,
IsConfirm: 1,
IsApply: 0,
}
return this._shoppingRep.SavePromotionBindForOrder(v)
}