4
4
import lombok .Setter ;
5
5
import lombok .experimental .SuperBuilder ;
6
6
import org .lowcoder .plugin .api .event .LowcoderEvent ;
7
+ import org .lowcoder .sdk .constants .GlobalContext ;
8
+ import reactor .util .context .ContextView ;
7
9
8
10
import java .lang .reflect .Field ;
9
11
import java .util .HashMap ;
@@ -19,6 +21,7 @@ public abstract class AbstractEvent implements LowcoderEvent
19
21
protected final Boolean isAnonymous ;
20
22
private final String ipAddress ;
21
23
protected Map <String , Object > details ;
24
+ protected Map <String , String > eventHeaders ;
22
25
@ Setter
23
26
private static String environmentID ;
24
27
@@ -42,7 +45,10 @@ public B detail(String name, String value)
42
45
}
43
46
}
44
47
45
- public void populateDetails () {
48
+ public void populateDetails (ContextView contextView ) {
49
+ //populate eventHeaders field
50
+ eventHeaders = contextView .get (GlobalContext .HEADERS );
51
+
46
52
if (details == null ) {
47
53
details = new HashMap <>();
48
54
}
@@ -57,5 +63,8 @@ public void populateDetails() {
57
63
58
64
}
59
65
details .put ("environmentId" , environmentID );
66
+ if (!details .containsKey ("headers" )) {
67
+ details .put ("headers" , eventHeaders );
68
+ }
60
69
}
61
- }
70
+ }
0 commit comments