commit
This commit is contained in:
22
src/main/java/top/fjy8018/demo/DemoApplication.java
Normal file
22
src/main/java/top/fjy8018/demo/DemoApplication.java
Normal 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;
|
||||
}
|
||||
|
||||
}
|
||||
2
src/main/resources/application.yml
Normal file
2
src/main/resources/application.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
server:
|
||||
port: 8080
|
||||
16
src/test/java/top/fjy8018/demo/DemoApplicationTests.java
Normal file
16
src/test/java/top/fjy8018/demo/DemoApplicationTests.java
Normal 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() {
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user