Spring Boot 3 整合 Mybatis-Plus 实现数据权限控制
早期使用spring boot的时候写数据权限是通过使用自定义一个切面@Aspect配合自定义DataScope注解来实现。
DataScopeAspect 类
@Aspect
@Component
public class DataScopeAspect {
@Resource
private SysDeptService sysDeptService;
@Resource
private SysUserRoleService sysUserRoleService;
@Resource
private SysRoleDeptService sysRoleDeptService;
/**
* 配置织入点
*/
@Pointcut("@annotation(cn.harry.common.annotation.DataScope)")
public void dataScopePointCut() {
}
@Before("dataScopePointCu