File tree 1 file changed +17
-0
lines changed
server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/framework/configuration
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 1
1
package org .lowcoder .api .framework .configuration ;
2
2
3
+ import com .fasterxml .jackson .databind .ObjectMapper ;
4
+ import lombok .RequiredArgsConstructor ;
3
5
import org .lowcoder .api .framework .plugin .endpoint .ReloadableRouterFunctionMapping ;
4
6
import org .springframework .context .annotation .Configuration ;
7
+ import org .springframework .http .codec .ServerCodecConfigurer ;
8
+ import org .springframework .http .codec .json .Jackson2JsonDecoder ;
9
+ import org .springframework .http .codec .json .Jackson2JsonEncoder ;
5
10
import org .springframework .web .reactive .config .WebFluxConfigurationSupport ;
6
11
import org .springframework .web .reactive .function .server .support .RouterFunctionMapping ;
7
12
13
+ @ RequiredArgsConstructor
8
14
@ Configuration
9
15
public class CustomWebFluxConfigurationSupport extends WebFluxConfigurationSupport
10
16
{
17
+ private final ObjectMapper objectMapper ;
18
+
11
19
@ Override
12
20
protected RouterFunctionMapping createRouterFunctionMapping ()
13
21
{
14
22
return new ReloadableRouterFunctionMapping ();
15
23
}
24
+
25
+
26
+ @ Override
27
+ protected void configureHttpMessageCodecs (ServerCodecConfigurer configurer ) {
28
+ configurer .defaultCodecs ()
29
+ .jackson2JsonDecoder (new Jackson2JsonDecoder (objectMapper ));
30
+ configurer .defaultCodecs ()
31
+ .jackson2JsonEncoder (new Jackson2JsonEncoder (objectMapper ));
32
+ }
16
33
}
You can’t perform that action at this time.
0 commit comments