commit db48da5c6c88f9c1f4e09b4cf06981a8674ae577 Author: liangjinglin Date: Wed Dec 18 22:45:46 2024 +0800 引入springboot diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..2377e57 --- /dev/null +++ b/pom.xml @@ -0,0 +1,31 @@ + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.0.4.RELEASE + + + org.example + liang-service + 1.0-SNAPSHOT + Archetype - liang-service + http://maven.apache.org + + + + org.springframework.boot + spring-boot-starter-tomcat + provided + + + + + org.springframework.boot + spring-boot-starter-web + + + + + diff --git a/src/main/java/com/liang/LiangApplication.java b/src/main/java/com/liang/LiangApplication.java new file mode 100644 index 0000000..012c813 --- /dev/null +++ b/src/main/java/com/liang/LiangApplication.java @@ -0,0 +1,12 @@ +package com.liang; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class LiangApplication { + + public static void main(String[] args) { + SpringApplication.run(LiangApplication.class, args); + } +} diff --git a/src/main/java/com/liang/controller/TestController.java b/src/main/java/com/liang/controller/TestController.java new file mode 100644 index 0000000..96ca0c3 --- /dev/null +++ b/src/main/java/com/liang/controller/TestController.java @@ -0,0 +1,14 @@ +package com.liang.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/test") +public class TestController { + + @RequestMapping("/hello") + public String hello(){ + return "这是命运石之门的选择"; + } +} diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties new file mode 100644 index 0000000..02b8cd5 --- /dev/null +++ b/src/main/resources/application.properties @@ -0,0 +1,3 @@ +spring.application.name=liang +server.port=7001 +spring.mvc.static-path-pattern=/** \ No newline at end of file