Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
byit-myth-job
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
liyuan
byit-myth-job
Commits
5adfb82a
Commit
5adfb82a
authored
Apr 03, 2020
by
guominglei
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
06cc2029
1cc5418f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
ResponseAdvice.java
...ore/src/main/java/com/byit/web/advice/ResponseAdvice.java
+7
-7
No files found.
byit-myth-core/myth-web-core/src/main/java/com/byit/web/advice/ResponseAdvice.java
View file @
5adfb82a
...
@@ -33,13 +33,13 @@ public class ResponseAdvice implements ResponseBodyAdvice {
...
@@ -33,13 +33,13 @@ public class ResponseAdvice implements ResponseBodyAdvice {
*/
*/
@Override
@Override
public
Object
beforeBodyWrite
(
Object
body
,
MethodParameter
methodParameter
,
MediaType
mediaType
,
Class
aClass
,
ServerHttpRequest
serverHttpRequest
,
ServerHttpResponse
serverHttpResponse
)
{
public
Object
beforeBodyWrite
(
Object
body
,
MethodParameter
methodParameter
,
MediaType
mediaType
,
Class
aClass
,
ServerHttpRequest
serverHttpRequest
,
ServerHttpResponse
serverHttpResponse
)
{
String
simpleName
=
methodParameter
.
getParameterType
().
getSimpleName
();
if
(!(
body
instanceof
ResponseResult
)){
if
(
"ResponseResult"
.
equals
(
simpleName
)){
ResponseResult
<
Object
>
success
=
ResponseResult
.
ok
(
body
);
return
body
;
if
(
body
instanceof
String
){
}
else
if
(
"void"
.
equals
(
simpleName
)){
return
JSON
.
toJSONString
(
success
);
return
JSON
.
toJSONString
(
ResponseResult
.
ok
());
}
}
else
{
return
success
;
return
JSON
.
toJSONString
(
ResponseResult
.
ok
(
body
));
}
}
return
body
;
}
}
}
}
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