Skip to content

Commit 8b7e05f

Browse files
author
zianazhao
committed
保持一致
1 parent 9cbba23 commit 8b7e05f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

pkg/client/client.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package client
22

33
import (
4+
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/regions"
45
"net/http"
56
"net/url"
67

@@ -10,6 +11,7 @@ import (
1011
kafka "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka/v20190819"
1112
clb "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb/v20180317"
1213
cmq "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cmq/v20190304"
14+
apiCommon "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common"
1315
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile"
1416
cvm "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm/v20170312"
1517
cynosdb "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cynosdb/v20190107"
@@ -306,6 +308,17 @@ func NewGAAPClient(cred common.CredentialIface, conf *config.TencentConfig) (*ga
306308
return gaap.NewClient(cred, conf.Credential.Region, cpf)
307309
}
308310

311+
func NewGAAPCommonClient(cred common.CredentialIface, conf *config.TencentConfig) *apiCommon.Client {
312+
cpf := profile.NewClientProfile()
313+
if conf.Credential.IsInternal == true {
314+
cpf.HttpProfile.Endpoint = "gaap.internal.tencentcloudapi.com"
315+
} else {
316+
cpf.HttpProfile.Endpoint = "gaap.tencentcloudapi.com"
317+
}
318+
cpf.HttpProfile.ReqMethod = "POST"
319+
return apiCommon.NewCommonClient(cred, regions.Guangzhou, cpf)
320+
}
321+
309322
func NewWafClient(cred common.CredentialIface, conf *config.TencentConfig) (*waf.Client, error) {
310323
cpf := profile.NewClientProfile()
311324
if conf.Credential.IsInternal == true {

0 commit comments

Comments
 (0)