//如果返回值类型为Result,则不再进行处理
System.out.println("getParameterType" + methodParameter.getParameterType() + "," + methodParameter.getParameterType().equals(ResponseData.class));
System.out.println("getGenericParameterType" + methodParameter.getGenericParameterType() + "," + methodParameter.getGenericParameterType().equals(ResponseData.class));
System.out.println("getNestedParameterType" + methodParameter.getNestedParameterType() + "," + methodParameter.getNestedParameterType().equals(ResponseData.class));
System.out.println("getNestedGenericParameterType" + methodParameter.getNestedGenericParameterType() + "," + methodParameter.getNestedGenericParameterType().equals(ResponseData.class));
@RequestMapping("hello1")
public ResponseData hello1() {
// return "" + 123;
return null;
}
@RequestMapping("hello2")
public ResponseData<T> hello2() {
return null;
}
@RequestMapping("hello3")
public ResponseData<?> hello3() {
return null;
}
@RequestMapping("hello4")
public ResponseData<Person> hello4() {
return null;
}
使用第一种就好