Commit 93c7be76 by guojuxing

controller统一返回工具类修改

parent 71aa3e47
......@@ -101,7 +101,7 @@ public class ResultControllerUtils {
}
/**
* 统一返回成功结果(DTO转为VO)
* 统一返回成功结果 list(DTO转为VO)
* @Title: commonResultOfListVO

* @Description:

 * @author guojuxing
......@@ -116,4 +116,21 @@ public class ResultControllerUtils {
return RestResponse.failure(response.getCode(), response.getMessage());
}
}
/**
* 统一返回成功结果 单条数据(DTO转为VO)
* @Title: commonResultOfListVO

* @Description:

 * @author guojuxing
* @param response
* @param clazz

* @return com.gic.commons.webapi.reponse.RestResponse


 */
public static RestResponse commonResultOne(ServiceResponse response, Class<?> clazz) {
if (response.isSuccess()) {
return RestResponse.success(EntityUtil.changeEntityNew(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