当前位置: 首页>>代码示例>>Golang>>正文


Golang gof.Message类代码示例

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


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


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