1,添加配置类

@Configuration
@EnableSwagger2
@Profile({"default", "dev-online", "test"})
public class SwaggerConfiguration { @Bean
public Docket appDoc() {
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(appApiInfo())
.directModelSubstitute(Date.class, Double.class)
.directModelSubstitute(LocalDate.class, Double.class)
.select()
.apis(RequestHandlerSelectors.basePackage("com.example.multidatasource.web"))//换成对应应用入口层级
.paths(PathSelectors.any())
.build();
} private ApiInfo appApiInfo() {
return new ApiInfoBuilder()
.title("plan-warehousing 接口文档")
.version("1.0.0")
.build();
} }

2,添加pom文件

<!--swagger支持 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>swagger-bootstrap-ui</artifactId>
<version>1.9.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.7.0</version>
</dependency>

3,浏览器访问http://localhost:80/doc.html  服务对应端口号

springboot配置swagger的更多相关文章

  1. SpringBoot配置Swagger实例(POST接收json参数)

    工程目录结构: 首先,引入jar包,只需要以下两个即可 <dependency> <groupId>io.springfox</groupId> <artif ...

  2. springboot 集成swagger ui

    springboot 配置swagger ui 1. 添加依赖 <!-- swagger ui --> <dependency> <groupId>io.sprin ...

  3. 整合 springboot 和 swagger出问题

    整合 springboot 和 swagger ,出现报错, org.springframework.beans.factory.UnsatisfiedDependencyException: Err ...

  4. SpringBoot集成Swagger接口管理工具

    手写Api文档的几个痛点: 文档需要更新的时候,需要再次发送一份给前端,也就是文档更新交流不及时. 接口返回结果不明确 不能直接在线测试接口,通常需要使用工具,比如postman 接口文档太多,不好管 ...

  5. SpringBoot 整合swagger

    springBoot 整合swagger 1.pom.xml 配置 <dependency> <groupId>io.springfox</groupId> < ...

  6. spring-boot 集成 swagger 问题的解决

    spring-boot 集成 swagger 网上有许多关于 spring boot 集成 swagger 的教程.按照教程去做,发现无法打开接口界面. 项目由 spring mvc 迁移过来,是一个 ...

  7. SpringBoot整合Swagger和Actuator

    前言 本篇文章主要介绍的是SpringBoot整合Swagger(API文档生成框架)和SpringBoot整合Actuator(项目监控)使用教程. SpringBoot整合Swagger 说明:如 ...

  8. springboot之swagger快速启动

    springboot之swagger快速启动 简介 介绍 可能大家都有用过swagger,可以通过ui页面显示接口信息,快速和前端进行联调. 没有接触的小伙伴可以参考官网文章进行了解下demo页面. ...

  9. SpringBoot整合Swagger实战

    源码地址:https://github.com/laolunsi/spring-boot-examples 目前SpringBoot常被用于开发Java Web应用,特别是前后端分离项目.为方便前后端 ...

随机推荐

  1. 【转载】【原创】华硕F8TR笔记本更换主板及喇叭教程

    转载地址:http://blog.sina.com.cn/s/blog_6241aaed0102w4e6.html [原创]华硕F8TR笔记本更换主板及喇叭教程     华硕AUSU F8TR笔记本 ...

  2. Networked Graphics: Building Networked Games and Virtual Environments (Anthony Steed / Manuel Fradinho Oliveira 著)

    PART I GROUNDWORK CHAPTER 1 Introduction CHAPTER 2 One on One (101) CHAPTER 3 Overview of the Intern ...

  3. Hi3519V101+IMX274开发板调试经验

    1.uboot没换 2.内核网络不对,其它的正常, sudo apt-get install libncurses5-dev sudo apt-get install u-boot-tools 3.根 ...

  4. Python之 操作 MySQL 数据库

    什么是MySQLdb? MySQLdb 是用于Python链接Mysql数据库的接口,它实现了 Python 数据库 API 规范 V2.0,基于 MySQL C API 上建立的. 安装 Pytho ...

  5. Winform外包团队 项目案例展示

    北京动点飞扬软件开发团队 C# WInform项目案例展示 长年承接WInForm C#项目开发,商业案例欢迎联系我们索取 有相关项目外包定制开发 欢迎联系我们 qq372900288 Tel 139 ...

  6. 联想T470笔记本GPT改MBR分区

    联想T470笔记本GPT改MBR分区 7000多元买的,这个笔记本配置还可以,就是感觉特别卡顿,于是想重做WIN7系统,为了方便激活,想把GPT分区改成MBR分区. 进入微PE1.2,用傲梅分区助手删 ...

  7. 通过 Git 上传代码到 GitHub 必要操作详解

    目录 Git 介绍 起步 下载 配置 准备 在 GitHub 上创建 SSH Key 提交 修改代码 更多信息 Git 欢迎来到 Git 的学习. 介绍 首先先了解一下 Git. Git,是一个开源的 ...

  8. 如何启用小米手机5c的ROOT权限

    小米手机5c怎么样开通了root超级权限?大家都知道,android设备有root超级权限,一旦手机开通了root相关权限,能够实现更强大的功能,举个例子大家部门的营销部门的同事,使用某些营销应用都需 ...

  9. Java核心-多线程-并发控制器-CountDownLatch倒数闩

    1.基本概念 CountDownLatch,中文名倒数闩,jdk并发工具包中一个并发控制器,它抽象了一个常见的多线程并发场景,开发人员使用它可以写出同时兼顾线程安全性与高效率的代码. 2.抽象模型 相 ...

  10. Struts S2-048 RCE漏洞分析

    应该是S2-048目前最详细的一篇了.. 漏洞影响 Struts 2.3.x系列中的Showcase应用 使用了struts1 插件,并在使用ActionMessages时将客户端可控的参数拼接传递给 ...