diff --git a/src/org/redkale/net/http/HttpServlet.java b/src/org/redkale/net/http/HttpServlet.java index b0b7ef422..14fd38cb8 100644 --- a/src/org/redkale/net/http/HttpServlet.java +++ b/src/org/redkale/net/http/HttpServlet.java @@ -164,7 +164,6 @@ public class HttpServlet extends Servlet private HashMap load() { WebServlet module = this.getClass().getAnnotation(WebServlet.class); final int serviceid = module == null ? 0 : module.moduleid(); - final boolean typeIgnore = module == null ? true : !module.auth(); final HashMap map = new HashMap<>(); HashMap nameset = new HashMap<>(); final Class selfClz = this.getClass(); @@ -196,7 +195,7 @@ public class HttpServlet extends Servlet throw new RuntimeException(this.getClass().getSimpleName() + " have two same " + HttpMapping.class.getSimpleName() + "(" + name + ")"); } nameset.put(name, clz); - map.put(name, new Entry(typeIgnore, serviceid, actionid, name, methods, method, createHttpServlet(method))); + map.put(name, new Entry(serviceid, actionid, name, methods, method, createHttpServlet(method))); } } while ((clz = clz.getSuperclass()) != HttpServlet.class); return map; @@ -283,7 +282,7 @@ public class HttpServlet extends Servlet private static final class Entry { - public Entry(boolean typeIgnore, int moduleid, int actionid, String name, String[] methods, Method method, HttpServlet servlet) { + public Entry(int moduleid, int actionid, String name, String[] methods, Method method, HttpServlet servlet) { this.moduleid = moduleid; this.actionid = actionid; this.name = name; @@ -291,7 +290,7 @@ public class HttpServlet extends Servlet this.method = method; this.servlet = servlet; HttpMapping mapping = method.getAnnotation(HttpMapping.class); - this.ignore = typeIgnore || (mapping == null || !mapping.auth()); + this.ignore = mapping == null || !mapping.auth(); this.cacheseconds = mapping == null ? 0 : mapping.cacheseconds(); this.cache = cacheseconds > 0 ? new ConcurrentHashMap() : null; this.cacheHandler = cacheseconds > 0 ? (HttpResponse response, ByteBuffer[] buffers) -> { diff --git a/src/org/redkale/net/http/Rest.java b/src/org/redkale/net/http/Rest.java index b4e725b63..6acda1cf6 100644 --- a/src/org/redkale/net/http/Rest.java +++ b/src/org/redkale/net/http/Rest.java @@ -164,7 +164,6 @@ public final class Rest { { //注入 @WebServlet 注解 String urlpath = "/" + defmodulename + "/*"; int moduleid = controller == null ? 0 : controller.moduleid(); - boolean auth = controller == null ? false : controller.auth(); boolean repair = controller == null ? true : controller.repair(); String comment = controller == null ? "" : controller.comment(); av0 = cw.visitAnnotation(webServletDesc, true); @@ -174,13 +173,11 @@ public final class Rest { av1.visitEnd(); } av0.visit("moduleid", moduleid); - av0.visit("auth", auth); av0.visit("repair", repair); av0.visit("comment", comment); av0.visitEnd(); classMap.put("type", serviceType.getName()); classMap.put("url", urlpath); - classMap.put("auth", auth); classMap.put("moduleid", moduleid); classMap.put("repair", repair); classMap.put("comment", comment); diff --git a/src/org/redkale/net/http/RestService.java b/src/org/redkale/net/http/RestService.java index 6913ea9c5..08c15ab71 100644 --- a/src/org/redkale/net/http/RestService.java +++ b/src/org/redkale/net/http/RestService.java @@ -50,14 +50,6 @@ public @interface RestService { */ boolean ignore() default false; - /** - * 是否鉴权,默认不鉴权
- * 同@WebServlet的auth属性 - * - * @return boolean - */ - boolean auth() default false; - /** * 同@WebServlet的repair属性 * diff --git a/src/org/redkale/net/http/WebServlet.java b/src/org/redkale/net/http/WebServlet.java index 43ac50711..98f3d5070 100644 --- a/src/org/redkale/net/http/WebServlet.java +++ b/src/org/redkale/net/http/WebServlet.java @@ -49,14 +49,6 @@ public @interface WebServlet { */ int moduleid() default 0; - /** - * 是否鉴权,默认不鉴权
- * 标记为不鉴权的HttpServlet, 其内部所有方法都将不进行鉴权 - * - * @return boolean - */ - boolean auth() default false; - /** * 备注描述 *