Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sqlrest
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
comm
sqlrest
Commits
995ec5c2
Commit
995ec5c2
authored
May 16, 2025
by
inrgihc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试问题修复
parent
037c07d6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
+9
-5
sqlrest-common/src/main/java/com/gitee/sqlrest/common/dto/ItemParam.java
+6
-1
sqlrest-core/src/main/java/com/gitee/sqlrest/core/exec/ApiExecuteService.java
+1
-2
sqlrest-core/src/main/java/com/gitee/sqlrest/core/service/ApiAssignmentService.java
+2
-2
No files found.
sqlrest-common/src/main/java/com/gitee/sqlrest/common/dto/ItemParam.java
View file @
995ec5c2
package
com
.
gitee
.
sqlrest
.
common
.
dto
;
package
com
.
gitee
.
sqlrest
.
common
.
dto
;
import
com.gitee.sqlrest.common.enums.HttpMethodEnum
;
import
com.gitee.sqlrest.common.enums.ParamTypeEnum
;
import
com.gitee.sqlrest.common.enums.ParamTypeEnum
;
import
com.gitee.sqlrest.common.exception.CommonException
;
import
com.gitee.sqlrest.common.exception.CommonException
;
import
com.gitee.sqlrest.common.exception.ResponseErrorCode
;
import
com.gitee.sqlrest.common.exception.ResponseErrorCode
;
...
@@ -21,11 +22,15 @@ public class ItemParam extends BaseParam {
...
@@ -21,11 +22,15 @@ public class ItemParam extends BaseParam {
@ApiModelProperty
(
"Object类型的子元素"
)
@ApiModelProperty
(
"Object类型的子元素"
)
private
List
<
BaseParam
>
children
;
private
List
<
BaseParam
>
children
;
public
void
checkValid
()
{
public
void
checkValid
(
HttpMethodEnum
method
)
{
if
(
StringUtils
.
isBlank
(
getName
()))
{
if
(
StringUtils
.
isBlank
(
getName
()))
{
throw
new
CommonException
(
ResponseErrorCode
.
ERROR_INTERNAL_ERROR
,
"input parameter name must is not blank"
);
throw
new
CommonException
(
ResponseErrorCode
.
ERROR_INTERNAL_ERROR
,
"input parameter name must is not blank"
);
}
}
if
(
getType
()
==
ParamTypeEnum
.
OBJECT
)
{
if
(
getType
()
==
ParamTypeEnum
.
OBJECT
)
{
if
(!
method
.
isHasBody
())
{
throw
new
CommonException
(
ResponseErrorCode
.
ERROR_INVALID_ARGUMENT
,
"Request with GET/HEAD method cannot have object input parameter as body."
);
}
if
(
null
!=
children
&&
children
.
size
()
>
0
)
{
if
(
null
!=
children
&&
children
.
size
()
>
0
)
{
for
(
BaseParam
param
:
children
)
{
for
(
BaseParam
param
:
children
)
{
if
(
StringUtils
.
isBlank
(
param
.
getName
()))
{
if
(
StringUtils
.
isBlank
(
param
.
getName
()))
{
...
...
sqlrest-core/src/main/java/com/gitee/sqlrest/core/exec/ApiExecuteService.java
View file @
995ec5c2
...
@@ -89,8 +89,7 @@ public class ApiExecuteService {
...
@@ -89,8 +89,7 @@ public class ApiExecuteService {
}
}
return
result
;
return
result
;
}
else
{
}
else
{
ResultEntity
result
=
doExecute
(
getDataSourceEntity
(
config
),
config
,
paramValues
);
return
doExecute
(
getDataSourceEntity
(
config
),
config
,
paramValues
);
return
ResultEntity
.
success
(
result
);
}
}
}
catch
(
CommonException
e
)
{
}
catch
(
CommonException
e
)
{
return
ResultEntity
.
failed
(
e
.
getCode
(),
e
.
getMessage
());
return
ResultEntity
.
failed
(
e
.
getCode
(),
e
.
getMessage
());
...
...
sqlrest-core/src/main/java/com/gitee/sqlrest/core/service/ApiAssignmentService.java
View file @
995ec5c2
...
@@ -336,7 +336,7 @@ public class ApiAssignmentService {
...
@@ -336,7 +336,7 @@ public class ApiAssignmentService {
}
}
for
(
ItemParam
itemParam
:
request
.
getParams
())
{
for
(
ItemParam
itemParam
:
request
.
getParams
())
{
itemParam
.
checkValid
();
itemParam
.
checkValid
(
request
.
getMethod
()
);
}
}
}
}
if
(!
CollectionUtils
.
isEmpty
(
request
.
getOutputs
()))
{
if
(!
CollectionUtils
.
isEmpty
(
request
.
getOutputs
()))
{
...
@@ -437,7 +437,7 @@ public class ApiAssignmentService {
...
@@ -437,7 +437,7 @@ public class ApiAssignmentService {
}
}
}
}
for
(
ItemParam
itemParam
:
request
.
getParams
())
{
for
(
ItemParam
itemParam
:
request
.
getParams
())
{
itemParam
.
checkValid
();
itemParam
.
checkValid
(
exists
.
getMethod
()
);
}
}
}
}
if
(!
CollectionUtils
.
isEmpty
(
request
.
getOutputs
()))
{
if
(!
CollectionUtils
.
isEmpty
(
request
.
getOutputs
()))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment