mirror of https://gitee.com/stylefeng/roses
【8.1.8】【rule】统一存放AOP顺序的常量
parent
65faabbebe
commit
5a6c5c25b9
|
@ -0,0 +1,33 @@
|
|||
package cn.stylefeng.roses.kernel.rule.constants;
|
||||
|
||||
/**
|
||||
* 数据范围
|
||||
* <p>
|
||||
* 默认事务的AOP顺序是Integer.MAX_VALUE,最大值,AOP最后执行
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2024/6/21 0:05
|
||||
*/
|
||||
public interface ProjectAopSortConstants {
|
||||
|
||||
/**
|
||||
* 多数据源切换的aop的顺序
|
||||
*/
|
||||
int MULTI_DATA_SOURCE_EXCHANGE_AOP = 1;
|
||||
|
||||
/**
|
||||
* 数据范围控制的AOP顺序
|
||||
*/
|
||||
int DATA_SCOPE_AOP_ORDER = 100;
|
||||
|
||||
/**
|
||||
* 默认业务日志记录的aop的顺序
|
||||
*/
|
||||
Integer DEFAULT_BUSINESS_LOG_AOP_SORT = 400;
|
||||
|
||||
/**
|
||||
* 默认api日志记录的aop的顺序
|
||||
*/
|
||||
Integer DEFAULT_API_LOG_AOP_SORT = 500;
|
||||
|
||||
}
|
|
@ -92,9 +92,4 @@ public interface DbConstants {
|
|||
*/
|
||||
String DRUID_WEB_STAT_FILTER_PROFILE_ENABLE = "true";
|
||||
|
||||
/**
|
||||
* 数据范围控制的AOP顺序
|
||||
*/
|
||||
int DATA_SCOPE_AOP_ORDER = 100;
|
||||
|
||||
}
|
||||
|
|
|
@ -26,11 +26,11 @@ package cn.stylefeng.roses.kernel.db.mp.datascope.aop;
|
|||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import cn.stylefeng.roses.kernel.db.api.constants.DbConstants;
|
||||
import cn.stylefeng.roses.kernel.db.mp.datascope.UserRoleDataScopeApi;
|
||||
import cn.stylefeng.roses.kernel.db.mp.datascope.annotations.DataScope;
|
||||
import cn.stylefeng.roses.kernel.db.mp.datascope.config.DataScopeConfig;
|
||||
import cn.stylefeng.roses.kernel.db.mp.datascope.holder.DataScopeHolder;
|
||||
import cn.stylefeng.roses.kernel.rule.constants.ProjectAopSortConstants;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.Signature;
|
||||
|
@ -120,7 +120,7 @@ public class DataScopeAop implements Ordered {
|
|||
*/
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return DbConstants.DATA_SCOPE_AOP_ORDER;
|
||||
return ProjectAopSortConstants.DATA_SCOPE_AOP_ORDER;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -47,11 +47,6 @@ public interface DatasourceContainerConstants {
|
|||
*/
|
||||
String MASTER_DATASOURCE_NAME = "master";
|
||||
|
||||
/**
|
||||
* 多数据源切换的aop的顺序
|
||||
*/
|
||||
int MULTI_DATA_SOURCE_EXCHANGE_AOP = 1;
|
||||
|
||||
/**
|
||||
* 数据源的分组标识
|
||||
*/
|
||||
|
|
|
@ -26,6 +26,7 @@ package cn.stylefeng.roses.kernel.dsctn.aop;
|
|||
|
||||
import cn.stylefeng.roses.kernel.dsctn.api.annotation.DataSource;
|
||||
import cn.stylefeng.roses.kernel.dsctn.api.context.CurrentDataSourceContext;
|
||||
import cn.stylefeng.roses.kernel.rule.constants.ProjectAopSortConstants;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.Signature;
|
||||
|
@ -38,7 +39,6 @@ import org.springframework.core.Ordered;
|
|||
import java.lang.reflect.Method;
|
||||
|
||||
import static cn.stylefeng.roses.kernel.dsctn.api.constants.DatasourceContainerConstants.MASTER_DATASOURCE_NAME;
|
||||
import static cn.stylefeng.roses.kernel.dsctn.api.constants.DatasourceContainerConstants.MULTI_DATA_SOURCE_EXCHANGE_AOP;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -97,7 +97,7 @@ public class MultiSourceExchangeAop implements Ordered {
|
|||
*/
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return MULTI_DATA_SOURCE_EXCHANGE_AOP;
|
||||
return ProjectAopSortConstants.MULTI_DATA_SOURCE_EXCHANGE_AOP;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -32,16 +32,6 @@ package cn.stylefeng.roses.kernel.log.api.constants;
|
|||
*/
|
||||
public interface LogFileConstants {
|
||||
|
||||
/**
|
||||
* 默认api日志记录的aop的顺序
|
||||
*/
|
||||
Integer DEFAULT_API_LOG_AOP_SORT = 500;
|
||||
|
||||
/**
|
||||
* 默认业务日志记录的aop的顺序
|
||||
*/
|
||||
Integer DEFAULT_BUSINESS_LOG_AOP_SORT = 400;
|
||||
|
||||
/**
|
||||
* 默认全局记录日志的开关
|
||||
*/
|
||||
|
|
|
@ -27,7 +27,6 @@ package cn.stylefeng.roses.kernel.log.requestapi.aop;
|
|||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.stylefeng.roses.kernel.auth.api.context.LoginContext;
|
||||
import cn.stylefeng.roses.kernel.auth.api.pojo.login.LoginUser;
|
||||
import cn.stylefeng.roses.kernel.log.api.constants.LogFileConstants;
|
||||
import cn.stylefeng.roses.kernel.log.api.expander.LogConfigExpander;
|
||||
import cn.stylefeng.roses.kernel.log.api.factory.LogRecordFactory;
|
||||
import cn.stylefeng.roses.kernel.log.api.factory.appender.AuthedLogAppender;
|
||||
|
@ -36,6 +35,7 @@ import cn.stylefeng.roses.kernel.log.api.factory.appender.ParamsLogAppender;
|
|||
import cn.stylefeng.roses.kernel.log.api.pojo.record.LogRecordDTO;
|
||||
import cn.stylefeng.roses.kernel.log.requestapi.LogRecordApi;
|
||||
import cn.stylefeng.roses.kernel.rule.annotation.ApiLog;
|
||||
import cn.stylefeng.roses.kernel.rule.constants.ProjectAopSortConstants;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.PostResource;
|
||||
|
@ -190,7 +190,7 @@ public class RequestApiLogRecordAop implements Ordered {
|
|||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return LogFileConstants.DEFAULT_API_LOG_AOP_SORT;
|
||||
return ProjectAopSortConstants.DEFAULT_API_LOG_AOP_SORT;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -27,11 +27,11 @@ package cn.stylefeng.roses.kernel.log.business.aop;
|
|||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.stylefeng.roses.kernel.auth.api.context.LoginContext;
|
||||
import cn.stylefeng.roses.kernel.auth.api.pojo.login.LoginUser;
|
||||
import cn.stylefeng.roses.kernel.log.api.constants.LogFileConstants;
|
||||
import cn.stylefeng.roses.kernel.log.api.context.BusinessLogHolder;
|
||||
import cn.stylefeng.roses.kernel.log.api.pojo.entity.SysLogBusiness;
|
||||
import cn.stylefeng.roses.kernel.log.business.service.SysLogBusinessService;
|
||||
import cn.stylefeng.roses.kernel.rule.annotation.BizLog;
|
||||
import cn.stylefeng.roses.kernel.rule.constants.ProjectAopSortConstants;
|
||||
import cn.stylefeng.roses.kernel.rule.util.HttpServletUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
@ -149,7 +149,7 @@ public class BusinessLogRecordAop implements Ordered {
|
|||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return LogFileConstants.DEFAULT_BUSINESS_LOG_AOP_SORT;
|
||||
return ProjectAopSortConstants.DEFAULT_BUSINESS_LOG_AOP_SORT;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue