File tree Expand file tree Collapse file tree 4 files changed +15
-16
lines changed
lowcoder-domain/src/main/java/org/lowcoder/domain/serversetting/service
lowcoder-server/src/main/java/org/lowcoder/api/config Expand file tree Collapse file tree 4 files changed +15
-16
lines changed Original file line number Diff line number Diff line change 11package org .lowcoder .domain .serversetting .service ;
22
3- import org .lowcoder .domain .serversetting .model .ServerSetting ;
4- import reactor .core .publisher .Flux ;
3+ import reactor .core .publisher .Mono ;
4+
5+ import java .util .Map ;
56
67public interface ServerSettingService {
78
8- Flux < ServerSetting > findAll ();
9+ Mono < Map < String , String >> getServerSettingsMap ();
910}
Original file line number Diff line number Diff line change 22
33import lombok .extern .slf4j .Slf4j ;
44import org .lowcoder .domain .serversetting .model .ServerSetting ;
5- import org .lowcoder .sdk .exception .BizError ;
6- import org .lowcoder .sdk .exception .BizException ;
75import org .springframework .beans .factory .annotation .Autowired ;
86import org .springframework .stereotype .Service ;
97import reactor .core .publisher .Flux ;
@@ -39,8 +37,8 @@ public ServerSettingServiceImpl(ServerSettingRepository repository) {
3937 }
4038
4139 @ Override
42- public Flux < ServerSetting > findAll () {
43- return repository .findAll ();
40+ public Mono < Map < String , String >> getServerSettingsMap () {
41+ return repository .findAll (). collectMap ( ServerSetting :: getKey , ServerSetting :: getValue ) ;
4442 }
4543
4644 @ PostConstruct
Original file line number Diff line number Diff line change 11package org .lowcoder .api .config ;
22
33import lombok .RequiredArgsConstructor ;
4- import org .lowcoder .api .framework .view .ResponseView ;
54import org .lowcoder .domain .serversetting .model .ServerSetting ;
6- import org .lowcoder .domain .serversetting .service .ServerSettingRepository ;
75import org .lowcoder .domain .serversetting .service .ServerSettingService ;
86import org .springframework .web .bind .annotation .RestController ;
9- import reactor .core .publisher .Flux ;
7+ import reactor .core .publisher .Mono ;
8+
9+ import java .util .Map ;
1010
1111@ RequiredArgsConstructor
1212@ RestController
1313public class ServerSettingController implements ServerSettingEndpoints
1414{
1515 private final ServerSettingService serverSettingService ;
1616 @ Override
17- public Flux < ServerSetting > getServerSettings () {
18- return serverSettingService .findAll ();
17+ public Mono < Map < String , String > > getServerSettings () {
18+ return serverSettingService .getServerSettingsMap ();
1919 }
2020
2121}
Original file line number Diff line number Diff line change 11package org .lowcoder .api .config ;
22
33import io .swagger .v3 .oas .annotations .Operation ;
4- import org .lowcoder .api .framework .view .ResponseView ;
5- import org .lowcoder .domain .serversetting .model .ServerSetting ;
64import org .lowcoder .infra .constant .NewUrl ;
75import org .lowcoder .infra .constant .Url ;
86import org .springframework .web .bind .annotation .GetMapping ;
97import org .springframework .web .bind .annotation .RequestMapping ;
108import org .springframework .web .bind .annotation .RestController ;
11- import reactor .core .publisher .Flux ;
9+ import reactor .core .publisher .Mono ;
10+
11+ import java .util .Map ;
1212
1313@ RestController
1414@ RequestMapping (value = {Url .SERVER_SETTING_URL , NewUrl .SERVER_SETTING_URL })
@@ -23,5 +23,5 @@ public interface ServerSettingEndpoints
2323 description = "Retrieve the list of server settings for Lowcoder."
2424 )
2525 @ GetMapping
26- Flux < ServerSetting > getServerSettings ();
26+ Mono < Map < String , String > > getServerSettings ();
2727}
You can’t perform that action at this time.
0 commit comments