本文整理汇总了Golang中go2o/src/core/domain/interface/partner.ValuePartner.Id方法的典型用法代码示例。如果您正苦于以下问题:Golang ValuePartner.Id方法的具体用法?Golang ValuePartner.Id怎么用?Golang ValuePartner.Id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类go2o/src/core/domain/interface/partner.ValuePartner
的用法示例。
在下文中一共展示了ValuePartner.Id方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: SavePartner
func (this *partnerService) SavePartner(partnerId int, v *partner.ValuePartner) (int, error) {
var pt partner.IPartner
var err error
var isCreate bool
v.Id = partnerId
if partnerId > 0 {
pt, _ = this._partnerRep.GetPartner(partnerId)
if pt == nil {
err = errors.New("no such partner")
} else {
err = pt.SetValue(v)
}
} else {
isCreate = true
pt, err = this._partnerRep.CreatePartner(v)
}
if err != nil {
return 0, err
}
partnerId, err = pt.Save()
if isCreate {
this.initializePartner(partnerId)
}
return partnerId, err
}
示例2: Profile_post
func (this *configC) Profile_post(ctx *web.Context) {
partnerId := this.GetPartnerId(ctx)
r, w := ctx.Request, ctx.ResponseWriter
var result gof.Message
r.ParseForm()
e := partner.ValuePartner{}
web.ParseFormToEntity(r.Form, &e)
//更新
origin, _ := dps.PartnerService.GetPartner(partnerId)
e.ExpiresTime = origin.ExpiresTime
e.JoinTime = origin.JoinTime
e.LastLoginTime = origin.LastLoginTime
e.LoginTime = origin.LoginTime
e.Pwd = origin.Pwd
e.UpdateTime = time.Now().Unix()
e.Id = partnerId
id, err := dps.PartnerService.SavePartner(partnerId, &e)
if err != nil {
result.Message = err.Error()
} else {
result.Result = true
result.Data = id
}
w.Write(result.Marshal())
}
示例3: SavePartner
func (this *partnerService) SavePartner(partnerId int, v *partner.ValuePartner) (int, error) {
var pt partner.IPartner
var err error
v.Id = partnerId
if partnerId > 0 {
pt, _ = this._partnerRep.GetPartner(partnerId)
if pt == nil {
err = errors.New("no such partner")
} else {
err = pt.SetValue(v)
}
} else {
pt, err = this._partnerRep.CreatePartner(v)
}
if err != nil {
return 0, err
}
return pt.Save()
}