mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-12 07:02:14 +08:00
3.1.0
This commit is contained in:
@@ -2,6 +2,7 @@ package com.gitee.sop.gatewaycommon.zuul.param;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.gitee.sop.gatewaycommon.manager.EnvironmentKeys;
|
||||||
import com.gitee.sop.gatewaycommon.param.FormHttpOutputMessage;
|
import com.gitee.sop.gatewaycommon.param.FormHttpOutputMessage;
|
||||||
import com.gitee.sop.gatewaycommon.util.RequestUtil;
|
import com.gitee.sop.gatewaycommon.util.RequestUtil;
|
||||||
import com.netflix.zuul.context.RequestContext;
|
import com.netflix.zuul.context.RequestContext;
|
||||||
@@ -44,6 +45,11 @@ public class ZuulParameterUtil {
|
|||||||
* @param <T> 参数类型
|
* @param <T> 参数类型
|
||||||
*/
|
*/
|
||||||
public static <T extends Map<String, Object>> void format(T apiParam, Consumer<T> consumer) {
|
public static <T extends Map<String, Object>> void format(T apiParam, Consumer<T> consumer) {
|
||||||
|
String restfulEnableValue = EnvironmentKeys.SOP_RESTFUL_ENABLE.getValue();
|
||||||
|
// restful请求不支持动态修改参数
|
||||||
|
if ("true".equals(restfulEnableValue)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
RequestContext requestContext = RequestContext.getCurrentContext();
|
RequestContext requestContext = RequestContext.getCurrentContext();
|
||||||
consumer.accept(apiParam);
|
consumer.accept(apiParam);
|
||||||
HttpServletRequest request = requestContext.getRequest();
|
HttpServletRequest request = requestContext.getRequest();
|
||||||
|
Reference in New Issue
Block a user