Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
kt-keystone
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
kt-keystone
Commits
ef0e8f10
提交
ef0e8f10
authored
3月 09, 2022
作者:
mry
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
style(web): 修改了swagger,隐藏了error
上级
09e61aa0
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
5 行增加
和
2 行删除
+5
-2
SwaggerConfigApi.java
...ain/java/org/matrix/autotest/config/SwaggerConfigApi.java
+5
-2
没有找到文件。
kt-web/src/main/java/org/matrix/autotest/config/SwaggerConfigApi.java
浏览文件 @
ef0e8f10
package
org
.
matrix
.
autotest
.
config
;
package
org
.
matrix
.
autotest
.
config
;
import
com.google.common.base.Predicates
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
springfox.documentation.builders.ApiInfoBuilder
;
import
springfox.documentation.builders.ApiInfoBuilder
;
...
@@ -17,17 +18,19 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
...
@@ -17,17 +18,19 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
public
class
SwaggerConfigApi
{
public
class
SwaggerConfigApi
{
@Bean
@Bean
public
Docket
createRestApi
(){
public
Docket
createRestApi
()
{
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
//将api的单元信息者只为包含在json ResourceListing响应中。
//将api的单元信息者只为包含在json ResourceListing响应中。
.
apiInfo
(
apiInfo
())
.
apiInfo
(
apiInfo
())
//选择哪些接口作为swagger的doc发布
//选择哪些接口作为swagger的doc发布
.
select
()
.
select
()
//不显示错误的接口地址
.
paths
(
Predicates
.
not
(
PathSelectors
.
regex
(
"/error.*"
)))
.
paths
(
PathSelectors
.
any
())
.
paths
(
PathSelectors
.
any
())
.
build
();
.
build
();
}
}
public
ApiInfo
apiInfo
(){
public
ApiInfo
apiInfo
()
{
return
new
ApiInfoBuilder
()
return
new
ApiInfoBuilder
()
//标题
//标题
.
title
(
"自动测试系统"
)
.
title
(
"自动测试系统"
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论