From: Kai Moritz Date: Sun, 12 Jul 2020 09:23:59 +0000 (+0200) Subject: WIP X-Git-Tag: wip-initial~15 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=57f90dfdd0b944c0ee82fe20ebe554f1f874fe57;p=demos%2Fkafka%2Foutbox WIP --- diff --git a/src/main/java/de/trion/kafka/outbox/OutboxController.java b/src/main/java/de/trion/kafka/outbox/OutboxController.java index 78d4999..f1119f2 100644 --- a/src/main/java/de/trion/kafka/outbox/OutboxController.java +++ b/src/main/java/de/trion/kafka/outbox/OutboxController.java @@ -30,10 +30,11 @@ public class OutboxController { public ResponseEntity getVorgang( UriComponentsBuilder builder, @RequestBody String username) { - User user = new User(username, LocalDateTime.now(), false); + String cleaned = username.trim().toLowerCase(); + User user = new User(cleaned, LocalDateTime.now(), false); repository.save(user); // TODO: Not-Unique Fehler auslösen - UriComponents uri = builder.path("/{username}").buildAndExpand(username); + UriComponents uri = builder.path("{username}").buildAndExpand(cleaned); return ResponseEntity.created(uri.toUri()).build(); } }