This commit is contained in:
Redkale
2017-05-16 17:13:51 +08:00
parent 7c0e60d191
commit 278c51e26b
2 changed files with 11 additions and 0 deletions

View File

@@ -164,6 +164,7 @@ public final class Rest {
{ //注入 @WebServlet 注解 { //注入 @WebServlet 注解
String urlpath = "/" + defmodulename + "/*"; String urlpath = "/" + defmodulename + "/*";
int moduleid = controller == null ? 0 : controller.moduleid(); int moduleid = controller == null ? 0 : controller.moduleid();
boolean auth = controller == null ? false : controller.auth();
boolean repair = controller == null ? true : controller.repair(); boolean repair = controller == null ? true : controller.repair();
String comment = controller == null ? "" : controller.comment(); String comment = controller == null ? "" : controller.comment();
av0 = cw.visitAnnotation(webServletDesc, true); av0 = cw.visitAnnotation(webServletDesc, true);
@@ -173,11 +174,13 @@ public final class Rest {
av1.visitEnd(); av1.visitEnd();
} }
av0.visit("moduleid", moduleid); av0.visit("moduleid", moduleid);
av0.visit("auth", auth);
av0.visit("repair", repair); av0.visit("repair", repair);
av0.visit("comment", comment); av0.visit("comment", comment);
av0.visitEnd(); av0.visitEnd();
classMap.put("type", serviceType.getName()); classMap.put("type", serviceType.getName());
classMap.put("url", urlpath); classMap.put("url", urlpath);
classMap.put("auth", auth);
classMap.put("moduleid", moduleid); classMap.put("moduleid", moduleid);
classMap.put("repair", repair); classMap.put("repair", repair);
classMap.put("comment", comment); classMap.put("comment", comment);

View File

@@ -50,6 +50,14 @@ public @interface RestService {
*/ */
boolean ignore() default false; boolean ignore() default false;
/**
* 是否鉴权,默认不鉴权 <br>
* 同&#64;WebServlet的auth属性
*
* @return boolean
*/
boolean auth() default false;
/** /**
* 同&#64;WebServlet的repair属性 * 同&#64;WebServlet的repair属性
* *