Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
ydl-generator
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
余保谷
ydl-generator
Commits
cb68b22b
Unverified
Commit
cb68b22b
authored
6 years ago
by
bianxin
Committed by
GitHub
6 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update README.md
parent
4fd0c971
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
36 deletions
+10
-36
README.md
README.md
+10
-36
No files found.
README.md
View file @
cb68b22b
...
...
@@ -410,8 +410,10 @@ public class UserController {
import
java.io.Serializable
;
import
java.net.ConnectException
;
import
java.sql.SQLException
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
lombok.Data
;
import
lombok.extern.slf4j.Slf4j
;
/**
* Copyright: Copyright (c) 2019
*
...
...
@@ -424,9 +426,10 @@ import org.slf4j.LoggerFactory;
*---------------------------------------------------------*
* 2019/4/9 flying-cattle V1.0 initialize
*/
@Slf4j
@Data
public
class
JsonResult
<
T
>
implements
Serializable
{
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
private
static
final
long
serialVersionUID
=
1071681926787951549L
;
/**
...
...
@@ -449,37 +452,8 @@ public class JsonResult<T> implements Serializable{
* <p>返回数据</p>
*/
private
T
data
;
public
Boolean
getTrue
()
{
return
isTrue
;
}
public
void
setTrue
(
Boolean
aTrue
)
{
isTrue
=
aTrue
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
String
getMessage
()
{
return
message
;
}
public
void
setMessage
(
String
message
)
{
this
.
message
=
message
;
}
public
T
getData
()
{
return
data
;
}
public
void
setData
(
T
data
)
{
this
.
data
=
data
;
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
/**
/**
* <p>返回成功</p>
* @param type 业务码
* @param message 错误说明
...
...
@@ -497,7 +471,7 @@ public class JsonResult<T> implements Serializable{
this
.
code
=
"0000"
;
}
public
JsonResult
(
Throwable
throwable
)
{
log
ger
.
error
(
throwable
+
"tt"
);
log
.
error
(
throwable
+
"tt"
);
this
.
isTrue
=
false
;
if
(
throwable
instanceof
NullPointerException
){
this
.
code
=
"1001"
;
...
...
@@ -530,7 +504,7 @@ public class JsonResult<T> implements Serializable{
this
.
code
=
"1010"
;
this
.
message
=
"运行时异常:"
+
throwable
;
}
else
if
(
throwable
instanceof
Exception
){
log
ger
.
error
(
"未知异常:"
+
throwable
);
log
.
error
(
"未知异常:"
+
throwable
);
this
.
code
=
"9999"
;
this
.
message
=
"未知异常"
+
throwable
;
}
...
...
This diff is collapsed.
Click to expand it.
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