1. 启动类swagger注解改为(对原生swagger做了封装,免swaggerConfig配置类)
@EnableSwagger2Doc
2. pom
<dependency>
<groupId>com.spring4all</groupId>
<artifactId>swagger-spring-boot-starter</artifactId>
<version>1.7.0.RELEASE</version>
</dependency>
3. properties配置文件
swagger:
base-package: com.mayikt.weixin.impl.service
title: SpringCloud2.x构建微服务电商项目-微信服务接口
description: 该项目“基于SpringCloud2.x构建微服务电商项目”
version: 1.1
terms-of-service-url:
contact:
name: qzt
email: [email protected]
url:
enabled: true
搞定.