mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 15:09:19 +08:00
初始化项目
This commit is contained in:
+40
@@ -0,0 +1,40 @@
|
||||
package top.xyquan.ecomdmbbackend.common.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 权限控制注解
|
||||
* 用于标记需要权限验证的接口
|
||||
*/
|
||||
@Target({ ElementType.METHOD, ElementType.TYPE })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface RequirePermission {
|
||||
|
||||
/**
|
||||
* 权限码,如 "company:create", "user:read"
|
||||
*/
|
||||
String value() default "";
|
||||
|
||||
/**
|
||||
* 权限描述
|
||||
*/
|
||||
String description() default "";
|
||||
|
||||
/**
|
||||
* 是否允许超级管理员访问(默认允许)
|
||||
*/
|
||||
boolean allowSuper() default true;
|
||||
|
||||
/**
|
||||
* 是否允许公司管理员访问(默认允许)
|
||||
*/
|
||||
boolean allowCompany() default true;
|
||||
|
||||
/**
|
||||
* 是否允许普通用户访问(需要根据岗位权限判断)
|
||||
*/
|
||||
boolean allowUser() default true;
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package top.xyquan.ecomdmbbackend.common.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 角色权限注解
|
||||
* 用于简单的角色权限控制
|
||||
*/
|
||||
@Target({ ElementType.METHOD, ElementType.TYPE })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface RequireRole {
|
||||
|
||||
/**
|
||||
* 允许的角色列表
|
||||
*/
|
||||
String[] value() default {};
|
||||
|
||||
/**
|
||||
* 权限描述
|
||||
*/
|
||||
String description() default "";
|
||||
|
||||
/**
|
||||
* 是否允许超级管理员访问(默认允许)
|
||||
*/
|
||||
boolean allowSuper() default true;
|
||||
|
||||
/**
|
||||
* 是否允许公司管理员访问(默认允许)
|
||||
*/
|
||||
boolean allowCompany() default true;
|
||||
|
||||
/**
|
||||
* 是否允许普通用户访问(默认不允许)
|
||||
*/
|
||||
boolean allowUser() default false;
|
||||
}
|
||||
Reference in New Issue
Block a user