SpringBoot 多模块项目启动报404

最近搭建了一个springboot多模块项目:common、model、dao、service、controller
目录结构如下图所示:
图片说明

application.yml如下:**_

     spring:
        datasource:
            url: jdbc:mysql://localhost:3306/classroom?useUnicode=true&characterEncoding=UTF-8&useSSL=true
            username: root
            password: root
            driver-class-name: com.mysql.jdbc.Driver

**主类WebApplication在WEB模块,代码如下:**

@SpringBootApplication(scanBasePackages = {"cn.zz.dao","cn.zz.web","cn.zz.service"})
public class WebApplication {

    public static void main(String[] args) {
        System.out.println("start....");
        SpringApplication.run(WebApplication.class, args);
    }
}

图片说明

在cn.zz.controller包下面创建了一个TestController用作测试,代码如下:

@RestController
@Slf4j
@RequestMapping("/test")
public class TestController {

    @RequestMapping("/hello")
    public String test() {
        log.debug("hello");
        return "hello";
    }
}

运行主类,没有报错

图片说明

浏览器输入http://localhost:8080/test/hello

图片说明

在Endpoit里面没有找到TestController,怀疑是没有将TestController放入spring容器,但应该能扫描的到阿,真是让人头大,大家知道怎么回事吗┭┮﹏┭┮
图片说明

你把接口方法上的@RequestMapper 改成 @GetMapper试试

/test/hello这个接口在哪个模块下?还有能把启动日志也贴一下吗?

@RestController改成@Controller试试?