master
李光春 1 year ago
parent abcb9cdce0
commit e440a5dccb

@ -6,11 +6,11 @@ require (
github.com/MercuryEngineering/CookieMonster v0.0.0-20180304172713-1584578b3403
github.com/aliyun/aliyun-oss-go-sdk v2.2.7+incompatible
github.com/allegro/bigcache/v3 v3.1.0
github.com/baidubce/bce-sdk-go v0.9.149
github.com/baidubce/bce-sdk-go v0.9.150
github.com/basgys/goxml2json v1.1.0
github.com/bytedance/sonic v1.8.8
github.com/gin-gonic/gin v1.9.0
github.com/go-co-op/gocron v1.26.0
github.com/go-co-op/gocron v1.27.0
github.com/go-playground/locales v0.14.1
github.com/go-playground/universal-translator v0.18.1
github.com/go-playground/validator/v10 v10.13.0
@ -33,6 +33,7 @@ require (
go.mongodb.org/mongo-driver v1.11.6
go.uber.org/zap v1.24.0
golang.org/x/crypto v0.9.0
golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea
golang.org/x/text v0.9.0
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
gorm.io/datatypes v1.2.0
@ -72,7 +73,7 @@ require (
github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/montanaflynn/stats v0.7.0 // indirect
github.com/montanaflynn/stats v0.7.1 // indirect
github.com/mozillazg/go-httpheader v0.3.1 // indirect
github.com/oschwald/maxminddb-golang v1.10.0 // indirect
github.com/pelletier/go-toml/v2 v2.0.7 // indirect

@ -32,8 +32,8 @@ github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6l
github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU=
github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g=
github.com/baidubce/bce-sdk-go v0.9.149 h1:vsV/Ic+sjPQDCKVQisxJmRjJwZP/DTZUIf5IfNFb2EA=
github.com/baidubce/bce-sdk-go v0.9.149/go.mod h1:zbYJMQwE4IZuyrJiFO8tO8NbtYiKTFTbwh4eIsqjVdg=
github.com/baidubce/bce-sdk-go v0.9.150 h1:8IC7hfvSi2P2WqitUbJUNnGcd8+5edVUZQkMKpHetd0=
github.com/baidubce/bce-sdk-go v0.9.150/go.mod h1:zbYJMQwE4IZuyrJiFO8tO8NbtYiKTFTbwh4eIsqjVdg=
github.com/basgys/goxml2json v1.1.0 h1:4ln5i4rseYfXNd86lGEB+Vi652IsIXIvggKM/BhUKVw=
github.com/basgys/goxml2json v1.1.0/go.mod h1:wH7a5Np/Q4QoECFIU8zTQlZwZkrilY0itPfecMw41Dw=
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
@ -106,8 +106,8 @@ github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
github.com/gin-gonic/gin v1.9.0 h1:OjyFBKICoexlu99ctXNR2gg+c5pKrKMuyjgARg9qeY8=
github.com/gin-gonic/gin v1.9.0/go.mod h1:W1Me9+hsUSyj3CePGrd1/QrKJMSJ1Tu/0hFEH89961k=
github.com/go-co-op/gocron v1.26.0 h1:dbX2xdy8tRE2o02PYhtYmK8WCBL8j7tVn/qgETBLL1g=
github.com/go-co-op/gocron v1.26.0/go.mod h1:JHrQDY4iE1HZPkgTyoccY4xtDgLbrUwL+xODIbEQdnc=
github.com/go-co-op/gocron v1.27.0 h1:GbP9A0wauIeGbMCUzdGb2IAi1JHzNHT/H/lLW2ODwLE=
github.com/go-co-op/gocron v1.27.0/go.mod h1:39f6KNSGVOU1LO/ZOoZfcSxwlsJDQOKSu8erN0SH48Y=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o=
@ -375,8 +375,8 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
github.com/montanaflynn/stats v0.7.0 h1:r3y12KyNxj/Sb/iOE46ws+3mS1+MZca1wlHQFPsY/JU=
github.com/montanaflynn/stats v0.7.0/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
github.com/montanaflynn/stats v0.7.1 h1:etflOAAHORrCC44V+aR6Ftzort912ZU+YLiSTuV8eaE=
github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
github.com/mozillazg/go-httpheader v0.2.1/go.mod h1:jJ8xECTlalr6ValeXYdOF8fFUISeBAdw6E61aqQma60=
github.com/mozillazg/go-httpheader v0.3.1 h1:IRP+HFrMX2SlwY9riuio7raffXUpzAosHtZu25BSJok=
github.com/mozillazg/go-httpheader v0.3.1/go.mod h1:PuT8h0pw6efvp8ZeUec1Rs7dwjK08bt6gKSReGMqtdA=
@ -464,6 +464,7 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg=
github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o=
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU=
github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc=
@ -575,6 +576,7 @@ go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI=
@ -616,6 +618,8 @@ golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58
golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g=
golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea h1:vLCWI/yYrdEHyN2JzIzPO3aaQJHQdp89IZBA/+azVC4=
golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=

@ -1,5 +1,5 @@
package go_library
func Version() string {
return "1.0.140"
return "1.0.141"
}

@ -34,6 +34,10 @@ type Client struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
zap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
}
// NewClient 创建实例化

@ -10,3 +10,12 @@ func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun) {
c.log.status = true
}
}
// ConfigZapClientFun 日志配置
func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun) {
apiZapLog := apiZapLogFun()
if apiZapLog != nil {
c.zap.client = apiZapLog
c.zap.status = true
}
}

