springboot,swagger多个mapper包,多个controller加载问题

复制代码
启动类添加@MapperScan({"xxx.xxx.xxx.mapper","xxx.xxx.xxx.mapper"})

swagger配置类添加

复制代码
@Bean
public Docket api01() {
    return new Docket(DocumentationType.SWAGGER_2)
            //.enable(swagger_is_enabl)
            .apiInfo(new ApiInfoBuilder().title("你的title")
                    .termsOfServiceUrl("NO terms of service")
                    .license("The Apache License, Version 2.0")
                    .licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html")
                    .version("v1.0")
                    .build())
            .groupName("你的groupname")
            .pathMapping("/")
            .select() // 选择那些路径和api会生成document
            .apis(RequestHandlerSelectors.any())// 对所有api进行监控
            .apis(RequestHandlerSelectors.basePackage("xxx.xxx.web.controller"))//你新的controller路径
            .build();
}
相关推荐
编程火箭车21 分钟前
【Java SE 基础学习打卡】02 计算机硬件与软件
java·电脑选购·计算机基础·编程入门·计算机硬件·软件系统·编程学习路线
Felix_XXXXL1 小时前
IDEA + Spring Boot 的三种热加载方案
java·后端
我命由我123451 小时前
IDEA - IDEA 快速回到页面首尾、页面快速滑动、快速定位到指定行
java·运维·ide·后端·java-ee·intellij-idea·intellij idea
floret. 小花1 小时前
idea2025版本设置springboot加载热部署
spring boot
Mickyจุ๊บ1 小时前
IDEA 插件推荐
java·ide·intellij-idea
命运之光1 小时前
【快速解决】idea运行javafx错误: 缺少 JavaFX 运行时组件, 需要使用该组件来运行此应用程序
java·ide·intellij-idea
学到头秃的suhian7 小时前
Maven
java·maven
小坏讲微服务7 小时前
Docker-compose 搭建Maven私服部署
java·spring boot·后端·docker·微服务·容器·maven