buildQueryWrapper增加参数校验,避免误用
This commit is contained in:
parent
4b95feb429
commit
62dc1bfe1d
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue