37 lines
759 B
Go
37 lines
759 B
Go
package meituan_csr
|
|
|
|
import (
|
|
"github.com/zeromicro/go-zero/core/logx"
|
|
|
|
"gitee.com/chengdu-lenntc/third-platform-sdk/client"
|
|
)
|
|
|
|
// AuthConfig api鉴权参数
|
|
type AuthConfig struct {
|
|
AppKey string // 应用key
|
|
UtmSource string // 渠道来源
|
|
}
|
|
|
|
// 连接第三方平台的client
|
|
type Client struct {
|
|
client.HttpClient
|
|
log logx.Logger
|
|
authConfig AuthConfig
|
|
aes *AES
|
|
Headers map[string]string
|
|
}
|
|
|
|
func NewApiClient(log logx.Logger, conf AuthConfig) MeituanCsrApi {
|
|
clt := newClient(log, conf)
|
|
return newMeituanCsrApiImpl(log, clt)
|
|
}
|
|
|
|
func newClient(log logx.Logger, conf AuthConfig) *Client {
|
|
return &Client{
|
|
HttpClient: client.NewHttpClient(log),
|
|
log: log,
|
|
authConfig: conf,
|
|
aes: NewAes(conf.AppKey),
|
|
}
|
|
}
|