【修改】 名称替换
This commit is contained in:
@@ -16,7 +16,7 @@ import java.util.List;
|
||||
/**
|
||||
* 数据权限的自动配置类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author 朋辰
|
||||
*/
|
||||
@AutoConfiguration
|
||||
public class ExamDataPermissionAutoConfiguration {
|
||||
|
@@ -14,7 +14,7 @@ import java.util.List;
|
||||
/**
|
||||
* 基于部门的数据权限 AutoConfiguration
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author 朋辰
|
||||
*/
|
||||
@AutoConfiguration
|
||||
@ConditionalOnClass(LoginUser.class)
|
||||
|
@@ -8,7 +8,7 @@ import java.lang.annotation.*;
|
||||
* 数据权限注解
|
||||
* 可声明在类或者方法上,标识使用的数据权限规则
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author 朋辰
|
||||
*/
|
||||
@Target({ElementType.TYPE, ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
|
@@ -12,7 +12,7 @@ import org.springframework.aop.support.annotation.AnnotationMatchingPointcut;
|
||||
/**
|
||||
* {@link pc.exam.pp.framework.datapermission.core.annotation.DataPermission} 注解的 Advisor 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author 朋辰
|
||||
*/
|
||||
@Getter
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
|
@@ -16,7 +16,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
* 1. 在执行方法前,将 @DataPermission 注解入栈
|
||||
* 2. 在执行方法后,将 @DataPermission 注解出栈
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author 朋辰
|
||||
*/
|
||||
@DataPermission // 该注解,用于 {@link DATA_PERMISSION_NULL} 的空对象
|
||||
public class DataPermissionAnnotationInterceptor implements MethodInterceptor {
|
||||
|
@@ -9,7 +9,7 @@ import java.util.List;
|
||||
/**
|
||||
* {@link DataPermission} 注解的 Context 上下文
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author 朋辰
|
||||
*/
|
||||
public class DataPermissionContextHolder {
|
||||
|
||||
|
@@ -18,7 +18,7 @@ import java.util.List;
|
||||
* 它的底层,是基于 MyBatis Plus 的 <a href="https://baomidou.com/plugins/data-permission/">数据权限插件</a>
|
||||
* 核心原理:它会在 SQL 执行前拦截 SQL 语句,并根据用户权限动态添加权限相关的 SQL 片段。这样,只有用户有权限访问的数据才会被查询出来
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author 朋辰
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public class DataPermissionRuleHandler implements MultiDataPermissionHandler {
|
||||
|
@@ -10,7 +10,7 @@ import java.util.Set;
|
||||
* 数据权限规则接口
|
||||
* 通过实现接口,自定义数据规则。例如说,
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author 朋辰
|
||||
*/
|
||||
public interface DataPermissionRule {
|
||||
|
||||
|
@@ -6,7 +6,7 @@ import java.util.List;
|
||||
* {@link DataPermissionRule} 工厂接口
|
||||
* 作为 {@link DataPermissionRule} 的容器,提供管理能力
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author 朋辰
|
||||
*/
|
||||
public interface DataPermissionRuleFactory {
|
||||
|
||||
|
@@ -14,7 +14,7 @@ import java.util.stream.Collectors;
|
||||
* 默认的 DataPermissionRuleFactoryImpl 实现类
|
||||
* 支持通过 {@link DataPermissionContextHolder} 过滤数据权限
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author 朋辰
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public class DataPermissionRuleFactoryImpl implements DataPermissionRuleFactory {
|
||||
|
@@ -43,7 +43,7 @@ import java.util.Set;
|
||||
* 3)想要保证原 dept_id 和 user_id 都可以看的到,此时使用 dept_id 和 user_id 一起过滤;
|
||||
* 最终过滤条件是 WHERE dept_id = ? OR user_id IN (?, ?, ? ...)
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author 朋辰
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Slf4j
|
||||
|
@@ -3,7 +3,7 @@ package pc.exam.pp.framework.datapermission.core.rule.dept;
|
||||
/**
|
||||
* {@link DeptDataPermissionRule} 的自定义配置接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author 朋辰
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface DeptDataPermissionRuleCustomizer {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* 基于部门的数据权限规则
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author 朋辰
|
||||
*/
|
||||
package pc.exam.pp.framework.datapermission.core.rule.dept;
|
||||
|
@@ -9,7 +9,7 @@ import java.util.concurrent.Callable;
|
||||
/**
|
||||
* 数据权限 Util
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author 朋辰
|
||||
*/
|
||||
public class DataPermissionUtils {
|
||||
|
||||
|
Reference in New Issue
Block a user