- dingdingapi.NewWithAgentID
- CorpAsyncSend and CorpAsyncSendSimple remove agentID param
This commit is contained in:
@@ -31,29 +31,35 @@ const (
|
||||
)
|
||||
|
||||
type API struct {
|
||||
corpID string
|
||||
token string
|
||||
appID string
|
||||
secret string
|
||||
client *http.Client
|
||||
config *platformapi.APIConfig
|
||||
locker sync.RWMutex
|
||||
agentID int64
|
||||
corpID string
|
||||
token string
|
||||
appID string
|
||||
secret string
|
||||
client *http.Client
|
||||
config *platformapi.APIConfig
|
||||
locker sync.RWMutex
|
||||
|
||||
callbackToken string
|
||||
callbackAESKey []byte
|
||||
}
|
||||
|
||||
func New(corpID, appID, secret string, config ...*platformapi.APIConfig) *API {
|
||||
return NewWithAgentID(0, corpID, appID, secret, config...)
|
||||
}
|
||||
|
||||
func NewWithAgentID(agentID int64, corpID, appID, secret string, config ...*platformapi.APIConfig) *API {
|
||||
curConfig := platformapi.DefAPIConfig
|
||||
if len(config) > 0 {
|
||||
curConfig = *config[0]
|
||||
}
|
||||
return &API{
|
||||
corpID: corpID,
|
||||
appID: appID,
|
||||
secret: secret,
|
||||
client: &http.Client{Timeout: curConfig.ClientTimeout},
|
||||
config: &curConfig,
|
||||
agentID: agentID,
|
||||
corpID: corpID,
|
||||
appID: appID,
|
||||
secret: secret,
|
||||
client: &http.Client{Timeout: curConfig.ClientTimeout},
|
||||
config: &curConfig,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user