瀏覽代碼

热部署

xuqm 1 年之前
父節點
當前提交
9b051b3ae8

+ 5 - 1
pom.xml

@@ -21,7 +21,11 @@
 			<groupId>org.springframework.boot</groupId>
 			<artifactId>spring-boot-starter-web</artifactId>
 		</dependency>
-
+		<!--引入热部署依赖-->
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-devtools</artifactId>
+		</dependency>
 		<dependency>
 			<groupId>org.springframework.boot</groupId>
 			<artifactId>spring-boot-starter-test</artifactId>

+ 16 - 0
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" + "}";
+    }
+}

+ 1 - 1
src/main/resources/application.properties

@@ -1 +1 @@
-
+server.port=4561