Commit a0d8901 1 parent e07c7a1 commit a0d8901 Copy full SHA for a0d8901
File tree 4 files changed +41
-2
lines changed
src/main/java/io/github/yangziwen/logreplay
4 files changed +41
-2
lines changed Original file line number Diff line number Diff line change 10
10
import org .springframework .transaction .annotation .EnableTransactionManagement ;
11
11
import org .springframework .web .socket .config .annotation .EnableWebSocketMessageBroker ;
12
12
13
+ import io .github .yangziwen .logreplay .annotation .EnableAudit ;
14
+
15
+ @ EnableAudit
13
16
@ EnableCaching
14
17
@ ServletComponentScan
15
18
@ EnableTransactionManagement
Original file line number Diff line number Diff line change
1
+ package io .github .yangziwen .logreplay .annotation ;
2
+
3
+ import org .springframework .context .annotation .ImportSelector ;
4
+ import org .springframework .core .type .AnnotationMetadata ;
5
+
6
+ import io .github .yangziwen .logreplay .config .AuditConfig ;
7
+
8
+ public class AuditConfigurationSelector implements ImportSelector {
9
+
10
+ @ Override
11
+ public String [] selectImports (AnnotationMetadata importingClassMetadata ) {
12
+ return new String [] {AuditConfig .class .getName ()};
13
+ }
14
+
15
+ }
Original file line number Diff line number Diff line change
1
+ package io .github .yangziwen .logreplay .annotation ;
2
+
3
+ import java .lang .annotation .Documented ;
4
+ import java .lang .annotation .ElementType ;
5
+ import java .lang .annotation .Retention ;
6
+ import java .lang .annotation .RetentionPolicy ;
7
+ import java .lang .annotation .Target ;
8
+
9
+ import org .springframework .context .annotation .Import ;
10
+
11
+ @ Retention (RetentionPolicy .RUNTIME )
12
+ @ Documented
13
+ @ Target (ElementType .TYPE )
14
+ @ Import (AuditConfigurationSelector .class )
15
+ public @interface EnableAudit {
16
+
17
+ }
Original file line number Diff line number Diff line change 11
11
import org .audit4j .integration .spring .SpringAudit4jConfig ;
12
12
import org .springframework .beans .factory .annotation .Autowired ;
13
13
import org .springframework .context .annotation .Bean ;
14
- import org .springframework .context .annotation .Configuration ;
15
14
16
15
import io .github .yangziwen .logreplay .audit .AuditMetaData ;
17
16
18
- @ Configuration
17
+ /**
18
+ * 审计相关的配置
19
+ * 基于@EnableAudit注解控制是否生效
20
+ *
21
+ * @author yangziwen
22
+ */
19
23
public class AuditConfig {
20
24
21
25
private CustomizableLayout layout () {
You can’t perform that action at this time.
0 commit comments