2024-04-30 17:57:27 +08:00
|
|
|
package meituan_csr
|
2024-04-30 18:30:05 +08:00
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"github.com/zeromicro/go-zero/core/logx"
|
|
|
|
|
|
2024-05-01 14:05:18 +08:00
|
|
|
"gitee.com/chengdu-lenntc/third-platform-sdk/client"
|
2024-04-30 18:30:05 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// AuthConfig api鉴权参数
|
|
|
|
|
type AuthConfig struct {
|
|
|
|
|
AppKey string
|
|
|
|
|
UtmSource string
|
|
|
|
|
aes *AES
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 连接第三方平台的client
|
|
|
|
|
type Client struct {
|
|
|
|
|
client.ThirdClient
|
|
|
|
|
log logx.Logger
|
|
|
|
|
authConfig AuthConfig
|
|
|
|
|
Headers map[string]string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func newClient(log logx.Logger, conf AuthConfig) *Client {
|
|
|
|
|
return &Client{
|
|
|
|
|
ThirdClient: client.NewThirdClient(log),
|
|
|
|
|
log: log,
|
|
|
|
|
authConfig: conf,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func NewApiClient(log logx.Logger, conf AuthConfig) MeituanCsrApi {
|
|
|
|
|
clt := newClient(log, conf)
|
|
|
|
|
return newMeituanCsrApiImpl(log, clt)
|
|
|
|
|
}
|