36 lines
757 B
Go
36 lines
757 B
Go
package meituan_union
|
|
|
|
import (
|
|
"github.com/zeromicro/go-zero/core/logx"
|
|
|
|
"chengdu-lenntc/third-platform-sdk/client"
|
|
)
|
|
|
|
// AuthConfig api鉴权参数
|
|
type AuthConfig struct {
|
|
SignKey string //签名秘钥
|
|
NotifyKey string //回调秘钥
|
|
}
|
|
|
|
// 连接第三方平台的client
|
|
type Client struct {
|
|
client.ThirdClient
|
|
log logx.Logger
|
|
authConfig AuthConfig
|
|
Headers map[string]string
|
|
}
|
|
|
|
func newClient(log logx.Logger, conf AuthConfig) *Client {
|
|
// todo:: 请求第三方平台的配置参数
|
|
return &Client{
|
|
ThirdClient: client.NewThirdClient(log),
|
|
log: log,
|
|
authConfig: conf,
|
|
}
|
|
}
|
|
|
|
func NewApiClient(log logx.Logger, conf AuthConfig) MeituanUnionApi {
|
|
clt := newClient(log, conf)
|
|
return newMeituanUnionApiImpl(log, clt)
|
|
}
|