Commit fb1f2007 by guojuxing

如果为空判断回滚

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

......@@ -114,12 +112,7 @@ public class ResultControllerUtils {

 */
public static RestResponse commonResult(ServiceResponse response, Class<?> clazz) {
if (response.isSuccess()) {
if (CollectionUtils.isNotEmpty((List<?>) response.getResult())) {
return RestResponse.success(EntityUtil.changeEntityListNew(clazz, (List<?>) response.getResult()));
} else {
return RestResponse.success();
}
return RestResponse.success(EntityUtil.changeEntityListNew(clazz, (List<?>) response.getResult()));
} else {
return RestResponse.failure(response.getCode(), response.getMessage());
}
......
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