• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Golang gof.Message类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中github.com/jsix/gof.Message的典型用法代码示例。如果您正苦于以下问题:Golang Message类的具体用法?Golang Message怎么用?Golang Message使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Message类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。

示例1: 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)
}
开发者ID:zoe527,项目名称:go2o,代码行数:26,代码来源:prom_c.go


示例2: Transfer_f2m_post

func (this *accountC) Transfer_f2m_post(ctx *web.Context) {
	var msg gof.Message
	var err error
	ctx.Request.ParseForm()
	form := ctx.Request.Form
	partnerId := this.GetPartner(ctx).Id
	toMemberId, _ := strconv.Atoi(form.Get("ToId"))
	amount, _ := strconv.ParseFloat(form.Get("Amount"), 32)
	tradePwd := form.Get("TradePwd")
	saleConf := dps.PartnerService.GetSaleConf(partnerId)
	memberId := this.GetMember(ctx).Id

	if toMemberId == memberId {
		err = errors.New("无法转账到自己账号")
	} else {
		if _, err = dps.MemberService.VerifyTradePwd(memberId, tradePwd); err == nil {
			err = dps.MemberService.TransferFlowTo(memberId, toMemberId, member.KindBalanceFlow,
				float32(amount), saleConf.TransCsn, domain.NewTradeNo(partnerId),
				variable.AliasFlowAccount+"转账", "转入"+variable.AliasFlowAccount)
		}
	}

	if err != nil {
		msg.Message = err.Error()
	} else {
		msg.Result = true
	}
	ctx.Response.JsonOutput(msg)
}
开发者ID:zoe527,项目名称:go2o,代码行数:29,代码来源:account_c.go


示例3: Charge_post

func (this *memberC) Charge_post(ctx *web.Context) {
	var msg gof.Message
	var err error
	ctx.Request.ParseForm()
	partnerId := this.GetPartnerId(ctx)
	memberId, _ := strconv.Atoi(ctx.Request.FormValue("MemberId"))
	amount, _ := strconv.ParseFloat(ctx.Request.FormValue("Amount"), 32)
	if amount < 0 {
		msg.Message = "error amount"
	} else {
		rel := dps.MemberService.GetRelation(memberId)

		if rel.RegisterPartnerId != this.GetPartnerId(ctx) {
			err = partner.ErrPartnerNotMatch
		} else {
			title := fmt.Sprintf("客服充值%f", amount)
			err = dps.MemberService.Charge(partnerId, memberId, member.TypeBalanceServiceCharge, title, "", float32(amount))
		}
		if err != nil {
			msg.Message = err.Error()
		} else {
			msg.Result = true
		}
	}
	ctx.Response.JsonOutput(msg)
}
开发者ID:zoe527,项目名称:go2o,代码行数:26,代码来源:member_c.go


示例4: 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)
}
开发者ID:zoe527,项目名称:go2o,代码行数:32,代码来源:prom_c.go


示例5: 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)
}
开发者ID:jackyan,项目名称:go2o,代码行数:31,代码来源:user_c.go


示例6: Convert_f2p_post

func (this *accountC) Convert_f2p_post(ctx *web.Context) {
	var msg gof.Message
	var err error
	ctx.Request.ParseForm()
	partnerId := this.GetPartner(ctx).Id
	amount, _ := strconv.ParseFloat(ctx.Request.FormValue("Amount"), 32)
	tradePwd := ctx.Request.FormValue("TradePwd")
	saleConf := dps.PartnerService.GetSaleConf(partnerId)

	memberId := this.GetMember(ctx).Id

	if _, err = dps.MemberService.VerifyTradePwd(memberId, tradePwd); err == nil {
		err = dps.MemberService.TransferFlow(memberId, member.KindBalancePresent,
			float32(amount), saleConf.FlowConvertCsn, domain.NewTradeNo(partnerId),
			fmt.Sprintf("%s转换", variable.AliasFlowAccount),
			fmt.Sprintf("%s转换%s", variable.AliasFlowAccount, variable.AliasPresentAccount))
	}

	if err != nil {
		msg.Message = err.Error()
	} else {
		msg.Result = true
	}
	ctx.Response.JsonOutput(msg)
}
开发者ID:zoe527,项目名称:go2o,代码行数:25,代码来源:account_c.go


示例7: Disconnect

// 断开
func (this *MemberC) Disconnect(ctx *echox.Context) error {
	var result gof.Message
	if util.MemberHttpSessionDisconnect(ctx) {
		result.Result = true
	} else {
		result.Message = "disconnect fail"
	}
	return ctx.JSON(http.StatusOK, result)
}
开发者ID:yonglehou,项目名称:go2o,代码行数:10,代码来源:member_c.go


示例8: 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)
}
开发者ID:jackyan,项目名称:go2o,代码行数:10,代码来源:member_c.go