@ -2,7 +2,6 @@ package alipayopen
import (
"context"
"github.com/dtapps/go-library"
"github.com/dtapps/go-library/utils/gorequest"
"github.com/dtapps/go-library/utils/gostring"
)
@ -21,9 +20,6 @@ func (c *Client) request(ctx context.Context, param map[string]interface{}) (gor
// 设置用户代理
client.SetUserAgent(gorequest.GetRandomUserAgentSystem())
// 传入SDk版本
client.AfferentSdkUserVersion(go_library.Version())
// 发起请求
request, err := client.Get(ctx)
if err != nil {
@ -32,7 +28,10 @@ func (c *Client) request(ctx context.Context, param map[string]interface{}) (gor
// 记录日志
if c.log.status {
go c.log.client.MiddlewareCustom(ctx, gostring.ToString(params["method"]), request, go_library.Version())
go c.log.client.MiddlewareCustom(ctx, gostring.ToString(params["method"]), request)
}
if c.zap.status {
go c.zap.client.MiddlewareCustom(ctx, gostring.ToString(params["method"]), request)
}
return request, err

@ -20,6 +20,10 @@ type Client struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
zap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
}
// NewClient 创建实例化

@ -10,3 +10,12 @@ func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun) {
c.log.status = true
}
}
// ConfigZapClientFun 日志配置
func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun) {
apiZapLog := apiZapLogFun()
if apiZapLog != nil {
c.zap.client = apiZapLog
c.zap.status = true
}
}

@ -2,7 +2,6 @@ package amap
import (
"context"
"github.com/dtapps/go-library"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -23,9 +22,6 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 设置参数
client.SetParams(params)
// 传入SDk版本
client.AfferentSdkUserVersion(go_library.Version())
// 发起请求
request, err := client.Request(ctx)
if err != nil {
@ -34,7 +30,10 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 记录日志
if c.log.status {
go c.log.client.Middleware(ctx, request, go_library.Version())
go c.log.client.Middleware(ctx, request)
}
if c.zap.status {
go c.zap.client.Middleware(ctx, request)
}
return request, err

@ -18,6 +18,10 @@ type Client struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
zap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
}
// NewClient 创建实例化

@ -10,3 +10,12 @@ func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun) {
c.log.status = true
}
}
// ConfigZapClientFun 日志配置
func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun) {
apiZapLog := apiZapLogFun()
if apiZapLog != nil {
c.zap.client = apiZapLog
c.zap.status = true
}
}

@ -2,7 +2,6 @@ package baidu
import (
"context"
"github.com/dtapps/go-library"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -23,9 +22,6 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 设置参数
client.SetParams(params)
// 传入SDk版本
client.AfferentSdkUserVersion(go_library.Version())
// 发起请求
request, err := client.Request(ctx)
if err != nil {
@ -34,7 +30,10 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 记录日志
if c.log.status {
go c.log.client.Middleware(ctx, request, go_library.Version())
go c.log.client.Middleware(ctx, request)
}
if c.zap.status {
go c.zap.client.Middleware(ctx, request)
}
return request, err

@ -20,6 +20,10 @@ type Client struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
zap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
}
// NewClient 创建实例化

@ -10,3 +10,12 @@ func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun) {
c.log.status = true
}
}
// ConfigZapClientFun 日志配置
func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun) {
apiZapLog := apiZapLogFun()
if apiZapLog != nil {
c.zap.client = apiZapLog
c.zap.status = true
}
}

