启动类添加@MapperScan({"xxx.xxx.xxx.mapper","xxx.xxx.xxx.mapper"})
swagger配置类添加文章来源地址https://www.toymoban.com/news/detail-640392.html
@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(); }
文章来源:https://www.toymoban.com/news/detail-640392.html
到了这里,关于springboot,swagger多个mapper包,多个controller加载问题的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!