From 7d601fc90a7398f694d0ebc615c2e4108ae85b46 Mon Sep 17 00:00:00 2001 From: seungyeop-lee Date: Mon, 22 Jul 2024 18:37:02 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=9C=A0=EC=A0=80=20=EB=8B=89=EB=84=A4?= =?UTF-8?q?=EC=9E=84=20=EC=9E=85=EB=A0=A5=20=EC=8B=9C=20=EC=95=9E=EB=92=A4?= =?UTF-8?q?=20=EA=B3=B5=EB=B0=B1=20=EB=AC=B8=EC=9E=90=20=EB=AC=B4=EC=8B=9C?= =?UTF-8?q?=20=EB=A1=9C=EC=A7=81=20=EC=B6=94=EA=B0=80=20#166?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/vook/server/api/web/user/UserRestController.java | 2 +- .../vook/server/api/web/user/reqres/UserRegisterRequest.java | 4 +--- .../server/api/web/user/reqres/UserUpdateInfoRequest.java | 2 -- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/server/api/src/main/java/vook/server/api/web/user/UserRestController.java b/server/api/src/main/java/vook/server/api/web/user/UserRestController.java index a604f3f0..9928faec 100644 --- a/server/api/src/main/java/vook/server/api/web/user/UserRestController.java +++ b/server/api/src/main/java/vook/server/api/web/user/UserRestController.java @@ -62,7 +62,7 @@ public CommonApiResponse updateInfo( @AuthenticationPrincipal VookLoginUser loginUser, @Validated @RequestBody UserUpdateInfoRequest request ) { - userLogic.updateInfo(loginUser.getUid(), request.nickname()); + userLogic.updateInfo(loginUser.getUid(), request.nickname().trim()); return CommonApiResponse.ok(); } diff --git a/server/api/src/main/java/vook/server/api/web/user/reqres/UserRegisterRequest.java b/server/api/src/main/java/vook/server/api/web/user/reqres/UserRegisterRequest.java index 4c1b1564..83c590d8 100644 --- a/server/api/src/main/java/vook/server/api/web/user/reqres/UserRegisterRequest.java +++ b/server/api/src/main/java/vook/server/api/web/user/reqres/UserRegisterRequest.java @@ -4,12 +4,10 @@ import jakarta.validation.constraints.AssertTrue; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Size; import vook.server.api.domain.user.logic.UserRegisterCommand; public record UserRegisterRequest( @NotBlank - @Size(min = 1, max = 10) String nickname, @NotNull @@ -23,7 +21,7 @@ public record UserRegisterRequest( public UserRegisterCommand toCommand(String userUid) { return UserRegisterCommand.builder() .userUid(userUid) - .nickname(nickname) + .nickname(nickname.trim()) .marketingEmailOptIn(marketingEmailOptIn) .build(); } diff --git a/server/api/src/main/java/vook/server/api/web/user/reqres/UserUpdateInfoRequest.java b/server/api/src/main/java/vook/server/api/web/user/reqres/UserUpdateInfoRequest.java index 16cb375d..af529ef9 100644 --- a/server/api/src/main/java/vook/server/api/web/user/reqres/UserUpdateInfoRequest.java +++ b/server/api/src/main/java/vook/server/api/web/user/reqres/UserUpdateInfoRequest.java @@ -1,11 +1,9 @@ package vook.server.api.web.user.reqres; import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.Size; public record UserUpdateInfoRequest( @NotBlank - @Size(min = 1, max = 10) String nickname ) { }