Last active
May 22, 2021 14:27
-
-
Save ova2/dce524ef98c97af3527bf25c218e569e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RestController | |
class TopologyController { | |
@GetMapping(path = "/uno", produces = {APPLICATION_JSON_VALUE}) | |
... | |
public Mono<UnoTopologyDto> getUnoTopology( | |
@RequestParam Set<String> stationNames, | |
@RequestParam(name = "replicationId", required = false) Long replicationId, | |
@RequestParam(name = "topoReferenceDate", required = false) | |
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate topoReferenceDate) { | |
final UnoTopologyRef unoTopologyRef = UnoTopologyRef.builder() | |
.stationNames(stationNames) | |
.replicationId(replicationId) | |
.topoReferenceDate(requireNonNullElseGet(topoReferenceDate, LocalDate::now)) | |
.build(); | |
return Mono.justOrEmpty(unoTopologyLoader.load(unoTopologyRef)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment