From 9b051b3ae8a5c08ee5ff3d8b67b37cdfc907804c Mon Sep 17 00:00:00 2001 From: xuqm Date: Tue, 16 May 2023 11:30:42 +0800 Subject: [PATCH] =?UTF-8?q?=E7=83=AD=E9=83=A8=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 6 +++++- .../imserver/controller/HelloController.java | 16 ++++++++++++++++ src/main/resources/application.properties | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 src/main/java/cn/org/bjca/trust/java/imserver/controller/HelloController.java 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