@ -2,7 +2,6 @@ package caiyunapp
import (
"context"
"github.com/dtapps/go-library"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -23,9 +22,6 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 设置参数
client.SetParams(params)
// 传入SDk版本
client.AfferentSdkUserVersion(go_library.Version())
// 发起请求
request, err := client.Request(ctx)
if err != nil {
@ -34,7 +30,10 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 记录日志
if c.log.status {
go c.log.client.Middleware(ctx, request, go_library.Version())
go c.log.client.Middleware(ctx, request)
}
if c.zap.status {
go c.zap.client.Middleware(ctx, request)
}
return request, err

@ -20,6 +20,10 @@ type Client struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
zap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
}
// NewClient 创建实例化

@ -10,3 +10,12 @@ func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun) {
c.log.status = true
}
}
// ConfigZapClientFun 日志配置
func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun) {
apiZapLog := apiZapLogFun()
if apiZapLog != nil {
c.zap.client = apiZapLog
c.zap.status = true
}
}

@ -2,7 +2,6 @@ package dingdanxia
import (
"context"
"github.com/dtapps/go-library"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -27,9 +26,6 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 设置参数
client.SetParams(params)
// 传入SDk版本
client.AfferentSdkUserVersion(go_library.Version())
// 发起请求
request, err := client.Request(ctx)
if err != nil {
@ -38,7 +34,10 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 记录日志
if c.log.status {
go c.log.client.Middleware(ctx, request, go_library.Version())
go c.log.client.Middleware(ctx, request)
}
if c.zap.status {
go c.zap.client.Middleware(ctx, request)
}
return request, err

@ -22,6 +22,10 @@ type Client struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
zap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
}
// NewClient 创建实例化

@ -16,3 +16,12 @@ func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun) {
c.log.status = true
}
}
// ConfigZapClientFun 日志配置
func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun) {
apiZapLog := apiZapLogFun()
if apiZapLog != nil {
c.zap.client = apiZapLog
c.zap.status = true
}
}

@ -2,7 +2,6 @@ package dingtalk
import (
"context"
"github.com/dtapps/go-library"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -23,9 +22,6 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 设置参数
client.SetParams(params)
// 传入SDk版本
client.AfferentSdkUserVersion(go_library.Version())
// 发起请求
request, err := client.Request(ctx)
if err != nil {
@ -34,7 +30,10 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 记录日志
if c.log.status {
go c.log.client.Middleware(ctx, request, go_library.Version())
go c.log.client.Middleware(ctx, request)
}
if c.zap.status {
go c.zap.client.Middleware(ctx, request)
}
return request, err

@ -22,6 +22,10 @@ type Client struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
zap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
}
// NewClient 创建实例化

@ -10,3 +10,12 @@ func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun) {
c.log.status = true
}
}
// ConfigZapClientFun 日志配置
func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun) {
apiZapLog := apiZapLogFun()
if apiZapLog != nil {
c.zap.client = apiZapLog
c.zap.status = true
}
}

@ -2,7 +2,6 @@ package eastiot
import (
"context"
"github.com/dtapps/go-library"
"github.com/dtapps/go-library/utils/gorequest"
"time"
)
@ -39,7 +38,10 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 记录日志
if c.log.status {
go c.log.client.Middleware(ctx, request, go_library.Version())
go c.log.client.Middleware(ctx, request)
}
if c.zap.status {
go c.zap.client.Middleware(ctx, request)
}
return request, err

@ -25,6 +25,10 @@ type Client struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
zap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
}
// NewClient 创建实例化

@ -10,3 +10,12 @@ func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun) {
c.log.status = true
}
}
// ConfigZapClientFun 日志配置
func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun) {
apiZapLog := apiZapLogFun()
if apiZapLog != nil {
c.zap.client = apiZapLog
c.zap.status = true
}
}

@ -3,7 +3,6 @@ package ejiaofei
import (
"context"
"fmt"
"github.com/dtapps/go-library"
"github.com/dtapps/go-library/utils/gomd5"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -40,7 +39,10 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 记录日志
if c.log.status {
go c.log.client.MiddlewareXml(ctx, request, go_library.Version())
go c.log.client.MiddlewareXml(ctx, request)
}
if c.zap.status {
go c.zap.client.MiddlewareXml(ctx, request)
}
return request, err

@ -20,6 +20,10 @@ type Client struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
zap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
}
// NewClient 创建实例化

@ -15,3 +15,12 @@ func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun) {
c.log.status = true
}
}
// ConfigZapClientFun 日志配置
func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun) {
apiZapLog := apiZapLogFun()
if apiZapLog != nil {
c.zap.client = apiZapLog
c.zap.status = true
}
}

