- initial dingdingapi added.

This commit is contained in:
gazebo
2019-03-07 21:01:15 +08:00
parent c3feb969bd
commit a107ca67d3
5 changed files with 191 additions and 9 deletions

View File

@@ -28,16 +28,10 @@ func (a *API) CBRetrieveToken() (tokenInfo *TokenInfo, err error) {
AccessToken: utils.Interface2String(result["access_token"]),
ExpiresIn: int(utils.MustInterface2Int64(result["expires_in"])),
}
a.CBSetToken(tokenInfo.AccessToken)
return tokenInfo, nil
}
func (a *API) CBRefreshToken() (tokenInfo *TokenInfo, err error) {
if tokenInfo, err = a.CBRetrieveToken(); err == nil {
a.CBSetToken(tokenInfo.AccessToken)
}
return tokenInfo, err
}
func (a *API) CBMessageTemplateSend(userOpenID, templateID, downloadURL string, miniProgram, data interface{}) (err error) {
bodyJson := map[string]interface{}{
"touser": userOpenID,