This commit is contained in:
2019-07-05 21:46:04 +08:00
commit 12349ed679
8 changed files with 152 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
package top.fjy8018.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
@RequestMapping("/{content}")
public String helloWorld(@PathVariable(name = "content", required = false) String content) {
return "hello , " + content;
}
}

View File

@@ -0,0 +1,2 @@
server:
port: 8080

View File

@@ -0,0 +1,16 @@
package top.fjy8018.demo;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class DemoApplicationTests {
@Test
public void contextLoads() {
}
}