mirror of
https://github.com/continew-org/continew-starter.git
synced 2025-09-09 19:03:56 +08:00
fix(extension/crud): 修复使用 CrudRequestMapping 后自定义 API 不显示的问题
This commit is contained in:
@@ -49,11 +49,11 @@ public class CrudRequestMappingHandlerMapping extends RequestMappingHandlerMappi
|
|||||||
if (!handlerType.isAnnotationPresent(CrudRequestMapping.class)) {
|
if (!handlerType.isAnnotationPresent(CrudRequestMapping.class)) {
|
||||||
return requestMappingInfo;
|
return requestMappingInfo;
|
||||||
}
|
}
|
||||||
// 过滤 API,如果 API 列表中不包含,则忽略
|
|
||||||
CrudRequestMapping crudRequestMapping = handlerType.getDeclaredAnnotation(CrudRequestMapping.class);
|
CrudRequestMapping crudRequestMapping = handlerType.getDeclaredAnnotation(CrudRequestMapping.class);
|
||||||
|
// 过滤 API,如果非本类中定义,且 API 列表中不包含,则忽略
|
||||||
Api[] apiArr = crudRequestMapping.api();
|
Api[] apiArr = crudRequestMapping.api();
|
||||||
Api api = ExceptionUtils.exToNull(() -> Api.valueOf(method.getName().toUpperCase()));
|
Api api = ExceptionUtils.exToNull(() -> Api.valueOf(method.getName().toUpperCase()));
|
||||||
if (!ArrayUtil.containsAny(apiArr, Api.ALL, api)) {
|
if (method.getDeclaringClass() != handlerType && !ArrayUtil.containsAny(apiArr, Api.ALL, api)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
// 拼接路径(合并了 @RequestMapping 的部分能力)
|
// 拼接路径(合并了 @RequestMapping 的部分能力)
|
||||||
|
Reference in New Issue
Block a user