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
Apr 13, 2019
by
bianxin
Committed by
GitHub
Apr 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update README.md
parent
4fd0c971
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
35 deletions
+9
-35
README.md
README.md
+9
-35
No files found.
README.md
View file @
cb68b22b
...
@@ -410,8 +410,10 @@ public class UserController {
...
@@ -410,8 +410,10 @@ public class UserController {
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.net.ConnectException
;
import
java.net.ConnectException
;
import
java.sql.SQLException
;
import
java.sql.SQLException
;
import
org.slf4j.Logger
;
import
lombok.Data
;
import
org.slf4j.LoggerFactory
;
import
lombok.extern.slf4j.Slf4j
;
/**
/**
* Copyright: Copyright (c) 2019
* Copyright: Copyright (c) 2019
*
*
...
@@ -424,9 +426,10 @@ import org.slf4j.LoggerFactory;
...
@@ -424,9 +426,10 @@ import org.slf4j.LoggerFactory;
*---------------------------------------------------------*
*---------------------------------------------------------*
* 2019/4/9 flying-cattle V1.0 initialize
* 2019/4/9 flying-cattle V1.0 initialize
*/
*/
@Slf4j
@Data
public
class
JsonResult
<
T
>
implements
Serializable
{
public
class
JsonResult
<
T
>
implements
Serializable
{
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
private
static
final
long
serialVersionUID
=
1071681926787951549L
;
private
static
final
long
serialVersionUID
=
1071681926787951549L
;
/**
/**
...
@@ -449,36 +452,7 @@ public class JsonResult<T> implements Serializable{
...
@@ -449,36 +452,7 @@ public class JsonResult<T> implements Serializable{
* <p>返回数据</p>
* <p>返回数据</p>
*/
*/
private
T
data
;
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>
* <p>返回成功</p>
* @param type 业务码
* @param type 业务码
...
@@ -497,7 +471,7 @@ public class JsonResult<T> implements Serializable{
...
@@ -497,7 +471,7 @@ public class JsonResult<T> implements Serializable{
this
.
code
=
"0000"
;
this
.
code
=
"0000"
;
}
}
public
JsonResult
(
Throwable
throwable
)
{
public
JsonResult
(
Throwable
throwable
)
{
log
ger
.
error
(
throwable
+
"tt"
);
log
.
error
(
throwable
+
"tt"
);
this
.
isTrue
=
false
;
this
.
isTrue
=
false
;
if
(
throwable
instanceof
NullPointerException
){
if
(
throwable
instanceof
NullPointerException
){
this
.
code
=
"1001"
;
this
.
code
=
"1001"
;
...
@@ -530,7 +504,7 @@ public class JsonResult<T> implements Serializable{
...
@@ -530,7 +504,7 @@ public class JsonResult<T> implements Serializable{
this
.
code
=
"1010"
;
this
.
code
=
"1010"
;
this
.
message
=
"运行时异常:"
+
throwable
;
this
.
message
=
"运行时异常:"
+
throwable
;
}
else
if
(
throwable
instanceof
Exception
){
}
else
if
(
throwable
instanceof
Exception
){
log
ger
.
error
(
"未知异常:"
+
throwable
);
log
.
error
(
"未知异常:"
+
throwable
);
this
.
code
=
"9999"
;
this
.
code
=
"9999"
;
this
.
message
=
"未知异常"
+
throwable
;
this
.
message
=
"未知异常"
+
throwable
;
}
}
...
...
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