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

hdh

上级 36e2bf4d
......@@ -2,7 +2,7 @@ package hdh
import (
"context"
"encoding/json"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/net/ghttp"
)
......@@ -212,7 +212,10 @@ func GetGoodsList(ctx context.Context, req *GoodsListReq) (res *GoodsListRes, er
if nil != err {
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
}
......@@ -223,7 +226,10 @@ func GetGoodsInfo(ctx context.Context, req *GoodsInfoReq) (res *GoodsInfoRes, er
if nil != err {
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
}
......@@ -233,6 +239,9 @@ func GoodsCallBack(r *ghttp.Request) (res *GoodsNotifyRes, err error) {
if nil != err {
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
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论