安装idea
File -> New Project

选择依赖
创建controller文件
输入controller类名
输入代码
运行项目
访问
localhost:8080/hello/boot
java
package com.example.demo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/hello")
public class HelloController {
@RequestMapping("/boot")
public String helloBoot() {
return "Hello Spring Boot hha";
}
}