本文整理汇总了Golang中github.com/jsix/gof.Message.Result方法的典型用法代码示例。如果您正苦于以下问题:Golang Message.Result方法的具体用法?Golang Message.Result怎么用?Golang Message.Result使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/jsix/gof.Message
的用法示例。
在下文中一共展示了Message.Result方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Profile_post
func (this *configC) Profile_post(ctx *web.Context) {
partnerId := this.GetPartnerId(ctx)
r, w := ctx.Request, ctx.Response
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_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)
}
示例3: 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)
}
示例4: 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)
}
示例5: 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)
}
示例6: 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)
}
示例7: 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)
}
示例8: 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)
}
示例9: 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)
}
示例10: 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)
}
示例11: 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)
code := ctx.Request.FormValue("invi_code")
if i := strings.Index(ctx.Request.RemoteAddr, ":"); i != -1 {
member.RegIp = ctx.Request.RemoteAddr[:i]
}
var memberId int
var partnerId int
var err error
partnerId = this.GetPartnerId(ctx)
if len(member.Usr) == 0 || len(member.Pwd) == 0 {
result.Message = "1000:注册信息不完整"
ctx.Response.JsonOutput(result)
return
}
if err = dps.PartnerService.CheckRegisterMode(partnerId, code); err != nil {
result.Message = err.Error()
ctx.Response.JsonOutput(result)
return
}
var invId int
if len(code) > 0 {
invId = dps.MemberService.GetMemberIdByInvitationCode(code)
if invId <= 0 {
result.Message = "1011:推荐码不正确"
ctx.Response.JsonOutput(result)
return
}
}
member.Pwd = domain.MemberSha1Pwd(member.Pwd)
memberId, err = dps.MemberService.SaveMember(&member)
if err == nil {
err = dps.MemberService.SaveRelation(memberId, "", invId, partnerId)
}
if err != nil {
result.Message = err.Error()
} else {
result.Result = true
}
ctx.Response.JsonOutput(result)
}
示例12: 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)
}
示例13: 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)
}
示例14: 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)
}
示例15: 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)
}