From db48da5c6c88f9c1f4e09b4cf06981a8674ae577 Mon Sep 17 00:00:00 2001 From: liangjinglin Date: Wed, 18 Dec 2024 22:45:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=95=E5=85=A5springboot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 31 +++++++++++++++++++ src/main/java/com/liang/LiangApplication.java | 12 +++++++ .../com/liang/controller/TestController.java | 14 +++++++++ src/main/resources/application.properties | 3 ++ 4 files changed, 60 insertions(+) create mode 100644 pom.xml create mode 100644 src/main/java/com/liang/LiangApplication.java create mode 100644 src/main/java/com/liang/controller/TestController.java create mode 100644 src/main/resources/application.properties 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