本文整理汇总了Golang中github.com/jsix/gof/net/jsv.Result.Result方法的典型用法代码示例。如果您正苦于以下问题:Golang Result.Result方法的具体用法?Golang Result.Result怎么用?Golang Result.Result使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/jsix/gof/net/jsv.Result
的用法示例。
在下文中一共展示了Result.Result方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: RegisterMember
func (this *Partner) RegisterMember(m *jsv.Args, r *jsv.Result) error {
var err error
e := member.ValueMember{}
if err = jsv.UnmarshalMap((*m)["json"], &e); err != nil {
return err
}
var cardId string
var tgId int
var partnerId int
cardId = (*m)["card_id"].(string)
tgId, _ = strconv.Atoi((*m)["tg_id"].(string))
partnerId, _ = strconv.Atoi((*m)["partner_id"].(string))
//如果卡片ID为空时,自动生成
if cardId == "" {
cardId = time.Now().Format("200601021504")
}
e.RegFrom = "WEB"
e.Pwd = domain.MemberSha1Pwd(e.Pwd)
id, err := dps.MemberService.SaveMember(&e)
if err == nil {
dps.MemberService.SaveRelation(id, cardId, tgId, partnerId)
r.Result = true
return nil
}
return err
}
示例2: Verify
func (this *Member) Verify(m *jsv.Args, r *jsv.Result) error {
_, err := Verify(m)
if err != nil {
r.Message = err.Error()
} else {
r.Result = true
}
return nil
}
示例3: CheckUsrExist
func (this *Partner) CheckUsrExist(m *jsv.Args, r *jsv.Result) error {
_, err, _ := VerifyPartner(m)
if err != nil {
return err
}
r.Result = true
r.Data = dps.MemberService.CheckUsr((*m)["usr"].(string), 0)
return nil
}
示例4: GetDeliverAddrs
func (this *Member) GetDeliverAddrs(m *jsv.Args, r *jsv.Result) error {
memberId, err := Verify(m)
if err != nil {
return err
}
r.Result = true
r.Data = dps.MemberService.GetDeliverAddress(memberId)
return nil
}
示例5: GetHost
func (this *Partner) GetHost(m *jsv.Args, r *jsv.Result) error {
partnerId, err := strconv.Atoi((*m)["partner_id"].(string))
if err != nil {
return err
}
host := dps.PartnerService.GetPartnerMajorHost(partnerId)
r.Data = host
r.Result = true
return nil
}
示例6: GetPartner
func (this *Partner) GetPartner(m *jsv.Args, r *jsv.Result) error {
return nil
_, err, e := VerifyPartner(m)
if err != nil {
return err
}
r.Result = true
r.Data = e
return nil
}
示例7: GetSiteConf
func (this *Partner) GetSiteConf(m *jsv.Args, r *jsv.Result) error {
partnerId, err, _ := VerifyPartner(m)
if err != nil {
return err
}
siteConf := dps.PartnerService.GetSiteConf(partnerId)
r.Result = true
r.Data = siteConf
return nil
}
示例8: Category
func (this *Partner) Category(m *jsv.Args, r *jsv.Result) error {
partnerId, err, _ := VerifyPartner(m)
if err != nil {
return err
}
categories := dps.SaleService.GetCategories(partnerId)
r.Result = true
r.Data = categories
return nil
}
示例9: GetBankInfo
func (this *Member) GetBankInfo(m *jsv.Args, r *jsv.Result) error {
memberId, err := Verify(m)
if err != nil {
return err
}
e := dps.MemberService.GetBank(memberId)
if e != nil {
r.Data = e
r.Result = true
}
return nil
}
示例10: GetShops
func (this *Partner) GetShops(m *jsv.Args, r *jsv.Result) error {
partnerId, err, _ := VerifyPartner(m)
if err != nil {
return err
}
shops := dps.PartnerService.GetShopsOfPartner(partnerId)
r.Result = true
r.Data = shops
return nil
}
示例11: GetDeliverAddrById
func (this *Member) GetDeliverAddrById(m *jsv.Args, r *jsv.Result) error {
memberId, err := Verify(m)
if err != nil {
return err
}
addrId, err := strconv.Atoi((*m)["addr_id"].(string))
if err != nil {
return err
}
r.Result = true
r.Data = dps.MemberService.GetDeliverAddressById(memberId, addrId)
return nil
}
示例12: GetItems
func (this *Partner) GetItems(m *jsv.Args, r *jsv.Result) error {
partnerId, err, _ := VerifyPartner(m)
if err != nil {
return err
}
cid, _ := strconv.Atoi((*m)["cid"].(string))
num, _ := strconv.Atoi((*m)["num"].(string))
_, items := dps.SaleService.GetPagedOnShelvesGoods(partnerId, cid, 0, num, "")
r.Result = true
r.Data = items
return nil
}
示例13: SubmitOrder
// 需要传递配送地址
func (this *Partner) SubmitOrder(m *jsv.Args, r *jsv.Result) error {
partnerId, err, _ := VerifyPartner(m)
if err != nil {
return err
}
memberId, _ := strconv.Atoi((*m)["member_id"].(string))
couponCode := (*m)["coupon_code"].(string)
orderNo, err := dps.ShoppingService.SubmitOrder(partnerId, memberId, couponCode, true)
if err != nil {
return err
} else {
r.Result = true
r.Data = orderNo
}
return nil
}
示例14: DeleteDeliverAddr
func (this *Member) DeleteDeliverAddr(m *jsv.Args, r *jsv.Result) error {
memberId, err := Verify(m)
if err != nil {
return err
}
addrId, err := strconv.Atoi((*m)["addr_id"].(string))
if err != nil {
return err
}
if err = dps.MemberService.DeleteDeliverAddress(memberId, addrId); err == nil {
r.Result = true
} else {
r.Data = err.Error()
}
return nil
}
示例15: SaveBankInfo
func (this *Member) SaveBankInfo(m *jsv.Args, r *jsv.Result) error {
memberId, err := Verify(m)
if err != nil {
return err
}
var e member.BankInfo
err = jsv.UnmarshalMap((*m)["json"], &e)
if err != nil {
return err
}
e.MemberId = memberId
err = dps.MemberService.SaveBankInfo(&e)
if err != nil {
jsv.LogErr(err)
return err
} else {
r.Result = true
}
return nil
}