@ -2,7 +2,6 @@ package feishu
import (
"context"
"github.com/dtapps/go-library"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -20,9 +19,6 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 设置参数
client.SetParams(params)
// 传入SDk版本
client.AfferentSdkUserVersion(go_library.Version())
// 发起请求
request, err := client.Post(ctx)
if err != nil {
@ -31,7 +27,10 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 记录日志
if c.log.status {
go c.log.client.Middleware(ctx, request, go_library.Version())
go c.log.client.Middleware(ctx, request)
}
if c.zap.status {
go c.zap.client.Middleware(ctx, request)
}
return request, err

@ -2,7 +2,6 @@ package gddata
import (
"context"
"github.com/dtapps/go-library"
"github.com/dtapps/go-library/utils/gorequest"
"log"
)
@ -28,9 +27,6 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 设置参数
client.SetParams(params)
// 传入SDk版本
client.AfferentSdkUserVersion(go_library.Version())
// 发起请求
request, err := client.Request(ctx)
if err != nil {
@ -39,7 +35,7 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 记录日志
if c.log.status {
go c.log.client.Middleware(ctx, request, go_library.Version())
go c.log.client.Middleware(ctx, request)
}
return request, err

@ -26,6 +26,10 @@ type Client struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
zap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
}
// NewClient 创建实例化

@ -10,3 +10,12 @@ func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun) {
c.log.status = true
}
}
// ConfigZapClientFun 日志配置
func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun) {
apiZapLog := apiZapLogFun()
if apiZapLog != nil {
c.zap.client = apiZapLog
c.zap.status = true
}
}

@ -3,7 +3,6 @@ package jd
import (
"context"
"fmt"
"github.com/dtapps/go-library"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -30,7 +29,10 @@ func (c *Client) request(ctx context.Context, params map[string]interface{}) (go
// 记录日志
if c.log.status {
go c.log.client.MiddlewareCustom(ctx, fmt.Sprintf("%s", params["method"]), request, go_library.Version())
go c.log.client.MiddlewareCustom(ctx, fmt.Sprintf("%s", params["method"]), request)
}
if c.zap.status {
go c.zap.client.MiddlewareCustom(ctx, fmt.Sprintf("%s", params["method"]), request)
}
return request, err

@ -27,6 +27,14 @@ type Client struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
zap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
cacheZap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
}
// NewClient 创建实例化
@ -38,6 +46,7 @@ func NewClient(config *ClientConfig) (*Client, error) {
c.config.customerKey = config.CustomerKey
c.cacheLog.status = config.CacheLogStatus
c.cacheZap.status = config.CacheLogStatus
c.requestClient = gorequest.NewHttp()

@ -12,3 +12,14 @@ func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun) {
c.cacheLog.client = apiClient
}
}
// ConfigZapClientFun 日志配置
func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun) {
apiZapLog := apiZapLogFun()
if apiZapLog != nil {
c.zap.client = apiZapLog
c.zap.status = true
c.cacheZap.client = apiZapLog
}
}

@ -2,7 +2,6 @@ package kashangwl
import (
"context"
"github.com/dtapps/go-library"
"github.com/dtapps/go-library/utils/gorequest"
"time"
)
@ -39,7 +38,10 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 日志
if c.log.status {
go c.log.client.Middleware(ctx, request, go_library.Version())
go c.log.client.Middleware(ctx, request)
}
if c.zap.status {
go c.zap.client.Middleware(ctx, request)
}
return request, err
@ -73,7 +75,10 @@ func (c *Client) requestCache(ctx context.Context, url string, params map[string
// 日志
if c.cacheLog.status {
go c.cacheLog.client.Middleware(ctx, request, go_library.Version())
go c.cacheLog.client.Middleware(ctx, request)
}
if c.cacheLog.status {
go c.cacheLog.client.Middleware(ctx, request)
}
return request, err

@ -19,6 +19,10 @@ type Client struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
zap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
}
// NewClient 创建实例化

@ -10,3 +10,12 @@ func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun) {
c.log.status = true
}
}
// ConfigZapClientFun 日志配置
func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun) {
apiZapLog := apiZapLogFun()
if apiZapLog != nil {
c.zap.client = apiZapLog
c.zap.status = true
}
}

@ -23,6 +23,10 @@ type Client struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
zap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
}
func NewClient(config *ConfigClient) (*Client, error) {

@ -10,3 +10,12 @@ func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun) {
c.log.status = true
}
}
// ConfigZapClientFun 日志配置
func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun) {
apiZapLog := apiZapLogFun()
if apiZapLog != nil {
c.zap.client = apiZapLog
c.zap.status = true
}
}

