diff --git a/pom.xml b/pom.xml index b8d3156..8697cef 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,11 @@ org.springframework.boot spring-boot-starter-web - + + + org.springframework.boot + spring-boot-devtools + org.springframework.boot spring-boot-starter-test diff --git a/src/main/java/cn/org/bjca/trust/java/imserver/controller/HelloController.java b/src/main/java/cn/org/bjca/trust/java/imserver/controller/HelloController.java new file mode 100644 index 0000000..7c6ce96 --- /dev/null +++ b/src/main/java/cn/org/bjca/trust/java/imserver/controller/HelloController.java @@ -0,0 +1,16 @@ +package cn.org.bjca.trust.java.imserver.controller; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("hello") +public class HelloController { + @GetMapping("/{id}") + public String getById(@PathVariable String id) throws Exception { + System.out.println("id ==> " + id); + return "{\n" + " \"msg\": \"qdxorigin\",\n" + " \"status\": \"201\",\n" + " \"data\": \"Sbfuiaefhaikufhcsauik\"\n" + "}"; + } +} diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 8b13789..40325f4 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1 +1 @@ - +server.port=4561