aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/service/security/annotation
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick/service/security/annotation')
-rw-r--r--src/main/java/com/juick/service/security/annotation/Visitor.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/com/juick/service/security/annotation/Visitor.java b/src/main/java/com/juick/service/security/annotation/Visitor.java
new file mode 100644
index 00000000..14d7cc87
--- /dev/null
+++ b/src/main/java/com/juick/service/security/annotation/Visitor.java
@@ -0,0 +1,12 @@
+package com.juick.service.security.annotation;
+
+import org.springframework.security.core.annotation.AuthenticationPrincipal;
+
+import java.lang.annotation.*;
+
+@Target({ ElementType.PARAMETER, ElementType.TYPE })
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+@AuthenticationPrincipal(errorOnInvalidType = true, expression = "user")
+public @interface Visitor {
+}