@ -2,7 +2,6 @@ package leshuazf
import (
"context"
go_library "github.com/dtapps/go-library"
"github.com/dtapps/go-library/utils/gorandom"
"github.com/dtapps/go-library/utils/gorequest"
"github.com/dtapps/go-library/utils/gotime"
@ -46,7 +45,10 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 日志
if c.log.status {
go c.log.client.Middleware(ctx, request, go_library.Version())
go c.log.client.Middleware(ctx, request)
}
if c.zap.status {
go c.zap.client.Middleware(ctx, request)
}
return request, err

@ -22,6 +22,10 @@ type Client struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
zap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
}
// NewClient 创建实例化

@ -10,3 +10,12 @@ func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun) {
c.log.status = true
}
}
// ConfigZapClientFun 日志配置
func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun) {
apiZapLog := apiZapLogFun()
if apiZapLog != nil {
c.zap.client = apiZapLog
c.zap.status = true
}
}

@ -2,7 +2,6 @@ package meituan
import (
"context"
"github.com/dtapps/go-library"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -31,7 +30,10 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 日志
if c.log.status {
go c.log.client.Middleware(ctx, request, go_library.Version())
go c.log.client.Middleware(ctx, request)
}
if c.zap.status {
go c.zap.client.Middleware(ctx, request)
}
return request, err

@ -20,4 +20,8 @@ type Client struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
zap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
}

@ -0,0 +1,12 @@
package nldyp
import "github.com/dtapps/go-library/utils/golog"
// ConfigZapClientFun 日志配置
func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun) {
apiZapLog := apiZapLogFun()
if apiZapLog != nil {
c.zap.client = apiZapLog
c.zap.status = true
}
}

@ -2,7 +2,6 @@ package nldyp
import (
"context"
"github.com/dtapps/go-library"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -31,7 +30,10 @@ func (c *Client) request(ctx context.Context, url string, param map[string]inter
// 日志
if c.log.status {
go c.log.client.Middleware(ctx, request, go_library.Version())
go c.log.client.Middleware(ctx, request)
}
if c.zap.status {
go c.zap.client.Middleware(ctx, request)
}
return request, err

@ -11,6 +11,10 @@ type Client struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
zap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
}
func NewClient() (*Client, error) {

@ -10,3 +10,12 @@ func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun) {
c.log.status = true
}
}
// ConfigZapClientFun 日志配置
func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun) {
apiZapLog := apiZapLogFun()
if apiZapLog != nil {
c.zap.client = apiZapLog
c.zap.status = true
}
}

@ -2,7 +2,6 @@ package pconline
import (
"context"
go_library "github.com/dtapps/go-library"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -25,7 +24,10 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 日志
if c.log.status {
go c.log.client.Middleware(ctx, request, go_library.Version())
go c.log.client.Middleware(ctx, request)
}
if c.zap.status {
go c.zap.client.Middleware(ctx, request)
}
return request, err

@ -28,6 +28,10 @@ type Client struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
zap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
}
// NewClient 创建实例化

@ -15,3 +15,12 @@ func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun) {
c.log.status = true
}
}
// ConfigZapClientFun 日志配置
func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun) {
apiZapLog := apiZapLogFun()
if apiZapLog != nil {
c.zap.client = apiZapLog
c.zap.status = true
}
}

@ -3,7 +3,6 @@ package pinduoduo
import (
"context"
"fmt"
"github.com/dtapps/go-library"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -26,7 +25,10 @@ func (c *Client) request(ctx context.Context, params map[string]interface{}) (go
// 日志
if c.log.status {
go c.log.client.MiddlewareCustom(ctx, fmt.Sprintf("%s", params["type"]), request, go_library.Version())
go c.log.client.MiddlewareCustom(ctx, fmt.Sprintf("%s", params["type"]), request)
}
if c.zap.status {
go c.zap.client.MiddlewareCustom(ctx, fmt.Sprintf("%s", params["type"]), request)
}
return request, err

@ -24,6 +24,10 @@ type Client struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
zap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
}
// NewClient 创建实例化

@ -10,3 +10,12 @@ func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun) {
c.log.status = true
}
}
// ConfigZapClientFun 日志配置
func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun) {
apiZapLog := apiZapLogFun()
if apiZapLog != nil {
c.zap.client = apiZapLog
c.zap.status = true
}
}

