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();
}
相关推荐
杨哥带你写代码16 分钟前
足球青训俱乐部管理:Spring Boot技术驱动
java·spring boot·后端
郭二哈42 分钟前
C++——模板进阶、继承
java·服务器·c++
A尘埃1 小时前
SpringBoot的数据访问
java·spring boot·后端
yang-23071 小时前
端口冲突的解决方案以及SpringBoot自动检测可用端口demo
java·spring boot·后端
沉登c1 小时前
幂等性接口实现
java·rpc
代码之光_19801 小时前
SpringBoot校园资料分享平台:设计与实现
java·spring boot·后端
科技资讯早知道2 小时前
java计算机毕设课设—坦克大战游戏
java·开发语言·游戏·毕业设计·课程设计·毕设
苹果醋32 小时前
快速玩转 Mixtral 8x7B MOE大模型!阿里云机器学习 PAI 推出最佳实践
spring boot·nginx·毕业设计·layui·课程设计
程序员大金2 小时前
基于SpringBoot+Vue+MySQL的装修公司管理系统
vue.js·spring boot·mysql
小比卡丘3 小时前
C语言进阶版第17课—自定义类型:联合和枚举
android·java·c语言