直接在Idea操作,我的idea版本是2023.2
1.首先打开IDEA,点击create new project
2.新建一个controller类,编写以下代码
package com.summer.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class Controller {
@RequestMapping("/hello")
public String hello(){
System.out.println("OK!");
return "hello SpringBoot!!!!";
}
}
3.在Application处点击run运行