@ -2,7 +2,6 @@ package pintoto
import (
"context"
"github.com/dtapps/go-library"
"github.com/dtapps/go-library/utils/gorequest"
"time"
)
@ -37,7 +36,10 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 记录日志
if c.log.status {
go c.log.client.Middleware(ctx, request, go_library.Version())
go c.log.client.Middleware(ctx, request)
}
if c.zap.status {
go c.zap.client.Middleware(ctx, request)
}
return request, err

@ -0,0 +1,38 @@
package qiniu
import (
"github.com/dtapps/go-library/utils/golog"
"github.com/dtapps/go-library/utils/gorequest"
)
// ClientConfig 实例配置
type ClientConfig struct {
AccessKey string
SecretKey string
}
// Client 实例
type Client struct {
requestClient *gorequest.App // 请求服务
config struct {
accessKey string
secretKey string
}
log struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
}
// NewClient 创建实例化
func NewClient(config *ClientConfig) (*Client, error) {
c := &Client{}
c.config.accessKey = config.AccessKey
c.config.secretKey = config.SecretKey
c.requestClient = gorequest.NewHttp()
return c, nil
}

@ -20,6 +20,10 @@ type Client struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
zap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
}
// NewClient 创建实例化

@ -10,3 +10,12 @@ func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun) {
c.log.status = true
}
}
// ConfigZapClientFun 日志配置
func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun) {
apiZapLog := apiZapLogFun()
if apiZapLog != nil {
c.zap.client = apiZapLog
c.zap.status = true
}
}

@ -2,7 +2,6 @@ package qq
import (
"context"
"github.com/dtapps/go-library"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -23,9 +22,6 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 设置参数
client.SetParams(params)
// 传入SDk版本
client.AfferentSdkUserVersion(go_library.Version())
// 发起请求
request, err := client.Request(ctx)
if err != nil {
@ -34,7 +30,10 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 记录日志
if c.log.status {
go c.log.client.Middleware(ctx, request, go_library.Version())
go c.log.client.Middleware(ctx, request)
}
if c.zap.status {
go c.zap.client.Middleware(ctx, request)
}
return request, err

@ -20,6 +20,10 @@ type Client struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
zap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
}
func NewClient(config *ConfigClient) (*Client, error) {

@ -10,3 +10,12 @@ func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun) {
c.log.status = true
}
}
// ConfigZapClientFun 日志配置
func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun) {
apiZapLog := apiZapLogFun()
if apiZapLog != nil {
c.zap.client = apiZapLog
c.zap.status = true
}
}

@ -2,7 +2,6 @@ package sendcloud
import (
"context"
go_library "github.com/dtapps/go-library"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -36,7 +35,10 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 日志
if c.log.status {
go c.log.client.Middleware(ctx, request, go_library.Version())
go c.log.client.Middleware(ctx, request)
}
if c.zap.status {
go c.zap.client.Middleware(ctx, request)
}
return request, err

@ -24,6 +24,10 @@ type Client struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
zap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
}
// NewClient 创建实例化

@ -10,3 +10,12 @@ func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun) {
c.log.status = true
}
}
// ConfigZapClientFun 日志配置
func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun) {
apiZapLog := apiZapLogFun()
if apiZapLog != nil {
c.zap.client = apiZapLog
c.zap.status = true
}
}

@ -3,7 +3,6 @@ package taobao
import (
"context"
"fmt"
"github.com/dtapps/go-library"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -26,7 +25,10 @@ func (c *Client) request(ctx context.Context, params map[string]interface{}) (go
// 记录日志
if c.log.status {
go c.log.client.MiddlewareCustom(ctx, fmt.Sprintf("%s", params["method"]), request, go_library.Version())
go c.log.client.MiddlewareCustom(ctx, fmt.Sprintf("%s", params["method"]), request)
}
if c.zap.status {
go c.zap.client.MiddlewareCustom(ctx, fmt.Sprintf("%s", params["method"]), request)
}
return request, err

@ -34,6 +34,10 @@ type Client struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
zap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
}
// NewClient 创建实例化

@ -34,3 +34,12 @@ func (c *Client) ConfigRedisCachePrefixFunWechatAccessToken(config string) error
}
return nil
}
// ConfigZapClientFun 日志配置
func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun) {
apiZapLog := apiZapLogFun()
if apiZapLog != nil {
c.zap.client = apiZapLog
c.zap.status = true
}
}

