Support path parameter such as /user/{userId} #432

This commit is contained in:
hongqiaowei
2023-05-15 18:18:15 +08:00
parent 21527576b1
commit 8824172ca6

View File

@@ -56,11 +56,8 @@ import reactor.core.scheduler.Schedulers;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.HashMap; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Set;
/** /**
* @author Francis Dong * @author Francis Dong
@@ -160,7 +157,9 @@ public class AggregateFilter implements WebFilter {
clientInput.put("headers", headers); clientInput.put("headers", headers);
clientInput.put("params", MapUtil.toHashMap(request.getQueryParams())); clientInput.put("params", MapUtil.toHashMap(request.getQueryParams()));
clientInput.put("contentType", request.getHeaders().getFirst(CommonConstants.HEADER_CONTENT_TYPE)); clientInput.put("contentType", request.getHeaders().getFirst(CommonConstants.HEADER_CONTENT_TYPE));
clientInput.put("pathParams", com.fizzgate.util.ThreadContext.get("pathParams")); Map<String, Object> pathParams = (Map<String, Object>) com.fizzgate.util.ThreadContext.get("pathParams");
clientInput.put("pathParams", pathParams == null ? Collections.emptyMap() : pathParams);
com.fizzgate.util.ThreadContext.remove("pathParams");
Mono<AggregateResult> result = null; Mono<AggregateResult> result = null;
MediaType contentType = request.getHeaders().getContentType(); MediaType contentType = request.getHeaders().getContentType();