Commit 30b546b8 by guojuxing

判断空

parent 8b06d37e
...@@ -7,6 +7,8 @@ import com.gic.api.base.commons.ServiceResponse; ...@@ -7,6 +7,8 @@ import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil; import com.gic.commons.util.EntityUtil;
import com.gic.commons.webapi.reponse.RestResponse; import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.exception.CommonException; import com.gic.enterprise.exception.CommonException;
import org.apache.commons.collections.CollectionUtils;
/** /**
* controller统一返回结果 * controller统一返回结果
* @ClassName: ResultControllerUtils
 * @ClassName: ResultControllerUtils

...@@ -94,6 +96,9 @@ public class ResultControllerUtils { ...@@ -94,6 +96,9 @@ public class ResultControllerUtils {
public static RestResponse commonPageResult(ServiceResponse response, Class<?> clazz) { public static RestResponse commonPageResult(ServiceResponse response, Class<?> clazz) {
if (response.isSuccess()) { if (response.isSuccess()) {
Page page = (Page) response.getResult(); Page page = (Page) response.getResult();
if (page == null) {
return RestResponse.success();
}
page.setResult(EntityUtil.changeEntityListNew(clazz, page.getResult())); page.setResult(EntityUtil.changeEntityListNew(clazz, page.getResult()));
return RestResponse.success(page); return RestResponse.success(page);
} else { } else {
......
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