From 728a8e56343d3e9c5e1011bafab4a386dae160c3 Mon Sep 17 00:00:00 2001 From: ywonchae1 Date: Tue, 30 Jul 2024 21:58:49 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20spotless=20=EC=A0=81=EC=9A=A9=20(#94)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/depromeet/member/api/MemberApi.java | 4 ++-- .../java/com/depromeet/member/api/MemberController.java | 7 +++---- .../depromeet/member/dto/request/NameUpdateRequest.java | 3 +-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/module-presentation/src/main/java/com/depromeet/member/api/MemberApi.java b/module-presentation/src/main/java/com/depromeet/member/api/MemberApi.java index ba5b0b1e..39dc66b3 100644 --- a/module-presentation/src/main/java/com/depromeet/member/api/MemberApi.java +++ b/module-presentation/src/main/java/com/depromeet/member/api/MemberApi.java @@ -6,6 +6,7 @@ import com.depromeet.member.dto.response.MemberFindOneResponse; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; @@ -16,6 +17,5 @@ public interface MemberApi { @Operation(summary = "닉네임 수정") ApiResponse updateName( - @LoginMember Long id, - @RequestBody NameUpdateRequest updateNameRequest); + @LoginMember Long id, @Valid @RequestBody NameUpdateRequest updateNameRequest); } diff --git a/module-presentation/src/main/java/com/depromeet/member/api/MemberController.java b/module-presentation/src/main/java/com/depromeet/member/api/MemberController.java index 03d38ede..29523bb6 100644 --- a/module-presentation/src/main/java/com/depromeet/member/api/MemberController.java +++ b/module-presentation/src/main/java/com/depromeet/member/api/MemberController.java @@ -6,7 +6,6 @@ import com.depromeet.member.dto.request.NameUpdateRequest; import com.depromeet.member.dto.response.MemberFindOneResponse; import com.depromeet.member.facade.MemberFacade; -import com.depromeet.member.port.in.usecase.MemberUseCase; import com.depromeet.type.member.MemberSuccessType; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; @@ -25,9 +24,9 @@ public ApiResponse getMember(@PathVariable("id") Long id) @PatchMapping public ApiResponse updateName( - @LoginMember Long id, - @RequestBody NameUpdateRequest updateNameRequest) { + @LoginMember Long id, @RequestBody NameUpdateRequest updateNameRequest) { Member member = memberFacade.updateName(id, updateNameRequest.name()); - return ApiResponse.success(MemberSuccessType.UPDATE_NAME_SUCCESS, MemberFindOneResponse.of(member)); + return ApiResponse.success( + MemberSuccessType.UPDATE_NAME_SUCCESS, MemberFindOneResponse.of(member)); } } diff --git a/module-presentation/src/main/java/com/depromeet/member/dto/request/NameUpdateRequest.java b/module-presentation/src/main/java/com/depromeet/member/dto/request/NameUpdateRequest.java index af0ae194..0a8fa5fe 100644 --- a/module-presentation/src/main/java/com/depromeet/member/dto/request/NameUpdateRequest.java +++ b/module-presentation/src/main/java/com/depromeet/member/dto/request/NameUpdateRequest.java @@ -2,5 +2,4 @@ import jakarta.validation.constraints.NotNull; -public record NameUpdateRequest(@NotNull String name) { -} +public record NameUpdateRequest(@NotNull String name) {}