提交 7a474ad2 authored 作者: 张立波's avatar 张立波

Merge remote-tracking branch 'origin/master'

......@@ -19,7 +19,7 @@ type AddressRes struct {
SnId string `json:"snId"`
}
func (s *hcwClient) Address(ctx context.Context, req *AddressReq) (res []*AddressRes, err error) {
func (s *HcwClient) Address(ctx context.Context, req *AddressReq) (res []*AddressRes, err error) {
var method = "/address"
result, err := s.get(ctx, method, req)
if nil != err {
......
......@@ -71,6 +71,16 @@ type GoodsDetailRes struct {
Status int `json:"status"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
Sku struct {
ProductNo string `json:"product_no"`
SkuNo string `json:"sku_no"`
Model string `json:"model"`
Name string `json:"name"`
Value string `json:"value"`
Image string `json:"image"`
Stock int `json:"stock"`
Price int `json:"price"`
} `json:"sku"`
} `json:"data"`
}
......
......@@ -2,7 +2,9 @@ package yonghui
import (
"context"
"encoding/json"
"github.com/gogf/gf/encoding/gjson"
"strings"
)
var Msg = new(msg)
......@@ -21,10 +23,10 @@ type MsgPullRes struct {
Code string `json:"code"`
Message string `json:"message"`
Data []struct {
Id int64 `json:"id"`
Type string `json:"type"`
CreateTime string `json:"createTime"`
MessageInfo string `json:"messageInfo"`
Id json.Number `json:"id"`
Type int `json:"type"`
CreateTime string `json:"createTime"`
MessageInfo string `json:"messageInfo"`
} `json:"data"`
}
......@@ -99,7 +101,9 @@ func (s *msg) Pull(ctx context.Context, req *MsgPullReq) (res *MsgPullRes, err e
if nil != err {
return
}
err = gjson.New(result).Scan(&res)
decoder := json.NewDecoder(strings.NewReader(result))
decoder.UseNumber()
decoder.Decode(&res)
return
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论