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
8d689676
Commit
8d689676
authored
Sep 01, 2020
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改MQ请求尸体,防止出错
parent
e85837d8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
3 deletions
+66
-3
ResponseResult.java
...src/main/java/com/yanzuoguang/util/vo/ResponseResult.java
+3
-3
ResponseResultPageIndex.java
...java/com/yanzuoguang/util/vo/ResponseResultPageIndex.java
+63
-0
No files found.
yzg-util-base/src/main/java/com/yanzuoguang/util/vo/ResponseResult.java
View file @
8d689676
...
...
@@ -170,7 +170,7 @@ public class ResponseResult<T> extends BaseVo {
* @param <T> 数据类型
* @return 一个请求成功的数据集合
*/
public
static
final
<
T
extends
Object
>
ResponseResult
<
T
>
result
(
T
data
)
{
public
static
<
T
extends
Object
>
ResponseResult
<
T
>
result
(
T
data
)
{
return
result
(
data
,
false
);
}
...
...
@@ -181,7 +181,7 @@ public class ResponseResult<T> extends BaseVo {
* @param <T> 数据类型
* @return 一个请求成功的数据集合
*/
public
static
final
<
T
extends
Object
>
ResponseResult
<
T
>
resultAllowNull
(
T
data
)
{
public
static
<
T
extends
Object
>
ResponseResult
<
T
>
resultAllowNull
(
T
data
)
{
return
result
(
data
,
true
);
}
...
...
@@ -194,7 +194,7 @@ public class ResponseResult<T> extends BaseVo {
* @param <T> 数据类型
* @return 一个请求成功的数据集合
*/
public
static
final
<
T
extends
Object
>
ResponseResult
<
T
>
result
(
T
data
,
boolean
allowNull
)
{
public
static
<
T
extends
Object
>
ResponseResult
<
T
>
result
(
T
data
,
boolean
allowNull
)
{
ResponseResult
<
T
>
ret
=
new
ResponseResult
<
T
>();
ret
.
setData
(
data
);
initDataStatus
(
ret
,
data
,
allowNull
);
...
...
yzg-util-base/src/main/java/com/yanzuoguang/util/vo/ResponseResultPageIndex.java
0 → 100755
View file @
8d689676
package
com
.
yanzuoguang
.
util
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* 接口之间的通讯结果
*
* @author 颜佐光
*/
public
class
ResponseResultPageIndex
<
T
>
extends
ResponseResult
<
T
>
{
/**
* 请求状态码
*/
@ApiModelProperty
(
value
=
"返回状态"
,
notes
=
"00表示成功,其他状态表示失败,具体含义参照具体实现接口"
,
required
=
true
,
example
=
"00"
)
private
int
pageIndex
;
public
int
getPageIndex
()
{
return
pageIndex
;
}
public
void
setPageIndex
(
int
pageIndex
)
{
this
.
pageIndex
=
pageIndex
;
}
/**
* 构造成功结果
*
* @param data 数据
* @param <T> 数据类型
* @return 一个请求成功的数据集合
*/
public
static
<
T
extends
Object
>
ResponseResultPageIndex
<
T
>
result
(
T
data
,
int
pageIndex
)
{
return
result
(
data
,
pageIndex
,
false
);
}
/**
* 构造成功结果,不允许为空
*
* @param data 数据
* @param <T> 数据类型
* @return 一个请求成功的数据集合
*/
public
static
<
T
extends
Object
>
ResponseResultPageIndex
<
T
>
resultAllowNull
(
T
data
,
int
pageIndex
)
{
return
result
(
data
,
pageIndex
,
true
);
}
/**
* 构造成功结果
*
* @param data 数据
* @param allowNull 允许为空
* @param <T> 数据类型
* @return 一个请求成功的数据集合
*/
public
static
final
<
T
extends
Object
>
ResponseResultPageIndex
<
T
>
result
(
T
data
,
int
pageIndex
,
boolean
allowNull
)
{
ResponseResultPageIndex
<
T
>
ret
=
new
ResponseResultPageIndex
<
T
>();
ret
.
setData
(
data
);
ret
.
setPageIndex
(
pageIndex
);
initDataStatus
(
ret
,
data
,
allowNull
);
return
ret
;
}
}
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