third-platform-sdk/platform/zhetaoke/client.go
yanfan d3e3119c14 京东联盟
折淘客
2025-05-15 17:59:51 +08:00

38 lines
742 B
Go

package zhetaoke
import (
"github.com/zeromicro/go-zero/core/logx"
"repository.lenntc.com/lenntc/third-platform-sdk/client"
)
// AuthConfig api鉴权参数
type AuthConfig struct {
UnionId string
AppKey string
}
// 连接第三方平台的client
type Client struct {
log logx.Logger
authConfig AuthConfig
client.HttpClient
headers map[string]string
}
func NewApiClient(log logx.Logger, conf AuthConfig) ZheTaoKeApi {
clt := newClient(log, conf)
return newZheTaoKeApiImpl(log, clt)
}
func newClient(log logx.Logger, conf AuthConfig) *Client {
return &Client{
log: log,
authConfig: conf,
HttpClient: client.NewHttpClient(log),
headers: map[string]string{
"Content-Type": "application/json",
},
}
}