diff --git a/client.go b/client.go index 5891e48..ea4472e 100644 --- a/client.go +++ b/client.go @@ -64,9 +64,12 @@ func NewClient(config *ClientConfig) (*Client, error) { gormClient := config.GormClientFun() if gormClient != nil && gormClient.Db != nil { - c.log.logGormClient, err = golog.NewApiGormClient(func() (*dorm.GormClient, string) { - return gormClient, logTable - }, config.Debug) + c.log.logGormClient, err = golog.NewApiGormClient(&golog.ApiGormClientConfig{ + GormClientFun: func() (*dorm.GormClient, string) { + return gormClient, logTable + }, + Debug: config.Debug, + }) if err != nil { return nil, err } @@ -76,9 +79,12 @@ func NewClient(config *ClientConfig) (*Client, error) { mongoClient, databaseName := config.MongoClientFun() if mongoClient != nil && mongoClient.Db != nil { - c.log.logMongoClient, err = golog.NewApiMongoClient(func() (*dorm.MongoClient, string, string) { - return mongoClient, databaseName, logTable - }, config.Debug) + c.log.logMongoClient, err = golog.NewApiMongoClient(&golog.ApiMongoClientConfig{ + MongoClientFun: func() (*dorm.MongoClient, string, string) { + return mongoClient, databaseName, logTable + }, + Debug: config.Debug, + }) if err != nil { return nil, err } diff --git a/const.go b/const.go index 354ceab..bfffc3e 100644 --- a/const.go +++ b/const.go @@ -8,4 +8,4 @@ const ( logTable = "wechatminiprogram" ) -const Version = "1.0.5" +const Version = "1.0.6" diff --git a/go.mod b/go.mod index bc0e19e..44e223f 100644 --- a/go.mod +++ b/go.mod @@ -4,33 +4,33 @@ go 1.19 require ( go.dtapp.net/dorm v1.0.30 - go.dtapp.net/golog v1.0.44 + go.dtapp.net/golog v1.0.45 go.dtapp.net/gorequest v1.0.27 go.dtapp.net/gostorage v1.0.12 ) require ( github.com/aliyun/aliyun-oss-go-sdk v2.2.5+incompatible // indirect - github.com/aws/aws-sdk-go v1.44.87 // indirect - github.com/aws/aws-sdk-go-v2 v1.16.12 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.5 // indirect - github.com/aws/aws-sdk-go-v2/config v1.17.2 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.12.15 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.13 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.19 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.13 // indirect - github.com/aws/aws-sdk-go-v2/internal/ini v1.3.20 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.10 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.14 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.13 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.13 // indirect - github.com/aws/aws-sdk-go-v2/service/s3 v1.27.6 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.11.18 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.1 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.16.14 // indirect - github.com/aws/smithy-go v1.13.0 // indirect - github.com/baidubce/bce-sdk-go v0.9.132 // indirect + github.com/aws/aws-sdk-go v1.44.89 // indirect + github.com/aws/aws-sdk-go-v2 v1.16.13 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.6 // indirect + github.com/aws/aws-sdk-go-v2/config v1.17.4 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.12.17 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.14 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.20 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.14 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.3.21 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.11 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.15 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.14 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.14 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.27.8 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.11.20 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.2 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.16.16 // indirect + github.com/aws/smithy-go v1.13.1 // indirect + github.com/baidubce/bce-sdk-go v0.9.133 // indirect github.com/basgys/goxml2json v1.1.0 // indirect github.com/beego/beego/v2 v2.0.5 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect diff --git a/go.sum b/go.sum index 3d4914d..c9d594e 100644 --- a/go.sum +++ b/go.sum @@ -33,47 +33,47 @@ github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQ github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.42.27/go.mod h1:OGr6lGMAKGlG9CVrYnWYDKIyb829c6EVBRjxqjmPepc= -github.com/aws/aws-sdk-go v1.44.87 h1:u/1sm8MNUSQHt8MGLEQHAj4r3lns3w0B1IXelPKbpn4= -github.com/aws/aws-sdk-go v1.44.87/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= +github.com/aws/aws-sdk-go v1.44.89 h1:Xf5Pp9GsNSMRinAuWNiQd0vusXXb3IgYbNlxldhWS2Q= +github.com/aws/aws-sdk-go v1.44.89/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/aws/aws-sdk-go-v2 v1.16.12 h1:wbMYa2PlFysFx2GLIQojr6FJV5+OWCM/BwyHXARxETA= -github.com/aws/aws-sdk-go-v2 v1.16.12/go.mod h1:C+Ym0ag2LIghJbXhfXZ0YEEp49rBWowxKzJLUoob0ts= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.5 h1:7A1nDFvkVlBmMa69QMLkw/m/DDHm6PUluIYK61aQoOY= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.5/go.mod h1:DnlOnWR2YuzMXNSHHNuoklObUE3SwWlcRTGL/zL+Aj8= -github.com/aws/aws-sdk-go-v2/config v1.17.2 h1:V96WPd2a1H/MXGZjk4zto+KpYnwZI2kdIdy/cI8kYnQ= -github.com/aws/aws-sdk-go-v2/config v1.17.2/go.mod h1:jumS/AMwul4WaG8vyXsF6kUndG9zndR+yfYBwl4i9ds= -github.com/aws/aws-sdk-go-v2/credentials v1.12.15 h1:6DONxG9cR3pAuISj1Irh5u2SRqCfIJwyHNyDDes7SZw= -github.com/aws/aws-sdk-go-v2/credentials v1.12.15/go.mod h1:41zTC6U/78fUD7ZCa5NymTJANDjfqySg5YEAYVFl2Ic= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.13 h1:+uferi8SUDZtMloCDt24Zenyy/i71C/ua5mjUCpbpN0= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.13/go.mod h1:y0eXmsNBFIVjUE8ZBjES8myOHlMsXDz7qGT93+MVdjk= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.19 h1:gC5mudiFrWGhzcdoWj1iCGUfrzCpQG0MQIQf0CXFFQQ= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.19/go.mod h1:llxE6bwUZhuCas0K7qGiu5OgMis3N7kdWtFSxoHmJ7E= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.13 h1:qezY57na06d6kSE7uuB0N7XEflu914AXx/hg2L8Ykcw= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.13/go.mod h1:lB12mkZqCSo5PsdBFLNqc2M/OOYgNAy8UtaktyuWvE8= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.20 h1:GvszACAU8GSV3+Tant5GutW6smY8WavrP8ZuRS9Ku4Q= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.20/go.mod h1:bfTcsThj5a9P5pIGRy0QudJ8k4+issxXX+O6Djnd5Cs= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.10 h1:233xgzn4lsBeN7qgG+k2kLquzBk35WB+nIhPMeK0h/Q= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.10/go.mod h1:1nl/nuVB6+UOpiyYJBfyhCzsX8fJAL6fCVcbtPIIV4w= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.6 h1:Z0Yw2qkgPZVGbOR70snGRAlBR0QIGPLkHoNhR4+7hbY= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.6/go.mod h1:Slj62rcu4BKdMAH0wqeP0fUkW1b1bkCxcSP+ZY5cevE= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.14 h1:NWR21daQBDyY4WChz4Gd78QuCPorUJiSHg7r1OWvfgA= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.14/go.mod h1:Yz4G3rD1LtBcg6gIYtJtpoEjts9IZMHiamdm3F1xtNA= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.13 h1:ObfthqDyhe7rMAOa7pqft6974VHIk8BAJB7kYdoIfTA= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.13/go.mod h1:V390DK4MQxLpDdXxFqizyz8KUxuWImkW/xzgXMz0yyk= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.13 h1:h1equp9qdWANft5cmtDUditRlALvE7tuaHs2RdSbsQg= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.13/go.mod h1:3RA7cs1uHkbV3f6tMYy7u0OfkyVckZBM70wUS4h1MDk= -github.com/aws/aws-sdk-go-v2/service/s3 v1.27.6 h1:4+iM+rBAcS9zZwQ2+Y57GgC41cRe6C8khdYfqaUT2k0= -github.com/aws/aws-sdk-go-v2/service/s3 v1.27.6/go.mod h1:orjy5IRgBQnh9EI/lMW7YGF6eYk6re8HPFbL66a2DSo= -github.com/aws/aws-sdk-go-v2/service/sso v1.11.18 h1:gTn1a/FbcOXK5LQS88dD5k+PKwyjVvhAEEwyN4c6eW8= -github.com/aws/aws-sdk-go-v2/service/sso v1.11.18/go.mod h1:ytmEi5+qwcSNcV2pVA8PIb1DnKT/0Bu/K4nfJHwoM6c= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.1 h1:p48IfndYbRk3iDsoQAmVXdCKEM5+7Y50JAPikjwk8gI= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.1/go.mod h1:NY+G+8PW0ISyJ7/6t5mgOe6qpJiwZa9Jix05WPscJjg= -github.com/aws/aws-sdk-go-v2/service/sts v1.16.14 h1:7kxso8VZLQ86Jg27QRBw6fjrQhQ8CMNMZ7SB0w7RQiA= -github.com/aws/aws-sdk-go-v2/service/sts v1.16.14/go.mod h1:Y+BUV19q3OmQVqNUlbZ40zVi3NM6Biuxwkx/qdSD/CY= -github.com/aws/smithy-go v1.13.0 h1:YfyEmSJLo7fAv8FbuDK4R8F9aAmi9DZ88Zb/KJJmUl0= -github.com/aws/smithy-go v1.13.0/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= -github.com/baidubce/bce-sdk-go v0.9.132 h1:UNJvRcvHKDu/UKpUUvJfPwbKmB6K1nvIWHHqHQehNKQ= -github.com/baidubce/bce-sdk-go v0.9.132/go.mod h1:zbYJMQwE4IZuyrJiFO8tO8NbtYiKTFTbwh4eIsqjVdg= +github.com/aws/aws-sdk-go-v2 v1.16.13 h1:HgF7OX2q0gSZtcXoo9DMEA8A2Qk/GCxmWyM0RI7Yz2Y= +github.com/aws/aws-sdk-go-v2 v1.16.13/go.mod h1:xSyvSnzh0KLs5H4HJGeIEsNYemUWdNIl0b/rP6SIsLU= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.6 h1:PPefqpze5qW/eqdgK5RqtOTQi5GhXpSxitbGqImAQ1I= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.6/go.mod h1:bcLsAUI2iDC8zC52XQvczR/zpaC1q/wP32p3wwvqGVo= +github.com/aws/aws-sdk-go-v2/config v1.17.4 h1:9HY1wbShqObySCHP2Z07blfrSWVX+nVxCZmUuLZKcG8= +github.com/aws/aws-sdk-go-v2/config v1.17.4/go.mod h1:ul+ru+huVpfduF9XRmGUq82T8T3K+nIFQuF6F+L+548= +github.com/aws/aws-sdk-go-v2/credentials v1.12.17 h1:htUjIJOQcvIUR0jC4eLkdis1DfaLL4EUbIKUFqh2WFA= +github.com/aws/aws-sdk-go-v2/credentials v1.12.17/go.mod h1:jd1mvJulXY7ccHvcSiJceYhv06yWIIRkJnwWEA4IX+g= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.14 h1:NZwZFtxXGOEIiCd8jWN55lexakug543CaO68bTpoLwg= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.14/go.mod h1:5CU57SyF5jZLSIw4OOll0PG83ThXwNdkRFOc0EltD/0= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.20 h1:Rk8eqZSdFovt8Id+O+i2qT0c3CY13DPn2SfGOEVlxNs= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.20/go.mod h1:gdZ5gRUaxThXIZyZQ8MTtgYBk2jbHgp05BO3GcD9Cwc= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.14 h1:6Yxuq9yrkoLYab5JXqJnto9tdRuIcYVdR+eiKjsJYWU= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.14/go.mod h1:GEV9jaDPIgayiU+uevxwozcvUOjc+P4aHE2BeSjm2vE= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.21 h1:lpwSbLKYTuABo6SyUoC25xAmfO3/TehGS2SmD1EtOL0= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.21/go.mod h1:Q0pktZjvRZk77TBto6yAvUAi7fcse1bdcMctBDVGgBw= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.11 h1:zFriLANEIFWl/TQvPqhRASnU8Xr9fzshPL0OY7e1DpM= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.11/go.mod h1:EAtoA46xWR2I0fROMCsb0lgC4kYfgaK9EBrCv9hIHYM= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.7 h1:f0l2kujaZ0UyqwfKdtPaYQs8vzFmLbtPhWDNYeEY4ho= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.7/go.mod h1:aGaU7sKr91r4yZCi+4fWpsDepAzy8A6u/1enpD3K6mM= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.15 h1:xw0EMeNfAdmiFX3Ix9OOdqW/S2GPeV3WAYKHr2qR/W4= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.15/go.mod h1:SvmZIJp6fx7Yua+4hhigLm5kVRDWo56Cj+j8FvVl6M8= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.14 h1:c5hJNN2DkK1gAytcKp7LkiKNDJeevFSboPezEHAM4Ro= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.14/go.mod h1:8qOLjqMzY/S1kh3myDXA1yxK5eD4uN8aOJgKpgvc4OM= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.14 h1:sGFyMilgKmgg8TsGMUXApIvIrbc9SZs2sFrbdugL21c= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.14/go.mod h1:QWqlQbLB0GYO6hDDUwPKr2VKr7C6lpCdOzs92IVYQmk= +github.com/aws/aws-sdk-go-v2/service/s3 v1.27.8 h1:zYpocIndjdPRURWkq/Rschy8WpC+vL0f74z+lJhEpJk= +github.com/aws/aws-sdk-go-v2/service/s3 v1.27.8/go.mod h1:aljgUlqAplymnhQNEcyx/fjUmQtOXCsS6Ry+ySpCcA8= +github.com/aws/aws-sdk-go-v2/service/sso v1.11.20 h1:3raP0UC9rvRyY4/cc4o4F3jTrNo94AYiarNUGNnq6dU= +github.com/aws/aws-sdk-go-v2/service/sso v1.11.20/go.mod h1:hPsROgDdgY/NQ1gPt7VJWG0GjSnalDC0DkkMfGEw2gc= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.2 h1:/SYpdjjAtraymql+/r719OgjxezdanAQiLb/NMxDb04= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.2/go.mod h1:5cxfDYtY2mDOlmesy4yycb6lwyy1U/iAUOHKhQLKw/E= +github.com/aws/aws-sdk-go-v2/service/sts v1.16.16 h1:otZvq9r+xjPL7qU/luX2QdBamiN+oSZURRi4sAKymO8= +github.com/aws/aws-sdk-go-v2/service/sts v1.16.16/go.mod h1:Y9iBgT1w2vHtYzJEkwD6FqILjDSsvbxcW/+wIYxyse4= +github.com/aws/smithy-go v1.13.1 h1:q09BdpUiaqpothcv393ACfWJJHzlzjB5HaNL1XHKmoQ= +github.com/aws/smithy-go v1.13.1/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/baidubce/bce-sdk-go v0.9.133 h1:JLCBvJ36lY4KI1BPvXsr+68YLUWdPV7SXhUFkB5Ueuo= +github.com/baidubce/bce-sdk-go v0.9.133/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/beego/beego/v2 v2.0.5 h1:fa2TBWfKGDs35Ck9an9SVnpS0zM8sRTXlW8rFjpeYlE= @@ -600,8 +600,8 @@ go.dtapp.net/dorm v1.0.30 h1:B2gwSe1ov4S+LPUv1ijFm4XE2KEeNn85eCP4WLilsCU= go.dtapp.net/dorm v1.0.30/go.mod h1:7ysGN47mW3u0EDAzXI3oUYZZHA3uasf2spugHeANPW8= go.dtapp.net/goip v1.0.28 h1:wZt+wbzNhOLRUJnepG4c8HhUr4V9jNXOF6wJ1h7jUvU= go.dtapp.net/goip v1.0.28/go.mod h1:ZqPPUvpOSzdtB/dEZFiaD0CBRZmvIzjDmm3XkpMC9Bo= -go.dtapp.net/golog v1.0.44 h1:wGTEcUgIJj/GSqYNiRPYou4FMssyMioAyDmDWcisc74= -go.dtapp.net/golog v1.0.44/go.mod h1:gBfmjjRJOfauahiqhKBoLC6vrk4WpLLrPfJu/+OOgL0= +go.dtapp.net/golog v1.0.45 h1:qfDrzcOfSeOgGlDxCyW+tEViXEhAZFzz6TzNeEWv/o0= +go.dtapp.net/golog v1.0.45/go.mod h1:QHP4MZoUZUtw1/pgBu7V5RIw766g2KrI44W0q6sj/40= go.dtapp.net/gorandom v1.0.1 h1:IWfMClh1ECPvyUjlqD7MwLq4mZdUusD1qAwAdsvEJBs= go.dtapp.net/gorandom v1.0.1/go.mod h1:ZPdgalKpvFV/ATQqR0k4ns/F/IpITAZpx6WkWirr5Y8= go.dtapp.net/gorequest v1.0.27 h1:Hip1mfSZJDNcmE2iZgB3PYa0C/7BAMEJLsCaMd6t9iE=