aliyunpan/internal/config/pan_client.go

37 lines
902 B
Go
Raw Normal View History

2024-03-02 00:55:46 +08:00
package config
import (
"github.com/tickstep/aliyunpan-api/aliyunpan"
"github.com/tickstep/aliyunpan-api/aliyunpan_open"
)
type (
// PanClient 云盘客户端
PanClient struct {
// 网页WEB接口客户端
webapiPanClient *aliyunpan.PanClient
// 阿里openapi接口客户端
openapiPanClient *aliyunpan_open.OpenPanClient
}
)
func NewPanClient(webClient *aliyunpan.PanClient, openClient *aliyunpan_open.OpenPanClient) *PanClient {
return &PanClient{
webapiPanClient: webClient,
openapiPanClient: openClient,
}
}
func (p *PanClient) WebapiPanClient() *aliyunpan.PanClient {
return p.webapiPanClient
}
func (p *PanClient) OpenapiPanClient() *aliyunpan_open.OpenPanClient {
return p.openapiPanClient
}
2024-03-02 21:22:02 +08:00
func (p *PanClient) UpdateClient(openClient *aliyunpan_open.OpenPanClient, webClient *aliyunpan.PanClient) {
p.webapiPanClient = webClient
p.openapiPanClient = openClient
}