idea 2023 empty project New Module
idea 2023.3.8
File — New — Project
springboot-demo2
new — module
http://127.0.0.1:8080/hello?name=lisi
添加代码
添加代码1
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/books")
添加代码2
@GetMapping
public String getById() {
System.out.println("springboot is running... ");
return "springboot is running...";
}
测试
http://127.0.0.1:8080/books