控制器类
@RequestMapping(value = "/addObj", method = RequestMethod.POST, consumes = "application/json")
public Response generic(@RequestBody Object object) throws IOException{
System.out.println("Object controller");
return service1.generic(object);
}
服务等级
@Transactional
public Response generic(Object list){
System.out.println("service");
return studentDAO.generic(list);
}
道课
@SuppressWarnings("unchecked")
public Response generic(Object list){
System.out.println("generic");
if(list instanceof ClassA ){
List121 c1=(List121) list;
addObjA(c1);
}
else if(list instanceof ClassB ){
List121 c1=(List121) list;
addObjB(c1);
}
else if(list instanceof ClassC ){
List121 c1=(List121) list;
addObjC(c1);
}
response.setStatus(200);
response.setMessage("succesfull");
return response;
}
在这里,我无法理解如何检查哪个列表包含 给定对象任何建议都欢迎,谢谢