Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ajb-backend-car
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AutogeneralShanghai
ajb-backend-car
Commits
2a848c0e
Commit
2a848c0e
authored
Jul 26, 2018
by
Simon Cheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mdev发布
parent
ecee49f2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
111 deletions
+0
-111
ajb-car-vo/.settings/org.eclipse.core.resources.prefs
+0
-1
ajb-car-vo/src/main/java/com/ajb/car/vo/common/JsonResult.java
+0
-110
No files found.
ajb-car-vo/.settings/org.eclipse.core.resources.prefs
View file @
2a848c0e
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/java/com/ajb/car/vo/common/JsonResult.java=UTF-8
encoding/<project>=UTF-8
ajb-car-vo/src/main/java/com/ajb/car/vo/common/JsonResult.java
deleted
100644 → 0
View file @
ecee49f2
package
com
.
ajb
.
car
.
vo
.
common
;
import
java.io.Serializable
;
import
java.lang.reflect.InvocationTargetException
;
import
java.lang.reflect.Method
;
/***
* 返回结果封装
*
* @author fan
*
*/
public
class
JsonResult
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
boolean
success
;
private
String
message
;
private
Object
data
;
public
JsonResult
(){}
public
JsonResult
(
boolean
success
,
String
msg
,
Object
data
){
this
.
success
=
success
;
this
.
message
=
msg
;
this
.
data
=
data
;
}
public
JsonResult
(
boolean
success
,
String
msg
){
this
.
success
=
success
;
this
.
message
=
msg
;
this
.
data
=
null
;
}
private
JsonResult
(
String
msg
,
Object
data
)
{
this
.
message
=
msg
;
this
.
success
=
true
;
this
.
data
=
data
;
}
public
Object
getData
()
{
return
data
;
}
public
String
getMessage
()
{
return
message
;
}
public
boolean
isSuccess
()
{
return
success
;
}
public
JsonResult
ofSuccess
(
String
msg
,
Object
data
)
{
return
new
JsonResult
(
msg
,
data
)
;
}
public
void
setData
(
Object
data
)
{
this
.
data
=
data
;
}
public
void
setMessage
(
String
message
)
{
this
.
message
=
message
;
}
public
void
setSuccess
(
boolean
success
)
{
this
.
success
=
success
;
}
@SuppressWarnings
({
"unchecked"
,
"rawtypes"
})
public
void
addResult
(
Object
responseVO
){
Class
c
=
responseVO
.
getClass
();
Method
getMethod
=
null
;
try
{
Class
[]
classArr
=
null
;
getMethod
=
c
.
getMethod
(
"getCommonResult"
,
classArr
);
}
catch
(
NoSuchMethodException
|
SecurityException
e1
)
{
e1
.
printStackTrace
();
}
CommonResult
commonResult
=
null
;
if
(
getMethod
!=
null
){
try
{
Object
[]
objectArr
=
null
;
commonResult
=
(
CommonResult
)
getMethod
.
invoke
(
responseVO
,
objectArr
);
}
catch
(
IllegalAccessException
|
IllegalArgumentException
|
InvocationTargetException
e
)
{
e
.
printStackTrace
();
}
}
if
(
commonResult
!=
null
){
this
.
success
=
commonResult
.
isSuccess
();
this
.
message
=
commonResult
.
getMessage
();
}
else
{
this
.
success
=
false
;
this
.
message
=
"未知异常!"
;
}
Method
setMethod
=
null
;
try
{
setMethod
=
c
.
getMethod
(
"setCommonResult"
,
CommonResult
.
class
);
}
catch
(
NoSuchMethodException
|
SecurityException
e
)
{
e
.
printStackTrace
();
}
if
(
setMethod
!=
null
){
CommonResult
args
=
null
;
try
{
setMethod
.
invoke
(
responseVO
,
args
);
}
catch
(
IllegalAccessException
|
IllegalArgumentException
|
InvocationTargetException
e
)
{
e
.
printStackTrace
();
}
}
}
}
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