问题描述 解决方案: 在启动类添加:@SpringBootApplication(scanBasePackages={“com.example.chart2.controller”,“com.example.chart2.service”}) 包含你所需要扫描到的包