Skip to content

Commit cae5982

Browse files
committed
更加详细的dubbo param
1 parent 667f27a commit cae5982

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

mse-simple-demo/A/src/main/java/com/alibabacloud/mse/demo/a/AController.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@
2121
import org.springframework.cloud.commons.util.InetUtils;
2222
import org.springframework.http.HttpStatus;
2323
import org.springframework.http.ResponseEntity;
24-
import org.springframework.web.bind.annotation.GetMapping;
25-
import org.springframework.web.bind.annotation.PathVariable;
26-
import org.springframework.web.bind.annotation.RequestMapping;
27-
import org.springframework.web.bind.annotation.RestController;
24+
import org.springframework.web.bind.annotation.*;
2825
import org.springframework.web.client.RestTemplate;
2926

3027
import javax.annotation.PostConstruct;
@@ -229,7 +226,7 @@ public String aZone(HttpServletRequest request) {
229226

230227
@ApiOperation(value = "Dubbo 全链路灰度入口", tags = {"入口应用"})
231228
@GetMapping("/dubbo")
232-
public String dubbo(HttpServletRequest request) {
229+
public String dubbo(HttpServletRequest request, @RequestParam(required = false) String param) {
233230
StringBuilder headerSb = new StringBuilder();
234231
Enumeration<String> enumeration = request.getHeaderNames();
235232
while (enumeration.hasMoreElements()) {
@@ -241,7 +238,7 @@ public String dubbo(HttpServletRequest request) {
241238
}
242239
}
243240
return "A" + serviceTag + "[" + inetUtils.findFirstNonLoopbackAddress().getHostAddress() + "]" + " -> " +
244-
helloServiceB.hello(JSON.toJSONString(request.getParameterMap()));
241+
helloServiceB.hello(param);
245242
}
246243

247244

0 commit comments

Comments
 (0)