| | |
| | | import org.aspectj.lang.annotation.Aspect; |
| | | import org.aspectj.lang.annotation.Before; |
| | | import org.aspectj.lang.reflect.MethodSignature; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; |
| | | import org.springframework.boot.context.properties.EnableConfigurationProperties; |
| | | import org.springframework.core.DefaultParameterNameDiscoverer; |
| | | import org.springframework.expression.EvaluationContext; |
| | | import org.springframework.expression.Expression; |
| | |
| | | */ |
| | | @Slf4j |
| | | @Aspect |
| | | @EnableConfigurationProperties(AuditLogProperties.class) |
| | | @ConditionalOnClass({HttpServletRequest.class, RequestContextHolder.class}) |
| | | public class AuditLogAspect { |
| | | @Value("${spring.application.name}") |
| | | private String applicationName; |
| | | |
| | | @Autowired |
| | | private AuditLogProperties auditLogProperties; |
| | | @Autowired(required = false) |
| | | private IAuditService auditService; |
| | | |
| | | public AuditLogAspect(AuditLogProperties auditLogProperties, IAuditService auditService) { |
| | | this.auditLogProperties = auditLogProperties; |
| | | this.auditService = auditService; |
| | | } |
| | | // public AuditLogAspect(AuditLogProperties auditLogProperties, IAuditService auditService) { |
| | | // this.auditLogProperties = auditLogProperties; |
| | | // this.auditService = auditService; |
| | | // } |
| | | |
| | | /** |
| | | * 用于SpEL表达式解析. |