@ -2,7 +2,6 @@ package wechatminiprogram
import (
"context"
"github.com/dtapps/go-library"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -34,7 +33,10 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 记录日志
if c.log.status {
go c.log.client.Middleware(ctx, request, go_library.Version())
go c.log.client.Middleware(ctx, request)
}
if c.zap.status {
go c.zap.client.Middleware(ctx, request)
}
return request, err

@ -37,6 +37,10 @@ type Client struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
zap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
}
// NewClient 创建实例化

@ -17,3 +17,12 @@ func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun) {
c.log.status = true
}
}
// ConfigZapClientFun 日志配置
func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun) {
apiZapLog := apiZapLogFun()
if apiZapLog != nil {
c.zap.client = apiZapLog
c.zap.status = true
}
}

@ -2,7 +2,6 @@ package wechatoffice
import (
"context"
"github.com/dtapps/go-library"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -34,7 +33,10 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 记录日志
if c.log.status {
go c.log.client.Middleware(ctx, request, go_library.Version())
go c.log.client.Middleware(ctx, request)
}
if c.zap.status {
go c.zap.client.Middleware(ctx, request)
}
return request, err

@ -50,6 +50,10 @@ type Client struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
zap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
}
// NewClient 创建实例化

@ -23,3 +23,12 @@ func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun) {
c.log.status = true
}
}
// ConfigZapClientFun 日志配置
func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun) {
apiZapLog := apiZapLogFun()
if apiZapLog != nil {
c.zap.client = apiZapLog
c.zap.status = true
}
}

@ -2,7 +2,6 @@ package wechatopen
import (
"context"
"github.com/dtapps/go-library"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -37,7 +36,10 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 记录日志
if c.log.status {
go c.log.client.Middleware(ctx, request, go_library.Version())
go c.log.client.Middleware(ctx, request)
}
if c.zap.status {
go c.zap.client.Middleware(ctx, request)
}
return request, err

@ -30,6 +30,10 @@ type Client struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
zap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
}
// NewClient 创建实例化

@ -10,3 +10,12 @@ func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun) {
c.log.status = true
}
}
// ConfigZapClientFun 日志配置
func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun) {
apiZapLog := apiZapLogFun()
if apiZapLog != nil {
c.zap.client = apiZapLog
c.zap.status = true
}
}

@ -3,7 +3,6 @@ package wechatpayapiv2
import (
"context"
"crypto/tls"
"github.com/dtapps/go-library"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -37,7 +36,10 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 记录日志
if c.log.status {
go c.log.client.MiddlewareXml(ctx, request, go_library.Version())
go c.log.client.MiddlewareXml(ctx, request)
}
if c.zap.status {
go c.zap.client.MiddlewareXml(ctx, request)
}
return request, err

@ -32,6 +32,10 @@ type Client struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
zap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
}
// NewClient 创建实例化

@ -16,3 +16,12 @@ func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun) {
c.log.status = true
}
}
// ConfigZapClientFun 日志配置
func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun) {
apiZapLog := apiZapLogFun()
if apiZapLog != nil {
c.zap.client = apiZapLog
c.zap.status = true
}
}

@ -2,7 +2,6 @@ package wechatpayapiv3
import (
"context"
"github.com/dtapps/go-library"
"github.com/dtapps/go-library/utils/gorequest"
"net/http"
)
@ -57,7 +56,10 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 记录日志
if c.log.status {
go c.log.client.Middleware(ctx, request, go_library.Version())
go c.log.client.Middleware(ctx, request)
}
if c.zap.status {
go c.zap.client.Middleware(ctx, request)
}
return request, err

@ -36,6 +36,10 @@ type Client struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
zap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
}
// NewClient 创建实例化

@ -12,3 +12,12 @@ func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun) {
c.log.status = true
}
}
// ConfigZapClientFun 日志配置
func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun) {
apiZapLog := apiZapLogFun()
if apiZapLog != nil {
c.zap.client = apiZapLog
c.zap.status = true
}
}

@ -2,7 +2,6 @@ package wechatpayopen
import (
"context"
"github.com/dtapps/go-library"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -50,7 +49,11 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 记录日志
if c.log.status {
go c.log.client.Middleware(ctx, request, go_library.Version())
go c.log.client.Middleware(ctx, request)
}
if c.zap.status {
go c.zap.client.Middleware(ctx, request)
}
return request, err
}

@ -28,6 +28,10 @@ type Client struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
zap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
}
// NewClient 创建实例化

@ -15,3 +15,12 @@ func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun) {
c.log.status = true
}
}
// ConfigZapClientFun 日志配置
func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun) {
apiZapLog := apiZapLogFun()
if apiZapLog != nil {
c.zap.client = apiZapLog
c.zap.status = true
}
}

