|
@@ -0,0 +1,34 @@
|
|
|
+package io.github.pnoker.gateway.control;
|
|
|
+
|
|
|
+import cn.hutool.json.JSONObject;
|
|
|
+import org.springframework.http.server.reactive.ServerHttpRequest;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.reactive.function.client.WebClient;
|
|
|
+import reactor.core.publisher.Mono;
|
|
|
+import retrofit2.http.POST;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @ClassName TestController
|
|
|
+ * @Description: TODO
|
|
|
+ * @Author LX
|
|
|
+ * @Date 2024/1/31
|
|
|
+ * @Version V1.0
|
|
|
+ **/
|
|
|
+@RestController
|
|
|
+@RequestMapping("/getaway/test")
|
|
|
+public class TestController {
|
|
|
+
|
|
|
+ WebClient webClient = WebClient.builder().codecs(configurer->configurer.defaultCodecs().maxInMemorySize(262144)).build();
|
|
|
+
|
|
|
+ @RequestMapping(value = "/testMono",method = {RequestMethod.POST})
|
|
|
+ public Mono<JSONObject> testMono(ServerHttpRequest serverHttpRequest){
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ jsonObject.set("code","0");
|
|
|
+ jsonObject.set("msg",".success");
|
|
|
+ jsonObject.set("resdata","{'name':'lixing'}");
|
|
|
+ return Mono.just(jsonObject);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|