diff --git a/service/eastiot/app.go b/service/eastiot/app.go index 7d2ac717..c37c7db7 100644 --- a/service/eastiot/app.go +++ b/service/eastiot/app.go @@ -2,6 +2,7 @@ package eastiot import ( "errors" + "fmt" "go.uber.org/zap" "gopkg.in/dtapps/go-library.v3/utils/gohttp" "net/http" @@ -26,7 +27,7 @@ func (app *App) request(url string, params map[string]interface{}, method string get, err := gohttp.Get(url, params) // 日志 if app.ZapLog != nil { - app.ZapLog.Sugar().Info(get) + app.ZapLog.Sugar().Info(fmt.Sprintf("%s", get.Body)) } return get.Body, err case http.MethodPost: @@ -34,7 +35,7 @@ func (app *App) request(url string, params map[string]interface{}, method string postJson, err := gohttp.PostForm(url, params) // 日志 if app.ZapLog != nil { - app.ZapLog.Sugar().Info(postJson) + app.ZapLog.Sugar().Info(fmt.Sprintf("%s", postJson.Body)) } return postJson.Body, err default: diff --git a/service/ejiaofei/app.go b/service/ejiaofei/app.go index d9b35be9..82801e88 100644 --- a/service/ejiaofei/app.go +++ b/service/ejiaofei/app.go @@ -29,7 +29,7 @@ func (app *App) request(url string, params map[string]interface{}, method string get, err := gohttp.Get(url, params) // 日志 if app.ZapLog != nil { - app.ZapLog.Sugar().Info(get) + app.ZapLog.Sugar().Info(fmt.Sprintf("%s", get.Body)) } return get.Body, err case http.MethodPost: @@ -37,7 +37,7 @@ func (app *App) request(url string, params map[string]interface{}, method string postJson, err := gohttp.PostForm(url, params) // 日志 if app.ZapLog != nil { - app.ZapLog.Sugar().Info(postJson) + app.ZapLog.Sugar().Info(fmt.Sprintf("%s", postJson.Body)) } return postJson.Body, err default: diff --git a/service/jd/app.go b/service/jd/app.go index 02c6f75f..4ff3b84b 100644 --- a/service/jd/app.go +++ b/service/jd/app.go @@ -2,6 +2,7 @@ package jd import ( "encoding/json" + "fmt" "go.uber.org/zap" "gopkg.in/dtapps/go-library.v3/utils/gohttp" ) @@ -22,15 +23,15 @@ func (app *App) request(params map[string]interface{}) (resp []byte, err error) // 签名 app.Sign(params) // 发送请求 - httpGet, err := gohttp.PostForm("https://api.jd.com/routerjson", params) + get, err := gohttp.PostForm("https://api.jd.com/routerjson", params) // 日志 if app.ZapLog != nil { - app.ZapLog.Sugar().Info(httpGet) + app.ZapLog.Sugar().Info(fmt.Sprintf("%s", get.Body)) } // 检查错误 var errResp ErrResp - _ = json.Unmarshal(httpGet.Body, &errResp) - return httpGet.Body, err + _ = json.Unmarshal(get.Body, &errResp) + return get.Body, err } // GoodsPriceToInt64 商品券后价 diff --git a/service/kashangwl/app.go b/service/kashangwl/app.go index 1de708cd..d4f5d1ff 100644 --- a/service/kashangwl/app.go +++ b/service/kashangwl/app.go @@ -2,6 +2,7 @@ package kashangwl import ( "encoding/json" + "fmt" "go.uber.org/zap" "gopkg.in/dtapps/go-library.v3/utils/gohttp" "time" @@ -26,7 +27,7 @@ func (app *App) request(url string, params map[string]interface{}) ([]byte, erro postJson, err := gohttp.PostJson(url, paramsStr) // 日志 if app.ZapLog != nil { - app.ZapLog.Sugar().Info(postJson.Body) + app.ZapLog.Sugar().Info(fmt.Sprintf("%s", postJson.Body)) } return postJson.Body, err } diff --git a/service/meituan/app.go b/service/meituan/app.go index 69a1091e..415d1189 100644 --- a/service/meituan/app.go +++ b/service/meituan/app.go @@ -3,6 +3,7 @@ package meituan import ( "encoding/json" "errors" + "fmt" "go.uber.org/zap" "gopkg.in/dtapps/go-library.v3/utils/gohttp" "net/http" @@ -31,7 +32,7 @@ func (app *App) request(url string, params map[string]interface{}, method string postJson, err := gohttp.PostJson(url, paramsStr) // 日志 if app.ZapLog != nil { - app.ZapLog.Sugar().Info(postJson) + app.ZapLog.Sugar().Info(fmt.Sprintf("%s", postJson.Body)) } return postJson.Body, err default: diff --git a/service/pinduoduo/app.go b/service/pinduoduo/app.go index 4836c243..68935d10 100644 --- a/service/pinduoduo/app.go +++ b/service/pinduoduo/app.go @@ -38,15 +38,15 @@ func (app *App) request(params map[string]interface{}) (resp []byte, err error) // 签名 app.Sign(params) // 发送请求 - httpGet, err := gohttp.Get("https://gw-api.pinduoduo.com/api/router", params) + get, err := gohttp.Get("https://gw-api.pinduoduo.com/api/router", params) // 日志 if app.ZapLog != nil { - app.ZapLog.Sugar().Info(httpGet) + app.ZapLog.Sugar().Info(fmt.Sprintf("%s", get.Body)) } // 检查错误 var errResp ErrResp - _ = json.Unmarshal(httpGet.Body, &errResp) - return httpGet.Body, err + _ = json.Unmarshal(get.Body, &errResp) + return get.Body, err } func (app *App) SalesTipParseInt64(salesTip string) int64 { diff --git a/service/pintoto/app.go b/service/pintoto/app.go index ebf476d3..40e0ceeb 100644 --- a/service/pintoto/app.go +++ b/service/pintoto/app.go @@ -56,7 +56,7 @@ func (app *App) request(url string, params map[string]interface{}) ([]byte, erro // 日志 if app.ZapLog != nil { - app.ZapLog.Sugar().Info(response.Body) + app.ZapLog.Sugar().Info(fmt.Sprintf("%s", body)) } // 检查错误 diff --git a/service/taobao/app.go b/service/taobao/app.go index 03cfa845..d2120e80 100644 --- a/service/taobao/app.go +++ b/service/taobao/app.go @@ -30,15 +30,15 @@ func (app *App) request(params map[string]interface{}) (resp []byte, err error) // 签名 app.Sign(params) // 发送请求 - httpGet, err := gohttp.Get("https://eco.taobao.com/router/rest", params) + get, err := gohttp.Get("https://eco.taobao.com/router/rest", params) // 日志 if app.ZapLog != nil { - app.ZapLog.Sugar().Info(httpGet) + app.ZapLog.Sugar().Info(fmt.Sprintf("%s", get.Body)) } // 检查错误 var errResp ErrResp - _ = json.Unmarshal(httpGet.Body, &errResp) - return httpGet.Body, err + _ = json.Unmarshal(get.Body, &errResp) + return get.Body, err } func (app *App) ZkFinalPriceParseInt64(ZkFinalPrice string) int64 { diff --git a/service/wechatmp/app.go b/service/wechatmp/app.go index 196551b2..ef568768 100644 --- a/service/wechatmp/app.go +++ b/service/wechatmp/app.go @@ -3,6 +3,7 @@ package wechatmp import ( "bytes" "encoding/json" + "fmt" "go.uber.org/zap" "io/ioutil" "net/http" @@ -40,7 +41,7 @@ func (app *App) request(url string, params map[string]interface{}, method string // 日志 if app.ZapLog != nil { - app.ZapLog.Sugar().Info(response.Body) + app.ZapLog.Sugar().Info(fmt.Sprintf("%s", resp)) } // 检查请求错误 diff --git a/service/wechatpayapiv3/app.go b/service/wechatpayapiv3/app.go index 7dac82b3..7c1698a3 100644 --- a/service/wechatpayapiv3/app.go +++ b/service/wechatpayapiv3/app.go @@ -3,6 +3,7 @@ package wechatpayapiv3 import ( "bytes" "encoding/json" + "fmt" "go.uber.org/zap" "gopkg.in/dtapps/go-library.v3/utils/gorequest" "io/ioutil" @@ -73,7 +74,7 @@ func (app *App) request(url string, params map[string]interface{}, method string // 日志 if app.ZapLog != nil { - app.ZapLog.Sugar().Info(result) + app.ZapLog.Sugar().Info(fmt.Sprintf("%s", resp)) } // 检查请求错误 diff --git a/service/wechatqy/app.go b/service/wechatqy/app.go index f474f5bc..6240a6de 100644 --- a/service/wechatqy/app.go +++ b/service/wechatqy/app.go @@ -2,6 +2,7 @@ package wechatqy import ( "encoding/json" + "fmt" "go.uber.org/zap" "gopkg.in/dtapps/go-library.v3/utils/gohttp" ) @@ -18,7 +19,7 @@ func (app *App) request(url string, params map[string]interface{}) (body []byte, postJson, err := gohttp.PostJson(url, paramsStr) // 日志 if app.ZapLog != nil { - app.ZapLog.Sugar().Info(postJson) + app.ZapLog.Sugar().Info(fmt.Sprintf("%s", postJson.Body)) } return postJson.Body, err } diff --git a/service/wechatunion/app.go b/service/wechatunion/app.go index e666167e..e95b02d9 100644 --- a/service/wechatunion/app.go +++ b/service/wechatunion/app.go @@ -2,6 +2,7 @@ package wechatunion import ( "encoding/json" + "fmt" "go.uber.org/zap" "gopkg.in/dtapps/go-library.v3/utils/gohttp" "net/http" @@ -28,7 +29,7 @@ func (app *App) request(url string, params map[string]interface{}, method string postJson, err := gohttp.PostJson(url, paramsStr) // 日志 if app.ZapLog != nil { - app.ZapLog.Sugar().Info(postJson) + app.ZapLog.Sugar().Info(fmt.Sprintf("%s", postJson.Body)) } return postJson.Body, err } diff --git a/service/wikeyun/app.go b/service/wikeyun/app.go index d90727e4..780bae14 100644 --- a/service/wikeyun/app.go +++ b/service/wikeyun/app.go @@ -22,7 +22,7 @@ func (app *App) request(url string, params map[string]interface{}) (resp []byte, postForm, err := gohttp.PostForm(requestUrl, params) // 日志 if app.ZapLog != nil { - app.ZapLog.Sugar().Info(postForm) + app.ZapLog.Sugar().Info(fmt.Sprintf("%s", postForm.Body)) } return postForm.Body, err }