@ -2,7 +2,6 @@ package wechatqy
import (
"context"
"github.com/dtapps/go-library"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -22,9 +21,6 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 设置参数
client.SetParams(params)
// 传入SDk版本
client.AfferentSdkUserVersion(go_library.Version())
// 发起请求
request, err := client.Request(ctx)
if err != nil {
@ -33,7 +29,10 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 记录日志
if c.log.status {
go c.log.client.Middleware(ctx, request, go_library.Version())
go c.log.client.Middleware(ctx, request)
}
if c.zap.status {
go c.zap.client.Middleware(ctx, request)
}
return request, err

@ -36,6 +36,10 @@ type Client struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
zap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
}
// NewClient 创建实例化

@ -23,3 +23,12 @@ func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun) {
c.log.status = true
}
}
// ConfigZapClientFun 日志配置
func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun) {
apiZapLog := apiZapLogFun()
if apiZapLog != nil {
c.zap.client = apiZapLog
c.zap.status = true
}
}

@ -2,7 +2,6 @@ package wechatunion
import (
"context"
"github.com/dtapps/go-library"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -34,7 +33,10 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 记录日志
if c.log.status {
go c.log.client.Middleware(ctx, request, go_library.Version())
go c.log.client.Middleware(ctx, request)
}
if c.zap.status {
go c.zap.client.Middleware(ctx, request)
}
return request, err

@ -22,6 +22,10 @@ type Client struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
zap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
}
// NewClient 创建实例化

@ -10,3 +10,12 @@ func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun) {
c.log.status = true
}
}
// ConfigZapClientFun 日志配置
func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun) {
apiZapLog := apiZapLogFun()
if apiZapLog != nil {
c.zap.client = apiZapLog
c.zap.status = true
}
}

@ -2,7 +2,6 @@ package weishi
import (
"context"
"github.com/dtapps/go-library"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -25,7 +24,10 @@ func (c *Client) request(ctx context.Context, url string) (gorequest.Response, e
// 记录日志
if c.log.status {
go c.log.client.Middleware(ctx, request, go_library.Version())
go c.log.client.Middleware(ctx, request)
}
if c.zap.status {
go c.zap.client.Middleware(ctx, request)
}
return request, err

@ -26,6 +26,10 @@ type Client struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
zap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
}
// NewClient 创建实例化

@ -18,3 +18,12 @@ func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun) {
c.log.status = true
}
}
// ConfigZapClientFun 日志配置
func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun) {
apiZapLog := apiZapLogFun()
if apiZapLog != nil {
c.zap.client = apiZapLog
c.zap.status = true
}
}

@ -3,7 +3,6 @@ package wikeyun
import (
"context"
"fmt"
"github.com/dtapps/go-library"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -25,9 +24,6 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 设置参数
client.SetParams(params)
// 传入SDk版本
client.AfferentSdkUserVersion(go_library.Version())
// 发起请求
request, err := client.Post(ctx)
if err != nil {
@ -36,7 +32,10 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 日志
if c.log.status {
go c.log.client.Middleware(ctx, request, go_library.Version())
go c.log.client.Middleware(ctx, request)
}
if c.zap.status {
go c.zap.client.Middleware(ctx, request)
}
return request, err

@ -22,6 +22,10 @@ type Client struct {
status bool // 状态
client *golog.ApiClient // 日志服务
}
zap struct {
status bool // 状态
client *golog.ApiZapLog // 日志服务
}
}
// NewClient 创建实例化

@ -17,3 +17,12 @@ func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun) {
c.log.status = true
}
}
// ConfigZapClientFun 日志配置
func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun) {
apiZapLog := apiZapLogFun()
if apiZapLog != nil {
c.zap.client = apiZapLog
c.zap.status = true
}
}

@ -2,7 +2,6 @@ package wnfuwu
import (
"context"
"github.com/dtapps/go-library"
"github.com/dtapps/go-library/utils/gorequest"
)
@ -24,9 +23,6 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 设置参数
client.SetParams(params)
// 传入SDk版本
client.AfferentSdkUserVersion(go_library.Version())
// 发起请求
request, err := client.Post(ctx)
if err != nil {
@ -35,7 +31,10 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte
// 日志
if c.log.status {
go c.log.client.Middleware(ctx, request, go_library.Version())
go c.log.client.Middleware(ctx, request)
}
if c.zap.status {
go c.zap.client.Middleware(ctx, request)
}
return request, err

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save