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

Merge remote-tracking branch 'origin/master'

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