示例9: Lock_member_post

// 锁定会员
func (this *memberC) Lock_member_post(ctx *web.Context) {
	ctx.Request.ParseForm()
	id, _ := strconv.Atoi(ctx.Request.FormValue("id"))
	partnerId := this.GetPartnerId(ctx)
	var result gof.Message
	if _, err := dps.MemberService.LockMember(partnerId, id); err != nil {
		result.Message = err.Error()
	} else {
		result.Result = true
	}
	ctx.Response.JsonOutput(result)
}
开发者ID:zoe527,项目名称:go2o,代码行数:13,代码来源:member_c.go


示例10: Valid_invitation_post

func (this *UserC) Valid_invitation_post(ctx *web.Context) {
	var result gof.Message = gof.Message{Result: true}
	ctx.Request.ParseForm()
	code := ctx.Request.FormValue("invi_code")
	if len(code) > 0 {
		memberId := dps.MemberService.GetMemberIdByInvitationCode(code)
		if memberId <= 0 {
			result.Result = false
			result.Message = "推荐人无效"
		}
	}
	ctx.Response.JsonOutput(result)
}
开发者ID:zoe527,项目名称:go2o,代码行数:13,代码来源:user_c.go


示例11: 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)
}
开发者ID:jackyan,项目名称:go2o,代码行数:13,代码来源:user_c.go


示例12: 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)
}
开发者ID:jackyan,项目名称:go2o,代码行数:13,代码来源:user_c.go


示例13: cart_RemoveItem

func (this *CartC) cart_RemoveItem(ctx *web.Context,
	p *partner.ValuePartner, memberId int, cartKey string) {
	var msg 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 {
		msg.Message = err.Error()
	} else {
		msg.Result = true
	}
	this.BaseC.ResultOutput(ctx, msg)
}
开发者ID:zoe527,项目名称:go2o,代码行数:14,代码来源:cart_c.go


示例14: Reset_pwd_post

func (this *memberC) Reset_pwd_post(ctx *web.Context) {
	var result gof.Message
	ctx.Request.ParseForm()
	memberId, _ := strconv.Atoi(ctx.Request.FormValue("member_id"))
	rl := dps.MemberService.GetRelation(memberId)
	partnerId := this.GetPartnerId(ctx)
	if rl == nil || rl.RegisterPartnerId != partnerId {
		result.Message = "无权进行当前操作"
	} else {
		newPwd := dps.MemberService.ResetPassword(memberId)
		result.Result = true
		result.Message = fmt.Sprintf("重置成功,新密码为: %s", newPwd)
	}
	ctx.Response.JsonOutput(result)
}
开发者ID:zoe527,项目名称:go2o,代码行数:15,代码来源:member_c.go


示例15: 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)
}
开发者ID:zoe527,项目名称:go2o,代码行数:15,代码来源:basic_c.go


示例16: DelCategory_post

func (this *categoryC) DelCategory_post(ctx *web.Context) {
	partnerId := this.GetPartnerId(ctx)
	r, w := ctx.Request, ctx.Response
	var result gof.Message
	r.ParseForm()
	categoryId, _ := strconv.Atoi(r.Form.Get("id"))

	//删除分类
	err := dps.SaleService.DeleteCategory(partnerId, categoryId)
	if err != nil {
		result = gof.Message{Result: false, Message: err.Error()}
	} else {
		result = gof.Message{Result: true, Message: ""}
	}
	w.Write(result.Marshal())
}
开发者ID:zoe527,项目名称:go2o,代码行数:16,代码来源:category_c.go


示例17: 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)
}
开发者ID:zoe527,项目名称:go2o,代码行数:16,代码来源:goods_c.go


示例18: 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)
}
开发者ID:zoe527,项目名称:go2o,代码行数:16,代码来源:basic_c.go


示例19: 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)
}
开发者ID:zoe527,项目名称:go2o,代码行数:17,代码来源:mss_c.go


示例20: Back_apply_req_post

func (this *memberC) Back_apply_req_post(ctx *web.Context) {
	var msg gof.Message
	ctx.Request.ParseForm()
	form := ctx.Request.Form
	partnerId := this.GetPartnerId(ctx)
	memberId, _ := strconv.Atoi(form.Get("MemberId"))
	id, _ := strconv.Atoi(form.Get("Id"))

	err := dps.MemberService.ConfirmApplyCash(partnerId, memberId, id, false, "")
	if err != nil {
		msg.Message = err.Error()
	} else {
		msg.Result = true
	}
	ctx.Response.JsonOutput(msg)
}
开发者ID:zoe527,项目名称:go2o,代码行数:16,代码来源:member_c.go



注:本文中的github.com/jsix/gof.Message类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang gof.Storage类代码示例发布时间:2022-05-23
下一篇:
Golang gof.Config类代码示例发布时间:2022-05-23
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap