提交 5ad3e052 编写于 作者: zhouweidong's avatar zhouweidong

GetDraft dto解析

上级 913c3d4f
...@@ -4,6 +4,7 @@ TARGET=PSSYSTEM ...@@ -4,6 +4,7 @@ TARGET=PSSYSTEM
package ${pub.getPKGCodeName()}.util.web; package ${pub.getPKGCodeName()}.util.web;
import ${pub.getPKGCodeName()}.util.filter.SearchContextBase; import ${pub.getPKGCodeName()}.util.filter.SearchContextBase;
import ${pub.getPKGCodeName()}.util.domain.DTOBase;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.core.MethodParameter; import org.springframework.core.MethodParameter;
...@@ -27,7 +28,7 @@ public class SearchContextHandlerMethodArgumentResolver implements HandlerMethod ...@@ -27,7 +28,7 @@ public class SearchContextHandlerMethodArgumentResolver implements HandlerMethod
@Override @Override
public boolean supportsParameter(MethodParameter parameter) { public boolean supportsParameter(MethodParameter parameter) {
return SearchContextBase.class.isAssignableFrom(parameter.getParameterType()); return SearchContextBase.class.isAssignableFrom(parameter.getParameterType()) || DTOBase.class.isAssignableFrom(parameter.getParameterType());
} }
@Override @Override
...@@ -38,7 +39,7 @@ public class SearchContextHandlerMethodArgumentResolver implements HandlerMethod ...@@ -38,7 +39,7 @@ public class SearchContextHandlerMethodArgumentResolver implements HandlerMethod
for (String key : params.keySet()) { for (String key : params.keySet()) {
set.put(key,params.get(key)[0]); set.put(key,params.get(key)[0]);
} }
if((!set.containsKey("size")) ){ if(SearchContextBase.class.isAssignableFrom(parameter.getParameterType()) && (!set.containsKey("size"))){
set.put("size", pageLimit); set.put("size", pageLimit);
} }
String json = objectMapper.writeValueAsString(set); String json = objectMapper.writeValueAsString(set);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册