我爱java系列之---springboot项目集成swagger2
Posted 少年攻城狮
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了我爱java系列之---springboot项目集成swagger2相关的知识,希望对你有一定的参考价值。
网上教程很多,这个是个人收藏的,感谢作者写出这么优秀的文章,小白的福音!
springboot集成swagger2:https://www.liangzl.com/get-article-detail-114901.html
post请求map/json参数 和 map/json返回 自定义map注解实现 附源码:https://blog.csdn.net/a704397849/article/details/100123686
下面这个是对本文档的补充,把不同模块的接口进行分组管理,更清爽。
@Configuration public class SwaggerConfig { private ApiInfo apiInfo() { return new ApiInfoBuilder() .title("模板项目——数据代理模块构建RESTful API") .description("重构-数据代理") .termsOfServiceUrl("") .contact("作者姓名") .version("1.0") .build(); } @Bean public Docket createRestApi1() { return new Docket(DocumentationType.SWAGGER_2) .groupName("路由模块接口") .apiInfo(apiInfo()) .host("188.10.106.47:8099") .select() .apis(RequestHandlerSelectors.basePackage("com.example.routingformo.controller")) .paths(PathSelectors.any()) .build(); } @Bean public Docket createRestApi2() { return new Docket(DocumentationType.SWAGGER_2) .groupName("二级网关模块接口") .apiInfo(apiInfo()) .host("188.10.106.47:8099"
以上是关于我爱java系列之---springboot项目集成swagger2的主要内容,如果未能解决你的问题,请参考以下文章
我爱Java系列之---SpringBoot中常用的注解和两种注入方式
我爱java系列---springboot项目集成zookeeper作为注册中心
我爱java系列之---mysql自动更新创建时间和更新时间