diff --git a/springboot-web-quickstart/pom.xml b/springboot-web-quickstart/pom.xml new file mode 100644 index 0000000..bd20022 --- /dev/null +++ b/springboot-web-quickstart/pom.xml @@ -0,0 +1,62 @@ + + + 4.0.0 + + + org.springframework.boot + spring-boot-starter-parent + 3.5.14 + + + + com.inmind + springboot-web-quickstart + 0.0.1-SNAPSHOT + + springboot-web-quickstart + springboot-web-quickstart + + + + + + + + + + + + + + + + 17 + + + + + + org.springframework.boot + spring-boot-starter-web + + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/springboot-web-quickstart/src/main/java/com/inmind/SpringbootWebQuickstartApplication.java b/springboot-web-quickstart/src/main/java/com/inmind/SpringbootWebQuickstartApplication.java new file mode 100644 index 0000000..77aaca4 --- /dev/null +++ b/springboot-web-quickstart/src/main/java/com/inmind/SpringbootWebQuickstartApplication.java @@ -0,0 +1,14 @@ +package com.inmind; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/*启动类:启动当前的springboot项目*/ +@SpringBootApplication +public class SpringbootWebQuickstartApplication { + + public static void main(String[] args) { + SpringApplication.run(SpringbootWebQuickstartApplication.class, args); + } + +} diff --git a/springboot-web-quickstart/src/main/java/com/inmind/controller/HelloController.java b/springboot-web-quickstart/src/main/java/com/inmind/controller/HelloController.java new file mode 100644 index 0000000..5f0a980 --- /dev/null +++ b/springboot-web-quickstart/src/main/java/com/inmind/controller/HelloController.java @@ -0,0 +1,15 @@ +package com.inmind.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +//请求处理类 +@RestController +public class HelloController { + + @RequestMapping(value = "/hello") + public String hello(){ + System.out.println("hello world"); + return "hello world,这是一个springboot工程"; + } +} diff --git a/springboot-web-quickstart/src/main/resources/application.properties b/springboot-web-quickstart/src/main/resources/application.properties new file mode 100644 index 0000000..aa595e2 --- /dev/null +++ b/springboot-web-quickstart/src/main/resources/application.properties @@ -0,0 +1 @@ +spring.application.name=springboot-web-quickstart \ No newline at end of file diff --git a/springboot-web-quickstart/src/test/java/com/inmind/SpringbootWebQuickstartApplicationTests.java b/springboot-web-quickstart/src/test/java/com/inmind/SpringbootWebQuickstartApplicationTests.java new file mode 100644 index 0000000..265a020 --- /dev/null +++ b/springboot-web-quickstart/src/test/java/com/inmind/SpringbootWebQuickstartApplicationTests.java @@ -0,0 +1,13 @@ +package com.inmind; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class SpringbootWebQuickstartApplicationTests { + + @Test + void contextLoads() { + } + +}