优化ApiArgumentResolver

This commit is contained in:
tanghc
2019-04-29 19:58:30 +08:00
parent dcd5017b16
commit ff20b1069a
5 changed files with 9 additions and 12 deletions

View File

@@ -28,9 +28,8 @@ public class ApiArgumentResolver implements HandlerMethodArgumentResolver {
}
boolean hasAnnotation = methodParameter.getMethodAnnotation(ApiMapping.class) != null
|| methodParameter.getMethodAnnotation(ApiAbility.class) != null;
boolean isFirstParameter = methodParameter.getParameterIndex() == 0;
// 有注解,并且是第一个参数
return hasAnnotation && isFirstParameter;
// 有注解
return hasAnnotation;
}
@Override