org.sdn.api.request.OpenAuthRequest Maven / Gradle / Ivy
package org.sdn.api.request;
import org.sdn.api.response.OpenAuthResponse;
import java.util.HashMap;
import java.util.Map;
/**
* 获取token
* @author gaosong
* @date 2018/10/15.
*/
public class OpenAuthRequest implements OpenRequest {
private String grantType = "client_credentials";
/**默认post请求*/
private String requestMethod = "post";
public String getGrantType() {
return grantType;
}
public void setGrantType(String grantType) {
this.grantType = grantType;
}
@Override
public String getApiMethodName() {
return "tenantCenter.gateway.oauth.token";
}
@Override
public Class getResponseClass() {
return OpenAuthResponse.class;
}
@Override
public Map getMapParams() {
Map openHashMap = new HashMap<>();
openHashMap.put("grantType", this.grantType);
return openHashMap;
}
public void setRequestMethod(String requestMethod) {
this.requestMethod = requestMethod;
}
@Override
public String getRequestMethod() {
return requestMethod;
}
}