This commit is contained in:
2026-07-21 15:53:29 +08:00
parent 024b6614ba
commit c943f575d5
40 changed files with 5362 additions and 275 deletions

View 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
}