引入springboot
This commit is contained in:
commit
db48da5c6c
31
pom.xml
Normal file
31
pom.xml
Normal file
@ -0,0 +1,31 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.4.RELEASE</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>org.example</groupId>
|
||||
<artifactId>liang-service</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>Archetype - liang-service</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- web -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
12
src/main/java/com/liang/LiangApplication.java
Normal file
12
src/main/java/com/liang/LiangApplication.java
Normal file
@ -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);
|
||||
}
|
||||
}
|
14
src/main/java/com/liang/controller/TestController.java
Normal file
14
src/main/java/com/liang/controller/TestController.java
Normal file
@ -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 "这是命运石之门的选择";
|
||||
}
|
||||
}
|
3
src/main/resources/application.properties
Normal file
3
src/main/resources/application.properties
Normal file
@ -0,0 +1,3 @@
|
||||
spring.application.name=liang
|
||||
server.port=7001
|
||||
spring.mvc.static-path-pattern=/**
|
Loading…
Reference in New Issue
Block a user