Skip to content

Instantly share code, notes, and snippets.

@ova2
Last active May 22, 2021 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ova2/dce524ef98c97af3527bf25c218e569e to your computer and use it in GitHub Desktop.
Save ova2/dce524ef98c97af3527bf25c218e569e to your computer and use it in GitHub Desktop.
@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