buildQueryWrapper增加参数校验,避免误用

This commit is contained in:
mazhicheng 2019-08-08 19:23:59 +08:00
parent 4b95feb429
commit 62dc1bfe1d
1 changed files with 6 additions and 0 deletions

View File

@ -59,6 +59,9 @@ public class BaseController {
* @return
*/
public <T,DTO> QueryWrapper<T> buildQueryWrapper(DTO entityOrDto) throws Exception{
if(entityOrDto instanceof HttpServletRequest){
throw new Exception("参数错误buildQueryWrapper()参数为Entity/DTO对象");
}
return QueryBuilder.toQueryWrapper(entityOrDto);
}
@ -69,6 +72,9 @@ public class BaseController {
* @return
*/
public <T,DTO> LambdaQueryWrapper<T> buildLambdaQueryWrapper(DTO entityOrDto) throws Exception{
if(entityOrDto instanceof HttpServletRequest){
throw new Exception("参数错误buildQueryWrapper()参数为Entity/DTO对象");
}
return QueryBuilder.toLambdaQueryWrapper(entityOrDto);
}