aa
This commit is contained in:
@@ -205,3 +205,27 @@ func (a *API) AccessAPI2(cmd string, isGet bool, bizParams map[string]interface{
|
||||
func (a *API) AccessAPI(cmd string, isGet bool, bizParams map[string]interface{}) (retVal interface{}, err error) {
|
||||
return a.AccessAPI2(cmd, isGet, bizParams, resultKeyData, "")
|
||||
}
|
||||
|
||||
func (a *API) GetOAuthCode(appPoiCode string) (retVal interface{}, err error) {
|
||||
retVal, err = a.AccessAPI2("oauth/authorize", true, map[string]interface{}{
|
||||
"app_poi_code": appPoiCode,
|
||||
"response_type": "code",
|
||||
}, "code", "")
|
||||
return retVal, err
|
||||
}
|
||||
|
||||
func (a *API) GetAccessToken(code string) (retVal interface{}, err error) {
|
||||
retVal, err = a.AccessAPI2("oauth/token", false, map[string]interface{}{
|
||||
"grant_type": "authorization_code",
|
||||
"code": code,
|
||||
}, "access_token", "")
|
||||
return retVal, err
|
||||
}
|
||||
|
||||
func (a *API) RefreshToken(code string) (retVal interface{}, err error) {
|
||||
retVal, err = a.AccessAPI2("oauth/token", false, map[string]interface{}{
|
||||
"grant_type": "authorization_code",
|
||||
"code": code,
|
||||
}, "access_token", "")
|
||||
return retVal, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user