Commit fb1f2007 by guojuxing

如果为空判断回滚

parent cb371819
...@@ -7,8 +7,6 @@ import com.gic.api.base.commons.ServiceResponse; ...@@ -7,8 +7,6 @@ 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

...@@ -114,13 +112,8 @@ public class ResultControllerUtils { ...@@ -114,13 +112,8 @@ public class ResultControllerUtils {

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