一、添加依赖
在最外层的ecs-parent.pom添加依赖
<dependency><groupId>com.spring4all</groupId><artifactId>swagger-spring-boot-starter</artifactId><version>1.8.0.RELEASE</version></dependency>
二、添加配置
在微服务中添加YAML配置
#swagger相关配置swagger:base-package: com.yhh.member.controllertitle: SpringCloud2.x构建企业级微服务项目-会员模块接口description: 该项目“基于SpringCloud2.x构建企业级微服务项目”version: 1.1terms-of-service-url: www.xxxx.comcontact:name: xbemail: xxxxxxx@qq.com#启动类上加上:@EnableSwagger2Doc注解
