diff --git a/module-api/src/main/java/com/mile/controller/writername/WriterNameController.java b/module-api/src/main/java/com/mile/controller/writername/WriterNameController.java index b6f547cb..eb74abcc 100644 --- a/module-api/src/main/java/com/mile/controller/writername/WriterNameController.java +++ b/module-api/src/main/java/com/mile/controller/writername/WriterNameController.java @@ -1,5 +1,7 @@ package com.mile.controller.writername; +import com.mile.common.auth.annotation.UserAuthAnnotation; +import com.mile.common.auth.annotation.UserAuthenticationType; import com.mile.common.resolver.user.UserId; import com.mile.dto.SuccessResponse; import com.mile.exception.message.SuccessMessage; @@ -26,11 +28,11 @@ public class WriterNameController implements WriterNameControllerSwagger { @Override @DeleteMapping("/{writerNameId}") + @UserAuthAnnotation(UserAuthenticationType.OWNER) public ResponseEntity deleteMember( - @PathVariable("writerNameId") final Long writerNameId, - @UserId final Long userId + @PathVariable("writerNameId") final Long writerNameId ) { - writerNameService.deleteWriterNameById(writerNameId, userId); + writerNameService.deleteWriterNameById(writerNameId); return ResponseEntity.ok(SuccessResponse.of(SuccessMessage.MOIM_MEMBER_DELETE_SUCCESS)); } diff --git a/module-api/src/main/java/com/mile/controller/writername/WriterNameControllerSwagger.java b/module-api/src/main/java/com/mile/controller/writername/WriterNameControllerSwagger.java index d176be98..c10f5da6 100644 --- a/module-api/src/main/java/com/mile/controller/writername/WriterNameControllerSwagger.java +++ b/module-api/src/main/java/com/mile/controller/writername/WriterNameControllerSwagger.java @@ -27,8 +27,7 @@ public interface WriterNameControllerSwagger { } ) ResponseEntity deleteMember( - @PathVariable("writerNameId") final Long writerNameId, - @UserId final Long userId + @PathVariable("writerNameId") final Long writerNameId ); @Operation(summary = "필명, 소개글 조회") diff --git a/module-domain/src/main/java/com/mile/writername/service/WriterNameService.java b/module-domain/src/main/java/com/mile/writername/service/WriterNameService.java index fe4cac62..673c9d7a 100644 --- a/module-domain/src/main/java/com/mile/writername/service/WriterNameService.java +++ b/module-domain/src/main/java/com/mile/writername/service/WriterNameService.java @@ -64,11 +64,9 @@ public void deleteWriterNameByUser(final User user) { public void deleteWriterNameById( - final Long writerNameId, - final Long userId + final Long writerNameId ) { WriterName writerName = writerNameRetriever.findById(writerNameId); - moimRetriever.authenticateOwnerOfMoim(writerName.getMoim(), userRetriever.findById(userId)); writerNameRemover.deleteWriterName(writerName); }