diff --git a/nop-demo/nop-rpc-server-demo/pom.xml b/nop-demo/nop-rpc-server-demo/pom.xml index a6c7a46c0..19f1607f6 100644 --- a/nop-demo/nop-rpc-server-demo/pom.xml +++ b/nop-demo/nop-rpc-server-demo/pom.xml @@ -38,10 +38,35 @@ spring-boot-starter-web + - org.slf4j slf4j-api + org.slf4j + 1.7.30 + + + + ch.qos.logback + logback-classic + 1.2.9 + + + + ch.qos.logback + logback-core + 1.2.9 + + + javax.annotation + javax.annotation-api + + + + org.springframework.boot + spring-boot-starter-logging + + io.github.entropy-cloud nop-api-core diff --git a/nop-demo/nop-rpc-server-demo/src/main/java/spring/test/EchoService.java b/nop-demo/nop-rpc-server-demo/src/main/java/spring/test/EchoService.java index 34b3e237b..6a6f337bb 100644 --- a/nop-demo/nop-rpc-server-demo/src/main/java/spring/test/EchoService.java +++ b/nop-demo/nop-rpc-server-demo/src/main/java/spring/test/EchoService.java @@ -7,16 +7,15 @@ */ package spring.test; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import jakarta.ws.rs.PathParam; -import jakarta.ws.rs.QueryParam; - @RestController public class EchoService { @PostMapping(value = "/echo/{id}") - public String echo(@QueryParam("msg") String msg, @PathParam("id") String id) { + public String echo(@RequestParam("msg") String msg, @PathVariable("id") String id) { return "Hello Nacos Discovery " + msg + ",id=" + id; } } \ No newline at end of file