Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
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
YZG
yzg-util
Commits
a841e101
Commit
a841e101
authored
Sep 22, 2019
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口文档的支持
parent
61769a83
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
ResponseResult.java
...src/main/java/com/yanzuoguang/util/vo/ResponseResult.java
+11
-0
No files found.
yzg-util-base/src/main/java/com/yanzuoguang/util/vo/ResponseResult.java
View file @
a841e101
package
com
.
yanzuoguang
.
util
.
vo
;
package
com
.
yanzuoguang
.
util
.
vo
;
import
com.yanzuoguang.util.contants.ResultConstants
;
import
com.yanzuoguang.util.contants.ResultConstants
;
import
com.yanzuoguang.util.exception.CodeException
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
...
@@ -38,6 +39,16 @@ public class ResponseResult<T> extends BaseVo {
...
@@ -38,6 +39,16 @@ public class ResponseResult<T> extends BaseVo {
@ApiModelProperty
(
value
=
"异常数据"
,
notes
=
"当抛出异常时的数据,通常和code进行组合"
,
required
=
true
)
@ApiModelProperty
(
value
=
"异常数据"
,
notes
=
"当抛出异常时的数据,通常和code进行组合"
,
required
=
true
)
private
Object
target
;
private
Object
target
;
/**
* 检查数据是否合法,不合法则抛出异常
*/
public
void
check
()
{
if
(
StringHelper
.
compare
(
code
,
ResultConstants
.
SUCCESS
))
{
return
;
}
throw
new
CodeException
(
this
.
code
,
this
.
message
,
this
.
target
);
}
/**
/**
* 获取结果状态码
* 获取结果状态码
*
*
...
...
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