xiehuanqun 1 ay önce
ebeveyn
işleme
a4e218e3e9

+ 6 - 0
pom.xml

@@ -40,6 +40,12 @@
             <artifactId>spring-boot-starter-test</artifactId>
             <scope>test</scope>
         </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+
     </dependencies>
 
     <profiles>

+ 0 - 2
src/main/java/com/example/TestApplication.java

@@ -11,7 +11,5 @@ public class TestApplication {
         System.out.println("  __                       \n" +
                 " (_ _|_  _. ._ _|_  _   _| \n" +
                 " __) |_ (_| |   |_ (/_ (_|");
-        System.out.println("test1");
     }
-
 }

+ 12 - 0
src/main/java/com/example/test/controller/HelloController.java

@@ -0,0 +1,12 @@
+package com.example.test.controller;
+
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+public class HelloController {
+    @GetMapping("/")
+    public String hello() {
+        return "Hello Spring Boot!";
+    }
+}