1. 引入swagger

2. swagger Admin 聚合
This commit is contained in:
b2baccline
2019-11-17 17:53:03 +08:00
parent 83eb5159e4
commit 30688e3c8c
23 changed files with 549 additions and 22 deletions

View File

@@ -29,7 +29,17 @@
<groupId>com.hccake</groupId>
<artifactId>ballcat-common-log</artifactId>
</dependency>
<!-- swagger 文档聚合 -->
<dependency>
<groupId>com.hccake</groupId>
<artifactId>ballcat-common-swagger</artifactId>
</dependency>
<!-- swagger 增强版 ui -->
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-ui</artifactId>
<version>1.9.6</version>
</dependency>
<!--mybatis plus-->
<dependency>
<groupId>com.baomidou</groupId>
@@ -60,11 +70,7 @@
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
</dependency>
<!--swagger-->
<dependency>
<groupId>com.spring4all</groupId>
<artifactId>swagger-spring-boot-starter</artifactId>
</dependency>
<!--监控Client-->
<dependency>
<groupId>de.codecentric</groupId>

View File

@@ -9,6 +9,7 @@ import org.springframework.boot.web.servlet.ServletComponentScan;
* @author Hccake
*/
/*@EnableXxlJob*/
/*@EnableSwagger2Aggregator*/
@EnableAccessLog
@ServletComponentScan("com.hccake.ballcat.admin.oauth.filter")
@SpringBootApplication

View File

@@ -49,8 +49,13 @@ public class CustomResourceServerConfigurer extends ResourceServerConfigurerAdap
http
// 拦截 url 配置
.authorizeRequests()
// TODO Actuator权限控制
.antMatchers("/actuator/**").permitAll()
.antMatchers("/doc.html").permitAll()
.antMatchers("/v2/api-docs",
"/swagger-resources/**",
"/swagger-ui.html**",
"/webjars/**",
"favicon.ico").permitAll()
.anyRequest().authenticated()

View File

@@ -6,4 +6,8 @@ spring:
redis:
host: ballcat-redis
password: ''
port: 6379
port: 6379
# 生产环境关闭文档
swagger:
enabled: false

View File

@@ -6,12 +6,12 @@ spring:
name: @artifactId@
profiles:
active: @profiles.active@ # 当前激活配置默认dev
boot:
admin:
client:
url: http://ballcat-monitor:9999
username: admin
password: 123456
# boot:
# admin:
# client:
# url: http://ballcat-monitor:9999
# username: admin
# password: 123456
# 暴露监控端口
management:
@@ -48,3 +48,20 @@ monitor:
# port: 7888 #通讯端口
# appName: ballcat-admin-job
swagger:
title: BallCat-Admin Docs
group-name: ballcat-admin
description: BallCat 后台管理服务Api文档
version: 0.0.1
license: Powered By BallCat
licenseUrl: http://www.ballcat.cn/
terms-of-service-url: http://www.ballcat.cn/
contact:
name: Hccake
email: chengbohua@foxmail.com
url: https://github.com/Hccake
provider:
resources:
- {name: ballcat-api, url: http://ballcat-api:9090/v2/api-docs, swagger-version: 2.0}