Commit 8d689676 authored by yanzg's avatar yanzg

修改MQ请求尸体,防止出错

parent e85837d8
......@@ -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);
......
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;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment