third-platform-sdk/platform/meituan-union/client.go

37 lines
795 B
Go
Raw Normal View History

2024-04-30 17:57:27 +08:00
package meituan_union
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 17:57:27 +08:00
)
// AuthConfig api鉴权参数
type AuthConfig struct {
AppKey string // 应用key
2024-05-04 16:57:40 +08:00
SignKey string // 签名秘钥
NotifyKey string // 回调秘钥
2024-04-30 17:57:27 +08:00
}
// 连接第三方平台的client
type Client struct {
2024-05-04 16:57:40 +08:00
client.HttpClient
2024-04-30 17:57:27 +08:00
log logx.Logger
authConfig AuthConfig
Headers map[string]string
}
2024-05-04 16:57:40 +08:00
func NewApiClient(log logx.Logger, conf AuthConfig) MeituanUnionApi {
clt := newClient(log, conf)
return newMeituanUnionApiImpl(log, clt)
}
2024-04-30 17:57:27 +08:00
func newClient(log logx.Logger, conf AuthConfig) *Client {
// todo:: 请求第三方平台的配置参数
return &Client{
2024-05-04 16:57:40 +08:00
HttpClient: client.NewHttpClient(log),
log: log,
authConfig: conf,
2024-04-30 17:57:27 +08:00
}
}