本文整理汇总了Golang中github.com/atnet/gof.Message.Data方法的典型用法代码示例。如果您正苦于以下问题:Golang Message.Data方法的具体用法?Golang Message.Data怎么用?Golang Message.Data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/atnet/gof.Message
的用法示例。
在下文中一共展示了Message.Data方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: 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())
}
示例2: Save_coupon_post
// 保存优惠券
func (this *promC) Save_coupon_post(ctx *web.Context) {
partnerId := this.GetPartnerId(ctx)
r := ctx.Request
r.ParseForm()
var result gof.Message
e := promotion.ValuePromotion{}
web.ParseFormToEntity(r.Form, &e)
e2 := promotion.ValueCoupon{}
web.ParseFormToEntity(r.Form, &e2)
e.PartnerId = partnerId
e.TypeFlag = promotion.TypeFlagCoupon
const layout string = "2006-01-02 15:04:05"
bt, _ := time.Parse(layout, r.FormValue("BeginTime"))
ot, _ := time.Parse(layout, r.FormValue("OverTime"))
e2.BeginTime = bt.Unix()
e2.OverTime = ot.Unix()
id, err := dps.PromService.SaveCoupon(partnerId, &e, &e2)
if err != nil {
result.Message = err.Error()
} else {
result.Result = true
result.Data = id
}
ctx.Response.JsonOutput(result)
}
示例3: Save_cb_post
// 保存现金返现
func (this *promC) Save_cb_post(ctx *web.Context) {
partnerId := this.GetPartnerId(ctx)
r := ctx.Request
r.ParseForm()
var result gof.Message
e := promotion.ValuePromotion{}
web.ParseFormToEntity(r.Form, &e)
e2 := promotion.ValueCashBack{}
web.ParseFormToEntity(r.Form, &e2)
e.PartnerId = partnerId
e.TypeFlag = promotion.TypeFlagCashBack
id, err := dps.PromService.SaveCashBackPromotion(partnerId, &e, &e2)
if err != nil {
result.Message = err.Error()
} else {
result.Result = true
result.Data = id
}
ctx.Response.JsonOutput(result)
}
示例4: CreatePartner_post
func (c *partnerC) CreatePartner_post(ctx *web.Context) {
r, w := ctx.Request, ctx.ResponseWriter
var result gof.Message
var isCreate bool
r.ParseForm()
partner := partner.ValuePartner{}
web.ParseFormToEntity(r.Form, &partner)
dt := time.Now()
anousPwd := strings.Repeat("*", 10) //匿名密码
if len(partner.Pwd) != 0 && partner.Pwd != anousPwd {
partner.Pwd = domain.Md5PartnerPwd(partner.Usr, partner.Pwd)
}
//更新
if partner.Id > 0 {
original, _ := dps.PartnerService.GetPartner(partner.Id)
partner.JoinTime = original.JoinTime
partner.ExpiresTime = original.ExpiresTime
partner.UpdateTime = dt.Unix()
if partner.Pwd == anousPwd {
partner.Pwd = original.Pwd
}
} else {
partner.JoinTime = dt.Unix()
partner.ExpiresTime = dt.AddDate(10, 0, 0).Unix()
partner.UpdateTime = dt.Unix()
isCreate = true
}
id, err := dps.PartnerService.SavePartner(partner.Id, &partner)
if err != nil {
result.Message = err.Error()
} else {
result.Data = id
result.Result = true
if isCreate {
// 初始化商户信息
dps.PartnerService.InitDefaultLevels(id) // 初始化等级
dps.SaleService.InitSaleTags(id) // 初始化销售标签
}
}
w.Write(result.Marshal())
}
示例5: SaveMLevel_post
func (this *memberC) SaveMLevel_post(ctx *web.Context) {
partnerId := this.GetPartnerId(ctx)
r := ctx.Request
var result gof.Message
r.ParseForm()
e := valueobject.MemberLevel{}
web.ParseFormToEntity(r.Form, &e)
e.PartnerId = this.GetPartnerId(ctx)
id, err := dps.PartnerService.SaveMemberLevel(partnerId, &e)
if err != nil {
result.Message = err.Error()
} else {
result.Result = true
result.Data = id
}
ctx.Response.JsonOutput(result)
}
示例6: SaveSTag_post
func (this *saleC) SaveSTag_post(ctx *web.Context) {
partnerId := this.GetPartnerId(ctx)
r := ctx.Request
var result gof.Message
r.ParseForm()
e := sale.ValueSaleTag{}
web.ParseFormToEntity(r.Form, &e)
e.PartnerId = this.GetPartnerId(ctx)
id, err := dps.SaleService.SaveSaleTag(partnerId, &e)
if err != nil {
result.Message = err.Error()
} else {
result.Result = true
result.Data = id
}
this.JsonOutput(ctx, result)
}
示例7: SaveImage_post
func (this *adC) SaveImage_post(ctx *web.Context) {
partnerId := this.GetPartnerId(ctx)
r := ctx.Request
r.ParseForm()
var result gof.Message
e := ad.ValueImage{}
web.ParseFormToEntity(r.Form, &e)
id, err := dps.AdvertisementService.SaveImage(partnerId, e.AdvertisementId, &e)
if err != nil {
result.Message = err.Error()
} else {
result.Result = true
result.Data = id
}
ctx.Response.JsonOutput(result)
}
示例8: Save_mail_tpl_post
// 保存邮件模板
func (this *mssC) Save_mail_tpl_post(ctx *web.Context) {
partnerId := this.GetPartnerId(ctx)
r := ctx.Request
r.ParseForm()
var result gof.Message
e := mss.MailTemplate{}
web.ParseFormToEntity(r.Form, &e)
//更新
e.PartnerId = partnerId
id, err := dps.PartnerService.SaveMailTemplate(partnerId, &e)
if err != nil {
result.Message = err.Error()
} else {
result.Result = true
result.Data = id
}
ctx.Response.JsonOutput(result)
}
示例9: SaveAd_post
func (this *adC) SaveAd_post(ctx *web.Context) {
partnerId := this.GetPartnerId(ctx)
r := ctx.Request
r.ParseForm()
var result gof.Message
e := ad.ValueAdvertisement{}
web.ParseFormToEntity(r.Form, &e)
//更新
e.PartnerId = partnerId
id, err := dps.AdvertisementService.SaveAdvertisement(partnerId, &e)
if err != nil {
result.Message = err.Error()
} else {
result.Result = true
result.Data = id
}
this.ResultOutput(ctx, result)
}
示例10: SavePage_post
func (this *contentC) SavePage_post(ctx *web.Context) {
partnerId := this.GetPartnerId(ctx)
r := ctx.Request
r.ParseForm()
var result gof.Message
e := content.ValuePage{}
web.ParseFormToEntity(r.Form, &e)
//更新
e.UpdateTime = time.Now().Unix()
e.PartnerId = partnerId
id, err := dps.ContentService.SavePage(partnerId, &e)
if err != nil {
result.Message = err.Error()
} else {
result.Result = true
result.Data = id
}
ctx.Response.JsonOutput(result)
}