WANG hace 6 años
padre
commit
e0706b36ef

+ 13 - 0
src/main/java/cn/com/qmth/examcloud/web/support/ApiInfo.java

@@ -49,6 +49,11 @@ public class ApiInfo implements Serializable {
 	 */
 	private boolean withoutStackTrace;
 
+	/**
+	 * 接口裸奔
+	 */
+	private boolean naked;
+
 	public Integer getId() {
 		return id;
 	}
@@ -105,4 +110,12 @@ public class ApiInfo implements Serializable {
 		this.withoutStackTrace = withoutStackTrace;
 	}
 
+	public boolean isNaked() {
+		return naked;
+	}
+
+	public void setNaked(boolean naked) {
+		this.naked = naked;
+	}
+
 }

+ 4 - 0
src/main/java/cn/com/qmth/examcloud/web/support/ApiInfoHolder.java

@@ -93,6 +93,7 @@ public class ApiInfoHolder implements ApplicationRunner {
 			ApiId apiId = handlerMethod.getMethodAnnotation(ApiId.class);
 			WithoutStackTrace withoutStackTrace = handlerMethod
 					.getMethodAnnotation(WithoutStackTrace.class);
+			Naked naked = handlerMethod.getMethodAnnotation(Naked.class);
 
 			ApiOperation apiOperation = handlerMethod.getMethodAnnotation(ApiOperation.class);
 
@@ -141,6 +142,9 @@ public class ApiInfoHolder implements ApplicationRunner {
 			if (null != withoutStackTrace) {
 				apiInfo.setWithoutStackTrace(withoutStackTrace.value());
 			}
+			if (null != naked) {
+				apiInfo.setNaked(naked.value());
+			}
 
 			if (null != apiId) {
 				if (apiIdSet.contains(apiId.value())) {

+ 24 - 0
src/main/java/cn/com/qmth/examcloud/web/support/Naked.java

@@ -0,0 +1,24 @@
+package cn.com.qmth.examcloud.web.support;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * 接口注解 <br>
+ * 接口裸奔<br>
+ *
+ * @author WANGWEI
+ * @date 2019年3月15日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface Naked {
+
+	boolean value() default true;
+
+}