缺少添加依赖。

1.在pom.xml 配置

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
import change 添加以上依赖之后 ,重新添加

2,如果方法1 还没有解决,可以手动导包

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

posted on 2021-02-26 16:08  灯火、阑珊处  阅读(1266)  评论(0编辑  收藏  举报