idea 2023 创建 springboot 项目 LTS
idea 版本 2023.3.8
参考
idea 阿里 建立 springboot 工程 方法 LTS
https://blog.youkuaiyun.com/wowocpp/article/details/124692532
File ---- New ---- Project
https://start.spring.io/
http://start.aliyun.com
http://127.0.0.1:8080/hello?name=lisi
1 添加测试代码
新建package : Controller
新建 java class BookController
内容如下:
package com.itheima.springbootdemo1.Controller;
public class BookController {
}
添加代码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