提交 e9c860fc authored 作者: 屈传平's avatar 屈传平

Merge branch 'featrue/hdh'

...@@ -2,7 +2,7 @@ package hdh ...@@ -2,7 +2,7 @@ package hdh
import ( import (
"context" "context"
"encoding/json" "github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/net/ghttp" "github.com/gogf/gf/net/ghttp"
) )
...@@ -214,7 +214,10 @@ func GetGoodsList(ctx context.Context, req *GoodsListReq) (res *GoodsListRes, er ...@@ -214,7 +214,10 @@ func GetGoodsList(ctx context.Context, req *GoodsListReq) (res *GoodsListRes, er
if nil != err { if nil != err {
return return
} }
err = json.Unmarshal([]byte(result), &res) //err = json.Unmarshal([]byte(result), &res)
err = gjson.NewWithOptions([]byte(result), gjson.Options{
StrNumber: true,
}).Scan(&res)
return return
} }
...@@ -225,7 +228,10 @@ func GetGoodsInfo(ctx context.Context, req *GoodsInfoReq) (res *GoodsInfoRes, er ...@@ -225,7 +228,10 @@ func GetGoodsInfo(ctx context.Context, req *GoodsInfoReq) (res *GoodsInfoRes, er
if nil != err { if nil != err {
return return
} }
err = json.Unmarshal([]byte(result), &res) //err = json.Unmarshal([]byte(result), &res)
err = gjson.NewWithOptions([]byte(result), gjson.Options{
StrNumber: true,
}).Scan(&res)
return return
} }
...@@ -235,6 +241,9 @@ func GoodsCallBack(r *ghttp.Request) (res *GoodsNotifyRes, err error) { ...@@ -235,6 +241,9 @@ func GoodsCallBack(r *ghttp.Request) (res *GoodsNotifyRes, err error) {
if nil != err { if nil != err {
return return
} }
err = json.Unmarshal([]byte(body), &res) //err = json.Unmarshal([]byte(body), &res)
err = gjson.NewWithOptions([]byte(body), gjson.Options{
StrNumber: true,
}).Scan(&res)
return return
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论