aa
This commit is contained in:
@@ -42,25 +42,27 @@ type API struct {
|
||||
locker sync.RWMutex
|
||||
|
||||
callbackToken string
|
||||
callbackAESKey []byte
|
||||
callbackAESKey string
|
||||
}
|
||||
|
||||
func New(corpID, appID, secret string, config ...*platformapi.APIConfig) *API {
|
||||
return NewWithAgentID(0, corpID, appID, secret, config...)
|
||||
return NewWithAgentID(0, corpID, appID, secret, "", "", config...)
|
||||
}
|
||||
|
||||
func NewWithAgentID(agentID int64, corpID, appID, secret string, config ...*platformapi.APIConfig) *API {
|
||||
func NewWithAgentID(agentID int64, corpID, appID, secret, callbackToken, callbackAESKey string, config ...*platformapi.APIConfig) *API {
|
||||
curConfig := platformapi.DefAPIConfig
|
||||
if len(config) > 0 {
|
||||
curConfig = *config[0]
|
||||
}
|
||||
return &API{
|
||||
agentID: agentID,
|
||||
corpID: corpID,
|
||||
appID: appID,
|
||||
secret: secret,
|
||||
client: &http.Client{Timeout: curConfig.ClientTimeout},
|
||||
config: &curConfig,
|
||||
agentID: agentID,
|
||||
corpID: corpID,
|
||||
appID: appID,
|
||||
secret: secret,
|
||||
callbackToken: callbackToken,
|
||||
callbackAESKey: callbackAESKey,
|
||||
client: &http.Client{Timeout: curConfig.ClientTimeout},
|
||||
config: &curConfig,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user