瀏覽代碼

add params

zhou-hao 7 年之前
父節點
當前提交
c7ebaff336

+ 3 - 0
hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-client/src/main/java/org/hswebframework/web/authorization/oauth2/client/request/OAuth2Request.java

@@ -20,6 +20,7 @@ package org.hswebframework.web.authorization.oauth2.client.request;
 
 import org.hswebframework.web.authorization.oauth2.client.response.OAuth2Response;
 
+import java.util.Map;
 import java.util.function.Consumer;
 
 /**
@@ -42,6 +43,8 @@ public interface OAuth2Request {
      */
     OAuth2Request param(String name, Object value);
 
+    OAuth2Request params(Map<String,String> params);
+
     /**
      * 设置请求体,将内容根据contentType(默认application/json)序列化为对应的请求数据
      *

+ 7 - 0
hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-client/src/main/java/org/hswebframework/web/authorization/oauth2/client/simple/request/SimpleOAuth2Request.java

@@ -27,6 +27,7 @@ import org.hswebframework.web.authorization.oauth2.client.request.TokenExpiredCa
 import org.hswebframework.web.authorization.oauth2.client.response.OAuth2Response;
 import org.hswebframework.web.oauth2.core.ErrorType;
 
+import java.util.Map;
 import java.util.function.Consumer;
 import java.util.function.Supplier;
 
@@ -69,6 +70,12 @@ public class SimpleOAuth2Request implements OAuth2Request {
         return this;
     }
 
+    @Override
+    public OAuth2Request params(Map<String, String> params) {
+        request.params(params);
+        return this;
+    }
+
     @Override
     public OAuth2Request param(String name, Object value) {
         request.param(name, String.valueOf(value));