本文整理汇总了Golang中github.com/jrsix/gof.Message类的典型用法代码示例。如果您正苦于以下问题:Golang Message类的具体用法?Golang Message怎么用?Golang Message使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Message类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: 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)
}
示例2: PostRegisterInfo_post
func (this *UserC) PostRegisterInfo_post(ctx *web.Context) {
ctx.Request.ParseForm()
var result gof.Message
var member member.ValueMember
web.ParseFormToEntity(ctx.Request.Form, &member)
if i := strings.Index(ctx.Request.RemoteAddr, ":"); i != -1 {
member.RegIp = ctx.Request.RemoteAddr[:i]
}
var memberId int
var err error
if len(member.Usr) == 0 || len(member.Pwd) == 0 {
err = errors.New("注册信息不完整")
} else {
member.Pwd = domain.MemberSha1Pwd(member.Pwd)
memberId, err = dps.MemberService.SaveMember(&member)
if err == nil {
invId := dps.MemberService.GetMemberIdByInvitationCode(ctx.Request.FormValue("invi_code"))
err = dps.MemberService.SaveRelation(memberId, "", invId,
this.BaseC.GetPartnerId(ctx))
}
}
if err != nil {
result.Message = err.Error()
} else {
result.Result = true
}
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: Disconnect
// 断开
func (this *MemberC) Disconnect(ctx *web.Context) {
var result gof.Message
if util.MemberHttpSessionDisconnect(ctx) {
result.Result = true
} else {
result.Message = "disconnect fail"
}
ctx.Response.JsonOutput(result)
}
示例5: Valid_invitation_post
func (this *UserC) Valid_invitation_post(ctx *web.Context) {
ctx.Request.ParseForm()
memberId := dps.MemberService.GetMemberIdByInvitationCode(
ctx.Request.FormValue("invi_code"))
var result gof.Message
result.Result = memberId != 0
if !result.Result {
result.Message = "推荐人无效"
}
ctx.Response.JsonOutput(result)
}
示例6: ValidUsr_post
func (this *UserC) ValidUsr_post(ctx *web.Context) {
r := ctx.Request
var msg gof.Message
r.ParseForm()
usr := r.FormValue("usr")
err := dps.MemberService.CheckUsr(usr, 0)
if err == nil {
msg.Result = true
} else {
msg.Message = err.Error()
}
ctx.Response.JsonOutput(msg)
}
示例7: cart_RemoveItem
func (this *CartC) cart_RemoveItem(ctx *web.Context,
p *partner.ValuePartner, memberId int, cartKey string) {
var result gof.Message
r := ctx.Request
goodsId, _ := strconv.Atoi(r.FormValue("id"))
num, _ := strconv.Atoi(r.FormValue("num"))
err := dps.ShoppingService.SubCartItem(p.Id, memberId, cartKey, goodsId, num)
if err != nil {
result.Message = err.Error()
} else {
result.Result = true
}
ctx.Response.JsonOutput(result)
}
示例8: DeleteDeliver_post
func (this *basicC) DeleteDeliver_post(ctx *web.Context) {
r := ctx.Request
var result gof.Message
m := this.GetMember(ctx)
r.ParseForm()
id, _ := strconv.Atoi(r.FormValue("id"))
err := dps.MemberService.DeleteDeliverAddress(m.Id, id)
if err != nil {
result.Message = err.Error()
} else {
result.Result = true
}
ctx.Response.JsonOutput(result)
}
示例9: Del_mail_tpl_post
// 删除邮件模板
func (this *mssC) Del_mail_tpl_post(ctx *web.Context) {
ctx.Request.ParseForm()
form := ctx.Request.Form
var result gof.Message
partnerId := this.GetPartnerId(ctx)
adId, _ := strconv.Atoi(form.Get("id"))
err := dps.PartnerService.DeleteMailTemplate(partnerId, adId)
if err != nil {
result.Message = err.Error()
} else {
result.Result = true
}
ctx.Response.JsonOutput(result)
}
示例10: 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)
}
示例11: Del_item_post
func (this *goodsC) Del_item_post(ctx *web.Context) {
partnerId := this.GetPartnerId(ctx)
r := ctx.Request
var result gof.Message
r.ParseForm()
id, _ := strconv.Atoi(r.FormValue("id"))
err := dps.SaleService.DeleteItem(partnerId, id)
if err != nil {
result.Message = err.Error()
} else {
result.Result = true
}
ctx.Response.JsonOutput(result)
}
示例12: Del_post
func (this *goodsC) Del_post(ctx *web.Context) {
partnerId := this.GetPartnerId(ctx)
r, w := ctx.Request, ctx.Response
var result gof.Message
r.ParseForm()
id, _ := strconv.Atoi(r.FormValue("id"))
err := dps.SaleService.DeleteGoods(partnerId, id)
if err != nil {
result = gof.Message{Result: true, Message: err.Error()}
} else {
result = gof.Message{Result: true, Message: "", Data: id}
}
w.Write(result.Marshal())
}
示例13: Del_post
// 删除促销
func (this *promC) Del_post(ctx *web.Context) {
ctx.Request.ParseForm()
form := ctx.Request.Form
var result gof.Message
partnerId := this.GetPartnerId(ctx)
promId, _ := strconv.Atoi(form.Get("id"))
err := dps.PromService.DelPromotion(partnerId, promId)
if err != nil {
result.Message = err.Error()
} else {
result.Result = true
}
ctx.Response.JsonOutput(result)
}
示例14: Bank_info_post
func (this *accountC) Bank_info_post(ctx *web.Context) {
m := this.GetMember(ctx)
r := ctx.Request
var msg gof.Message
r.ParseForm()
e := new(member.BankInfo)
web.ParseFormToEntity(r.Form, e)
e.MemberId = m.Id
err := dps.MemberService.SaveBankInfo(e)
if err != nil {
msg.Message = err.Error()
} else {
msg.Result = true
}
ctx.Response.JsonOutput(msg)
}
示例15: SaveArea_post
func (this *coverageAreaC) SaveArea_post(ctx *web.Context) {
r, w := ctx.Request, ctx.Response
var result gof.Message
r.ParseForm()
coverageArea := delivery.CoverageValue{}
web.ParseFormToEntity(r.Form, &coverageArea)
id, err := dps.DeliverService.CreateCoverageArea(&coverageArea)
if err != nil {
result = gof.Message{Result: true, Message: err.Error()}
} else {
result = gof.Message{Result: true, Message: "", Data: id}
}
w.Write(result.Marshal())
}