Commit 42c2ea56 by mushishixian

调试

parent a08b7ca2
Showing with 3 additions and 0 deletions
......@@ -90,6 +90,7 @@ func main() {
goodsIdsStr := strings.Join(goodsIds, ",")
//去请求商品服务
resp, _ := req.Get(util.Configs.Api_domain.GoodsUrl + "?goods_id=" + goodsIdsStr)
fmt.Println(resp.String())
//先判断返回的data是不是字典,不是字典代表可能是返回字符串了
if gjson.Get(resp.String(), "data").IsObject() {
for goodsIdKey, data := range gjson.Get(resp.String(), "data").Map() {
......@@ -131,6 +132,8 @@ func main() {
panic(err)
}
}
}else{
fmt.Println("商品服务获取数据为空")
}
return nil
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment