Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
kt-keystone
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
kt-keystone
Commits
ea3f75eb
提交
ea3f75eb
authored
7月 11, 2022
作者:
mry
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(web): swagger解析
上级
c03fc597
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
449 行增加
和
50 行删除
+449
-50
SwaggerController.java
...ava/org/matrix/autotest/controller/SwaggerController.java
+247
-41
AttributeInVo.java
...va/org/matrix/autotest/swaggerEntityVo/AttributeInVo.java
+46
-0
AttributeOutVo.java
...est/swaggerEntityVo/definitionsEntity/AttributeOutVo.java
+39
-0
DefinitionsVo.java
...test/swaggerEntityVo/definitionsEntity/DefinitionsVo.java
+26
-0
PropertiesVo.java
...otest/swaggerEntityVo/definitionsEntity/PropertiesVo.java
+28
-0
CodeStatusVo.java
...utotest/swaggerEntityVo/responsesEntity/CodeStatusVo.java
+26
-0
ResponsesVo.java
...autotest/swaggerEntityVo/responsesEntity/ResponsesVo.java
+26
-0
PathVo.java
...matrix/autotest/swaggerEntityVo/swaggerEntity/PathVo.java
+6
-4
SwaggerOuter.java
.../autotest/swaggerEntityVo/swaggerEntity/SwaggerOuter.java
+3
-3
TagSummary.java
...ix/autotest/swaggerEntityVo/swaggerEntity/TagSummary.java
+2
-2
没有找到文件。
kt-web/src/main/java/org/matrix/autotest/controller/SwaggerController.java
浏览文件 @
ea3f75eb
...
...
@@ -3,13 +3,19 @@ package org.matrix.autotest.controller;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.matrix.autotest.swaggerEntity.PathVo
;
import
org.matrix.autotest.swaggerEntity.SwaggerOuter
;
import
org.matrix.autotest.swaggerEntity.TagSummary
;
import
org.matrix.autotest.swaggerEntityVo.AttributeInVo
;
import
org.matrix.autotest.swaggerEntityVo.definitionsEntity.AttributeOutVo
;
import
org.matrix.autotest.swaggerEntityVo.definitionsEntity.DefinitionsVo
;
import
org.matrix.autotest.swaggerEntityVo.definitionsEntity.PropertiesVo
;
import
org.matrix.autotest.swaggerEntityVo.responsesEntity.CodeStatusVo
;
import
org.matrix.autotest.swaggerEntityVo.responsesEntity.ResponsesVo
;
import
org.matrix.autotest.swaggerEntityVo.swaggerEntity.PathVo
;
import
org.matrix.autotest.swaggerEntityVo.swaggerEntity.SwaggerOuter
;
import
org.matrix.autotest.swaggerEntityVo.swaggerEntity.TagSummary
;
import
org.matrix.exception.GlobalException
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.bind.annotation.*
;
import
java.io.BufferedReader
;
...
...
@@ -36,49 +42,21 @@ import java.util.stream.Collectors;
public
class
SwaggerController
{
/**
* 读取swagger地址里的JSON信息
*
* @param url swagger地址
* @return swagger中的JSON数据
*/
public
String
loadJson
(
String
url
)
{
StringBuilder
json
=
new
StringBuilder
();
try
{
URL
urlObject
=
new
URL
(
url
);
URLConnection
uc
=
urlObject
.
openConnection
();
InputStream
inputStream
=
uc
.
getInputStream
();
BufferedReader
reader
=
new
BufferedReader
(
new
InputStreamReader
(
inputStream
,
StandardCharsets
.
UTF_8
));
String
inputLine
;
while
((
inputLine
=
reader
.
readLine
())
!=
null
)
{
json
.
append
(
inputLine
);
}
reader
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
throw
new
GlobalException
(
String
.
format
(
"请求swagger数据失败,您读的swagger地址ip为 %s"
,
url
));
}
return
json
.
toString
();
}
/**
* 解析所有的接口
*
* @param url swagger中ip:端口/v2/api-docs地址
* @return 封装好的接口信息
* 解析swaggerJson
*/
@GetMapping
@ApiOperation
(
"
解析swagger
"
)
public
JSONObject
getPaths
(
@RequestParam
String
url
)
{
@ApiOperation
(
"
获取并解析swagger数据
"
)
public
JSONObject
handleSwagger
(
@RequestParam
String
url
)
{
String
loadJson
=
loadJson
(
url
);
JSONObject
swaggerJson
=
JSONObject
.
parseObject
(
loadJson
);
SwaggerOuter
json
=
new
SwaggerOuter
();
String
host
=
String
.
valueOf
(
swaggerJson
.
get
(
"host"
));
String
basePath
=
String
.
valueOf
(
swaggerJson
.
get
(
"basePath"
));
JSONObject
paths
=
swaggerJson
.
getJSONObject
(
"paths"
);
JSONObject
definitions
=
swaggerJson
.
getJSONObject
(
"definitions"
);
json
.
setHost
(
host
);
String
basePath
=
String
.
valueOf
(
swaggerJson
.
get
(
"basePath"
));
json
.
setBasePath
(
basePath
);
List
<
DefinitionsVo
>
definitions
=
handleDefinitions
(
swaggerJson
);
json
.
setDefinitions
(
definitions
);
JSONObject
paths
=
swaggerJson
.
getJSONObject
(
"paths"
);
List
<
PathVo
>
list
=
new
ArrayList
<>();
if
(
paths
!=
null
)
{
for
(
Map
.
Entry
<
String
,
Object
>
stringObjectEntry
:
paths
.
entrySet
())
{
...
...
@@ -86,14 +64,14 @@ public class SwaggerController {
//请求方式
JSONObject
pathJson
=
paths
.
getJSONObject
(
pathUrl
);
Set
<
String
>
methodSets
=
pathJson
.
keySet
();
if
(
CollectionUtils
.
isNot
Empty
(
methodSets
))
{
if
(
!
CollectionUtils
.
is
Empty
(
methodSets
))
{
for
(
String
httpMethod
:
methodSets
)
{
PathVo
pathVo
=
new
PathVo
();
JSONObject
methodJson
=
pathJson
.
getJSONObject
(
httpMethod
);
JSONArray
tags
=
methodJson
.
getJSONArray
(
"tags"
);
String
summary
=
methodJson
.
getString
(
"summary"
);
JSONArray
parameters
=
methodJson
.
getJSONArray
(
"parameters"
);
JSONObject
responses
=
methodJson
.
getJSONObject
(
"responses"
);
List
<
ResponsesVo
>
responsesVos
=
handleResponse
(
methodJson
);
String
operationId
=
methodJson
.
getString
(
"operationId"
);
String
deprecated
=
methodJson
.
getString
(
"deprecated"
);
JSONArray
consumes
=
methodJson
.
getJSONArray
(
"consumes"
);
...
...
@@ -106,7 +84,7 @@ public class SwaggerController {
pathVo
.
setOperationId
(
operationId
);
pathVo
.
setConsumes
(
consumes
);
pathVo
.
setParameters
(
parameters
);
pathVo
.
setResponses
(
responses
);
pathVo
.
setResponses
(
responses
Vos
);
pathVo
.
setDeprecated
(
deprecated
);
pathVo
.
setSecurity
(
security
);
pathVo
.
setProduces
(
produces
);
...
...
@@ -135,4 +113,231 @@ public class SwaggerController {
return
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
json
));
}
/**
* 读取swagger地址里的JSON信息
*
* @param url swagger地址
* @return swagger中的JSON数据
*/
public
String
loadJson
(
String
url
)
{
StringBuilder
json
=
new
StringBuilder
();
try
{
URL
urlObject
=
new
URL
(
url
);
URLConnection
uc
=
urlObject
.
openConnection
();
InputStream
inputStream
=
uc
.
getInputStream
();
BufferedReader
reader
=
new
BufferedReader
(
new
InputStreamReader
(
inputStream
,
StandardCharsets
.
UTF_8
));
String
inputLine
;
while
((
inputLine
=
reader
.
readLine
())
!=
null
)
{
json
.
append
(
inputLine
);
}
reader
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
throw
new
GlobalException
(
String
.
format
(
"请求swagger数据失败,您读的swagger地址ip为 %s"
,
url
));
}
return
json
.
toString
();
}
/**
* 处理responses中的数据
*/
public
List
<
ResponsesVo
>
handleResponse
(
JSONObject
methodJson
)
{
List
<
ResponsesVo
>
list
=
new
ArrayList
<>();
JSONObject
responses
=
methodJson
.
getJSONObject
(
"responses"
);
if
(
responses
!=
null
)
{
//所有状态码
Set
<
String
>
codes
=
responses
.
keySet
();
for
(
String
code
:
codes
)
{
ResponsesVo
responsesVo
=
new
ResponsesVo
();
JSONObject
responseInside
=
responses
.
getJSONObject
(
code
);
responsesVo
.
setCode
(
code
);
CodeStatusVo
codeStatusVo
=
new
CodeStatusVo
();
//获取描述
String
description
=
responseInside
.
getString
(
"description"
);
codeStatusVo
.
setDescription
(
description
);
if
(
"200"
.
equals
(
code
))
{
JSONObject
schema
=
responseInside
.
getJSONObject
(
"schema"
);
AttributeInVo
attributeInVo
=
handleItems
(
schema
);
codeStatusVo
.
setAttributeInVo
(
attributeInVo
);
}
else
{
//非200时状态码
responsesVo
.
setCodeStatusVo
(
codeStatusVo
);
}
responsesVo
.
setCodeStatusVo
(
codeStatusVo
);
list
.
add
(
responsesVo
);
}
}
return
list
;
}
/**
* 解析host解析definitions
*/
public
List
<
DefinitionsVo
>
handleDefinitions
(
JSONObject
swaggerJson
)
{
//多个definitions,最外层
List
<
DefinitionsVo
>
list
=
new
ArrayList
<>();
//取到definitions内部的对象
JSONObject
definitions
=
swaggerJson
.
getJSONObject
(
"definitions"
);
if
(
definitions
!=
null
)
{
//对象名称集合
Set
<
String
>
objNames
=
definitions
.
keySet
();
//获取到每个对象
for
(
String
objName
:
objNames
)
{
//List内的最外层结构
DefinitionsVo
definitionsVo
=
new
DefinitionsVo
();
//definitionsVo的内部是attributeVo
AttributeOutVo
attributeOutVo
=
new
AttributeOutVo
();
//根据对象名称可以取到,所有对象内部的信息,包括对象的类型type,properties,对象名称title,以及描述description
JSONObject
objInside
=
definitions
.
getJSONObject
(
objName
);
String
type
=
objInside
.
getString
(
"type"
);
String
title
=
objInside
.
getString
(
"title"
);
String
description
=
objInside
.
getString
(
"description"
);
attributeOutVo
.
setType
(
type
);
attributeOutVo
.
setTitle
(
title
);
attributeOutVo
.
setDescription
(
description
);
//取到每个对象的properties
JSONObject
properties
=
objInside
.
getJSONObject
(
"properties"
);
if
(
properties
!=
null
)
{
List
<
PropertiesVo
>
propertiesVoList
=
handleProperties
(
properties
);
attributeOutVo
.
setPropertiesVoList
(
propertiesVoList
);
}
//可能出现直接就是additionalProperties,
JSONObject
additionalProperties
=
objInside
.
getJSONObject
(
"additionalProperties"
);
if
(
additionalProperties
!=
null
)
{
AttributeInVo
attributeInVo
=
handleItems
(
additionalProperties
);
attributeOutVo
.
setAdditionalProperties
(
attributeInVo
);
}
definitionsVo
.
setObjName
(
objName
);
definitionsVo
.
setAttributeOutVo
(
attributeOutVo
);
list
.
add
(
definitionsVo
);
}
}
return
list
;
}
/**
* 处理definitions内第一层的properties
*/
public
List
<
PropertiesVo
>
handleProperties
(
JSONObject
properties
)
{
List
<
PropertiesVo
>
list
=
new
ArrayList
<>();
if
(
properties
!=
null
)
{
Set
<
String
>
attributeNames
=
properties
.
keySet
();
//每个对象中,可能存在多个属性
for
(
String
attributeName
:
attributeNames
)
{
//获取到对象中属性的类型等信息
JSONObject
attributeInside
=
properties
.
getJSONObject
(
attributeName
);
//处理properties以及items
AttributeInVo
attributeInVo
=
handleItems
(
attributeInside
);
PropertiesVo
propertiesVo
=
new
PropertiesVo
();
propertiesVo
.
setName
(
attributeName
);
propertiesVo
.
setAttributeInVo
(
attributeInVo
);
list
.
add
(
propertiesVo
);
}
}
return
list
;
}
/**
* 处理items
*/
public
AttributeInVo
handleItems
(
JSONObject
attributeInside
)
{
AttributeInVo
attributeInVo
=
new
AttributeInVo
();
if
(
attributeInside
!=
null
)
{
//获取到属性的类型,根据不同的类型进行处理
String
type
=
attributeInside
.
getString
(
"type"
);
if
(
type
!=
null
&&
!
""
.
equals
(
type
))
{
switch
(
type
)
{
case
"string"
:
attributeInVo
=
handleString
(
attributeInside
);
attributeInVo
.
setType
(
type
);
break
;
case
"integer"
:
attributeInVo
=
handleInteger
(
attributeInside
);
attributeInVo
.
setType
(
type
);
case
"object"
:
attributeInVo
=
handleObject
(
attributeInside
);
attributeInVo
.
setType
(
type
);
break
;
case
"array"
:
attributeInVo
=
handleArray
(
attributeInside
);
attributeInVo
.
setType
(
type
);
break
;
case
"boolean"
:
attributeInVo
.
setType
(
type
);
break
;
default
:
break
;
}
}
else
{
String
ref
=
attributeInside
.
getString
(
"$ref"
);
if
(
ref
!=
null
)
{
attributeInVo
.
setRef
(
ref
);
}
}
}
return
attributeInVo
;
}
/**
* 处理String类型的情况
*/
public
AttributeInVo
handleString
(
JSONObject
attributeInside
)
{
AttributeInVo
attributeInVo
=
new
AttributeInVo
();
JSONArray
anEnum
=
attributeInside
.
getJSONArray
(
"enum"
);
String
description
=
attributeInside
.
getString
(
"description"
);
attributeInVo
.
setDescription
(
description
);
if
(
anEnum
!=
null
)
{
List
<
String
>
enumTypes
=
anEnum
.
toJavaList
(
String
.
class
);
attributeInVo
.
setEnumType
(
enumTypes
);
}
return
attributeInVo
;
}
/**
* 处理integer类型的情况
*/
public
AttributeInVo
handleInteger
(
JSONObject
attributeInside
)
{
AttributeInVo
attributeInVo
=
new
AttributeInVo
();
String
description
=
attributeInside
.
getString
(
"description"
);
attributeInVo
.
setDescription
(
description
);
String
format
=
attributeInside
.
getString
(
"format"
);
attributeInVo
.
setFormat
(
format
);
return
attributeInVo
;
}
/**
* 处理array类型的情况
*/
public
AttributeInVo
handleArray
(
JSONObject
attributeInside
)
{
AttributeInVo
attributeInVo
=
new
AttributeInVo
();
JSONArray
example
=
attributeInside
.
getJSONArray
(
"example"
);
String
description
=
attributeInside
.
getString
(
"description"
);
attributeInVo
.
setDescription
(
description
);
if
(
example
!=
null
)
{
List
<
String
>
javaList
=
example
.
toJavaList
(
String
.
class
);
attributeInVo
.
setExample
(
javaList
);
}
JSONObject
items
=
attributeInside
.
getJSONObject
(
"items"
);
if
(
items
!=
null
)
{
AttributeInVo
child
=
handleItems
(
items
);
attributeInVo
.
setItems
(
child
);
}
return
attributeInVo
;
}
/**
* 处理object类型的情况
*/
public
AttributeInVo
handleObject
(
JSONObject
attributeInside
)
{
AttributeInVo
attributeInVo
=
new
AttributeInVo
();
String
description
=
attributeInside
.
getString
(
"description"
);
attributeInVo
.
setDescription
(
description
);
JSONObject
additionalProperties
=
attributeInside
.
getJSONObject
(
"additionalProperties"
);
if
(
additionalProperties
!=
null
)
{
AttributeInVo
child
=
handleItems
(
additionalProperties
);
attributeInVo
.
setItems
(
child
);
}
return
attributeInVo
;
}
}
\ No newline at end of file
kt-web/src/main/java/org/matrix/autotest/swaggerEntityVo/AttributeInVo.java
0 → 100644
浏览文件 @
ea3f75eb
package
org
.
matrix
.
autotest
.
swaggerEntityVo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
/**
* 内部属性,对象的字段的属性包括 : 类型,描述等
*
* @author mruny
* @create 2022/7/8 15:20:32
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
"AttributeInVo内部属性,对象的字段的属性包括 : 类型,描述等"
)
public
class
AttributeInVo
{
@ApiModelProperty
(
"类型"
)
private
String
type
;
@ApiModelProperty
(
"描述"
)
private
String
description
;
@ApiModelProperty
(
"格式,可能为null"
)
private
String
format
;
@ApiModelProperty
(
"枚举,可能为null"
)
private
List
<
String
>
enumType
;
@ApiModelProperty
(
"map类型出现的情况"
)
private
String
additionalProperties
;
@ApiModelProperty
(
"实例"
)
private
List
<
String
>
example
;
@ApiModelProperty
(
"$ref"
)
private
String
ref
;
@ApiModelProperty
(
"子类"
)
private
AttributeInVo
items
;
}
kt-web/src/main/java/org/matrix/autotest/swaggerEntityVo/definitionsEntity/AttributeOutVo.java
0 → 100644
浏览文件 @
ea3f75eb
package
org
.
matrix
.
autotest
.
swaggerEntityVo
.
definitionsEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.matrix.autotest.swaggerEntityVo.AttributeInVo
;
import
java.util.List
;
/**
* 外部属性,对象中的属性,以及对象中属性的类型描述等
*
* @author mruny
* @create 2022/7/8 14:34:05
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
"AttributeOutVo外部属性,对象中的属性,以及对象中属性的类型描述等"
)
public
class
AttributeOutVo
{
@ApiModelProperty
(
"类型"
)
private
String
type
;
@ApiModelProperty
(
"描述"
)
private
String
description
;
@ApiModelProperty
(
"对象名称"
)
private
String
title
;
@ApiModelProperty
(
"具体的参数详情"
)
private
List
<
PropertiesVo
>
propertiesVoList
;
@ApiModelProperty
(
"map"
)
private
AttributeInVo
additionalProperties
;
}
kt-web/src/main/java/org/matrix/autotest/swaggerEntityVo/definitionsEntity/DefinitionsVo.java
0 → 100644
浏览文件 @
ea3f75eb
package
org
.
matrix
.
autotest
.
swaggerEntityVo
.
definitionsEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* definitions,对象,以及对象中的属性及具体信息
*
* @author mruny
* @create 2022/7/8 14:31:28
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
"DefinitionsVo对象,以及对象中的属性及具体信息"
)
public
class
DefinitionsVo
{
@ApiModelProperty
(
"对象名称"
)
private
String
objName
;
@ApiModelProperty
(
"对象中的属性以及具体信息"
)
private
AttributeOutVo
attributeOutVo
;
}
kt-web/src/main/java/org/matrix/autotest/swaggerEntityVo/definitionsEntity/PropertiesVo.java
0 → 100644
浏览文件 @
ea3f75eb
package
org
.
matrix
.
autotest
.
swaggerEntityVo
.
definitionsEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.matrix.autotest.swaggerEntityVo.AttributeInVo
;
/**
* 属性名称与属性内部
*
* @author mruny
* @create 2022/7/8 13:55:05
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
"PropertiesVo属性名称与属性内部"
)
public
class
PropertiesVo
{
@ApiModelProperty
(
"属性名称"
)
private
String
name
;
@ApiModelProperty
(
"属性对应的类型,以及描述等"
)
private
AttributeInVo
attributeInVo
;
}
kt-web/src/main/java/org/matrix/autotest/swaggerEntityVo/responsesEntity/CodeStatusVo.java
0 → 100644
浏览文件 @
ea3f75eb
package
org
.
matrix
.
autotest
.
swaggerEntityVo
.
responsesEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.matrix.autotest.swaggerEntityVo.AttributeInVo
;
/**
* @author mruny
* @create 2022/7/11 14:13:55
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
"状态码对应具体信息"
)
public
class
CodeStatusVo
{
@ApiModelProperty
(
"描述"
)
private
String
description
;
@ApiModelProperty
(
"对象中的属性以及具体信息"
)
private
AttributeInVo
attributeInVo
;
}
kt-web/src/main/java/org/matrix/autotest/swaggerEntityVo/responsesEntity/ResponsesVo.java
0 → 100644
浏览文件 @
ea3f75eb
package
org
.
matrix
.
autotest
.
swaggerEntityVo
.
responsesEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* responses最外层
*
* @author mruny
* @create 2022/7/11 14:07:25
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
"response返回值信息"
)
public
class
ResponsesVo
{
@ApiModelProperty
(
"状态码"
)
private
String
code
;
@ApiModelProperty
(
"状态信息"
)
private
CodeStatusVo
codeStatusVo
;
}
kt-web/src/main/java/org/matrix/autotest/swaggerEntity/PathVo.java
→
kt-web/src/main/java/org/matrix/autotest/swaggerEntity
Vo/swaggerEntity
/PathVo.java
浏览文件 @
ea3f75eb
package
org
.
matrix
.
autotest
.
swaggerEntity
;
package
org
.
matrix
.
autotest
.
swaggerEntity
Vo
.
swaggerEntity
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.matrix.autotest.swaggerEntityVo.responsesEntity.ResponsesVo
;
import
java.util.List
;
/**
* @author MRY
...
...
@@ -14,7 +16,7 @@ import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
"接口信息"
)
@ApiModel
(
"
PathVo
接口信息"
)
public
class
PathVo
{
@ApiModelProperty
(
"url地址"
)
...
...
@@ -33,7 +35,7 @@ public class PathVo {
private
JSONArray
parameters
;
@ApiModelProperty
(
"返回值"
)
private
JSONObject
responses
;
private
List
<
ResponsesVo
>
responses
;
@ApiModelProperty
(
"operationId"
)
private
String
operationId
;
...
...
kt-web/src/main/java/org/matrix/autotest/swaggerEntity/SwaggerOuter.java
→
kt-web/src/main/java/org/matrix/autotest/swaggerEntity
Vo/swaggerEntity
/SwaggerOuter.java
浏览文件 @
ea3f75eb
package
org
.
matrix
.
autotest
.
swaggerEntity
;
package
org
.
matrix
.
autotest
.
swaggerEntity
Vo
.
swaggerEntity
;
import
com.alibaba.fastjson.JSONObject
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.matrix.autotest.swaggerEntityVo.definitionsEntity.DefinitionsVo
;
import
java.util.List
;
...
...
@@ -26,7 +26,7 @@ public class SwaggerOuter {
private
String
basePath
;
@ApiModelProperty
(
"参数"
)
private
JSONObject
definitions
;
private
List
<
DefinitionsVo
>
definitions
;
@ApiModelProperty
(
"一级标签和二级标签集合"
)
private
List
<
TagSummary
>
tagSummaryList
;
...
...
kt-web/src/main/java/org/matrix/autotest/swaggerEntity/TagSummary.java
→
kt-web/src/main/java/org/matrix/autotest/swaggerEntity
Vo/swaggerEntity
/TagSummary.java
浏览文件 @
ea3f75eb
package
org
.
matrix
.
autotest
.
swaggerEntity
;
package
org
.
matrix
.
autotest
.
swaggerEntity
Vo
.
swaggerEntity
;
import
com.alibaba.fastjson.JSONArray
;
import
io.swagger.annotations.ApiModel
;
...
...
@@ -16,7 +16,7 @@ import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
"一级标签与二级标签"
)
@ApiModel
(
"
TagSummary
一级标签与二级标签"
)
public
class
TagSummary
{
@ApiModelProperty
(
"一级标签"
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论