fadd
This commit is contained in:
40
internal/shared/fadada/client.go
Normal file
40
internal/shared/fadada/client.go
Normal file
@@ -0,0 +1,40 @@
|
||||
package fadada
|
||||
|
||||
import "sync"
|
||||
|
||||
// API 路径常量(FASC OpenAPI v5.1)
|
||||
const (
|
||||
pathGetAccessToken = "/service/get-access-token"
|
||||
pathGetCorpAuthURL = "/corp/get-auth-url"
|
||||
pathGetCorpIdentifiedStatus = "/corp/get-identified-status"
|
||||
pathFillDocTemplateValues = "/doc-template/fill-values"
|
||||
pathCreateSignTaskTemplate = "/sign-task/create-with-template"
|
||||
pathFillSignTaskFieldValues = "/sign-task/field/fill-values"
|
||||
pathStartSignTask = "/sign-task/start"
|
||||
pathGetSignTaskActorURL = "/sign-task/actor/get-url"
|
||||
pathGetSignTaskDetail = "/sign-task/app/get-detail"
|
||||
pathGetSignTaskPreviewURL = "/sign-task/get-preview-url"
|
||||
pathGetOwnerSignTaskDownload = "/sign-task/owner/get-download-url"
|
||||
)
|
||||
|
||||
// Client 法大大客户端(纯 HTTP,不依赖官方 SDK)
|
||||
type Client struct {
|
||||
config *Config
|
||||
http *HTTPClient
|
||||
tokenCache *tokenCache
|
||||
tokenMu sync.Mutex
|
||||
}
|
||||
|
||||
// NewClient 创建法大大客户端
|
||||
func NewClient(config *Config) *Client {
|
||||
return &Client{
|
||||
config: config,
|
||||
http: NewHTTPClient(config),
|
||||
tokenCache: &tokenCache{},
|
||||
}
|
||||
}
|
||||
|
||||
// GetConfig 获取当前配置
|
||||
func (c *Client) GetConfig() *Config {
|
||||
return c.config
|
||||
}
|
||||
Reference in New Issue
Block a user