Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
kt-keystone
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
kt-keystone
Commits
cd4bbd2c
提交
cd4bbd2c
authored
1月 18, 2022
作者:
mry
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
perf(web): 部分代码优化
上级
ba8f9072
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
16 行增加
和
8 行删除
+16
-8
ActionService.java
.../main/java/org/matrix/autotest/service/ActionService.java
+0
-1
SwaggerController.java
...va/org/matrix/autotest/swaggerData/SwaggerController.java
+6
-6
CommonResult.java
...src/main/java/org/matrix/autotest/utils/CommonResult.java
+8
-0
application.properties
kt-web/src/main/resources/application.properties
+2
-1
没有找到文件。
kt-web/src/main/java/org/matrix/autotest/service/ActionService.java
浏览文件 @
cd4bbd2c
...
@@ -2,7 +2,6 @@ package org.matrix.autotest.service;
...
@@ -2,7 +2,6 @@ package org.matrix.autotest.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
org.matrix.autotest.entity.Action
;
import
org.matrix.autotest.entity.Action
;
import
org.matrix.autotest.entity.Move
;
import
java.util.List
;
import
java.util.List
;
...
...
kt-web/src/main/java/org/matrix/autotest/swaggerData/SwaggerController.java
浏览文件 @
cd4bbd2c
...
@@ -50,7 +50,7 @@ public class SwaggerController {
...
@@ -50,7 +50,7 @@ public class SwaggerController {
@GetMapping
@GetMapping
public
Object
parameter
(
String
url
)
{
public
Object
parameter
(
String
url
)
{
@SuppressWarnings
(
"all"
)
@SuppressWarnings
(
value
=
"all"
)
List
<
String
>
list
=
new
ArrayList
();
List
<
String
>
list
=
new
ArrayList
();
//获得json字符串
//获得json字符串
String
json
=
loadJson
(
url
);
String
json
=
loadJson
(
url
);
...
@@ -61,7 +61,7 @@ public class SwaggerController {
...
@@ -61,7 +61,7 @@ public class SwaggerController {
Object
basePath
=
swaggerJson
.
get
(
"basePath"
);
Object
basePath
=
swaggerJson
.
get
(
"basePath"
);
Object
paths
=
swaggerJson
.
get
(
"paths"
);
Object
paths
=
swaggerJson
.
get
(
"paths"
);
//将paths转成map集合
//将paths转成map集合
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
value
=
"unchecked"
)
Map
<
String
,
String
>
pathsMaps
=
(
Map
<
String
,
String
>)
paths
;
Map
<
String
,
String
>
pathsMaps
=
(
Map
<
String
,
String
>)
paths
;
//获取key
//获取key
Set
<
String
>
methodUrls
=
pathsMaps
.
keySet
();
Set
<
String
>
methodUrls
=
pathsMaps
.
keySet
();
...
@@ -72,21 +72,21 @@ public class SwaggerController {
...
@@ -72,21 +72,21 @@ public class SwaggerController {
//通过JSON获取到methodUrl,用来获取methodUrl内部的信息
//通过JSON获取到methodUrl,用来获取methodUrl内部的信息
Object
objMethodUrls
=
objPaths
.
get
(
methodUrl
);
Object
objMethodUrls
=
objPaths
.
get
(
methodUrl
);
JSONObject
objUrlsJson
=
(
JSONObject
)
objMethodUrls
;
JSONObject
objUrlsJson
=
(
JSONObject
)
objMethodUrls
;
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
value
=
"unchecked"
)
Map
<
String
,
String
>
objMethodUrlsMaps
=
(
Map
<
String
,
String
>)
objMethodUrls
;
Map
<
String
,
String
>
objMethodUrlsMaps
=
(
Map
<
String
,
String
>)
objMethodUrls
;
Set
<
String
>
requests
=
objMethodUrlsMaps
.
keySet
();
Set
<
String
>
requests
=
objMethodUrlsMaps
.
keySet
();
for
(
String
request
:
requests
)
{
for
(
String
request
:
requests
)
{
//拿到请求内部的信息
//拿到请求内部的信息
Object
objRequest
=
objUrlsJson
.
get
(
request
);
Object
objRequest
=
objUrlsJson
.
get
(
request
);
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
value
=
"unchecked"
)
Map
<
String
,
String
>
objRequestMaps
=
(
Map
<
String
,
String
>)
objRequest
;
Map
<
String
,
String
>
objRequestMaps
=
(
Map
<
String
,
String
>)
objRequest
;
Object
parameters
=
objRequestMaps
.
get
(
"parameters"
);
Object
parameters
=
objRequestMaps
.
get
(
"parameters"
);
List
<
String
>
parameterAllList
=
new
ArrayList
<>();
List
<
String
>
parameterAllList
=
new
ArrayList
<>();
if
(
parameters
!=
null
)
{
if
(
parameters
!=
null
)
{
@SuppressWarnings
(
"all"
)
@SuppressWarnings
(
value
=
"all"
)
List
<
String
>
parameterLists
=
(
List
<
String
>)
parameters
;
List
<
String
>
parameterLists
=
(
List
<
String
>)
parameters
;
for
(
Object
parameterList
:
parameterLists
)
{
for
(
Object
parameterList
:
parameterLists
)
{
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
value
=
"unchecked"
)
Map
<
String
,
String
>
parameterMaps
=
(
Map
<
String
,
String
>)
parameterList
;
Map
<
String
,
String
>
parameterMaps
=
(
Map
<
String
,
String
>)
parameterList
;
String
name
=
parameterMaps
.
get
(
"name"
);
String
name
=
parameterMaps
.
get
(
"name"
);
String
type
=
parameterMaps
.
get
(
"type"
);
String
type
=
parameterMaps
.
get
(
"type"
);
...
...
kt-web/src/main/java/org/matrix/autotest/utils/CommonResult.java
浏览文件 @
cd4bbd2c
...
@@ -30,6 +30,7 @@ public class CommonResult<T> {
...
@@ -30,6 +30,7 @@ public class CommonResult<T> {
/**
/**
* 成功返回结果
* 成功返回结果
*/
*/
@SuppressWarnings
(
value
=
"all"
)
public
static
<
T
>
CommonResult
<
T
>
success
()
{
public
static
<
T
>
CommonResult
<
T
>
success
()
{
return
new
CommonResult
<>(
ResultCode
.
SUCCESS
.
getCode
(),
ResultCode
.
SUCCESS
.
getMessage
(),
null
);
return
new
CommonResult
<>(
ResultCode
.
SUCCESS
.
getCode
(),
ResultCode
.
SUCCESS
.
getMessage
(),
null
);
}
}
...
@@ -37,6 +38,7 @@ public class CommonResult<T> {
...
@@ -37,6 +38,7 @@ public class CommonResult<T> {
/**
/**
* 失败返回结果
* 失败返回结果
*/
*/
@SuppressWarnings
(
value
=
"all"
)
public
static
<
T
>
CommonResult
<
T
>
failed
()
{
public
static
<
T
>
CommonResult
<
T
>
failed
()
{
return
new
CommonResult
<>(
ResultCode
.
FAILED
.
getCode
(),
ResultCode
.
FAILED
.
getMessage
(),
null
);
return
new
CommonResult
<>(
ResultCode
.
FAILED
.
getCode
(),
ResultCode
.
FAILED
.
getMessage
(),
null
);
}
}
...
@@ -46,6 +48,7 @@ public class CommonResult<T> {
...
@@ -46,6 +48,7 @@ public class CommonResult<T> {
*
*
* @param message 提示信息
* @param message 提示信息
*/
*/
@SuppressWarnings
(
value
=
"all"
)
public
static
<
T
>
CommonResult
<
T
>
success
(
String
message
)
{
public
static
<
T
>
CommonResult
<
T
>
success
(
String
message
)
{
return
new
CommonResult
<>(
ResultCode
.
SUCCESS
.
getCode
(),
message
,
null
);
return
new
CommonResult
<>(
ResultCode
.
SUCCESS
.
getCode
(),
message
,
null
);
}
}
...
@@ -55,6 +58,7 @@ public class CommonResult<T> {
...
@@ -55,6 +58,7 @@ public class CommonResult<T> {
*
*
* @param message 提示信息
* @param message 提示信息
*/
*/
@SuppressWarnings
(
value
=
"all"
)
public
static
<
T
>
CommonResult
<
T
>
failed
(
String
message
)
{
public
static
<
T
>
CommonResult
<
T
>
failed
(
String
message
)
{
return
new
CommonResult
<>(
ResultCode
.
FAILED
.
getCode
(),
message
,
null
);
return
new
CommonResult
<>(
ResultCode
.
FAILED
.
getCode
(),
message
,
null
);
}
}
...
@@ -64,6 +68,7 @@ public class CommonResult<T> {
...
@@ -64,6 +68,7 @@ public class CommonResult<T> {
*
*
* @param data 获取的数据
* @param data 获取的数据
*/
*/
@SuppressWarnings
(
value
=
"all"
)
public
static
<
T
>
CommonResult
<
T
>
success
(
T
data
)
{
public
static
<
T
>
CommonResult
<
T
>
success
(
T
data
)
{
return
new
CommonResult
<
T
>(
ResultCode
.
SUCCESS
.
getCode
(),
ResultCode
.
SUCCESS
.
getMessage
(),
data
);
return
new
CommonResult
<
T
>(
ResultCode
.
SUCCESS
.
getCode
(),
ResultCode
.
SUCCESS
.
getMessage
(),
data
);
}
}
...
@@ -73,6 +78,7 @@ public class CommonResult<T> {
...
@@ -73,6 +78,7 @@ public class CommonResult<T> {
*
*
* @param data 获取的数据
* @param data 获取的数据
*/
*/
@SuppressWarnings
(
value
=
"all"
)
public
static
<
T
>
CommonResult
<
T
>
failed
(
T
data
)
{
public
static
<
T
>
CommonResult
<
T
>
failed
(
T
data
)
{
return
new
CommonResult
<
T
>(
ResultCode
.
FAILED
.
getCode
(),
ResultCode
.
FAILED
.
getMessage
(),
data
);
return
new
CommonResult
<
T
>(
ResultCode
.
FAILED
.
getCode
(),
ResultCode
.
FAILED
.
getMessage
(),
data
);
}
}
...
@@ -83,6 +89,7 @@ public class CommonResult<T> {
...
@@ -83,6 +89,7 @@ public class CommonResult<T> {
* @param data 获取的数据
* @param data 获取的数据
* @param message 提示信息
* @param message 提示信息
*/
*/
@SuppressWarnings
(
value
=
"all"
)
public
static
<
T
>
CommonResult
<
T
>
success
(
T
data
,
String
message
)
{
public
static
<
T
>
CommonResult
<
T
>
success
(
T
data
,
String
message
)
{
return
new
CommonResult
<
T
>(
ResultCode
.
SUCCESS
.
getCode
(),
message
,
data
);
return
new
CommonResult
<
T
>(
ResultCode
.
SUCCESS
.
getCode
(),
message
,
data
);
}
}
...
@@ -93,6 +100,7 @@ public class CommonResult<T> {
...
@@ -93,6 +100,7 @@ public class CommonResult<T> {
* @param data 获取的数据
* @param data 获取的数据
* @param message 提示信息
* @param message 提示信息
*/
*/
@SuppressWarnings
(
value
=
"all"
)
public
static
<
T
>
CommonResult
<
T
>
failed
(
T
data
,
String
message
)
{
public
static
<
T
>
CommonResult
<
T
>
failed
(
T
data
,
String
message
)
{
return
new
CommonResult
<
T
>(
ResultCode
.
FAILED
.
getCode
(),
message
,
data
);
return
new
CommonResult
<
T
>(
ResultCode
.
FAILED
.
getCode
(),
message
,
data
);
}
}
...
...
kt-web/src/main/resources/application.properties
浏览文件 @
cd4bbd2c
...
@@ -3,5 +3,5 @@ spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
...
@@ -3,5 +3,5 @@ spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url
=
jdbc:mysql://127.0.0.1:3306/keystone?useSSL=false&verifyServerCertificate=false&useUnicode=true&autoReconnect=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
spring.datasource.url
=
jdbc:mysql://127.0.0.1:3306/keystone?useSSL=false&verifyServerCertificate=false&useUnicode=true&autoReconnect=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
spring.datasource.username
=
root
spring.datasource.username
=
root
spring.datasource.password
=
root
spring.datasource.password
=
root
mybatis-plus.type-aliases-package
=
com.example.testwebdemo
.entity
mybatis-plus.type-aliases-package
=
org.matrix.autotest
.entity
mybatis-plus.configuration.map-underscore-to-camel-case
=
true
mybatis-plus.configuration.map-underscore-to-camel-case
=
true
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论