Skip to content

Commit

Permalink
#520 [feat] 관리자페이지 멤버 삭제 인가체제 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
parkheeddong committed Oct 6, 2024
1 parent 0ea0caf commit 8f65437
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -26,11 +28,11 @@ public class WriterNameController implements WriterNameControllerSwagger {

@Override
@DeleteMapping("/{writerNameId}")
@UserAuthAnnotation(UserAuthenticationType.OWNER)
public ResponseEntity<SuccessResponse> 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));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ public interface WriterNameControllerSwagger {
}
)
ResponseEntity<SuccessResponse> deleteMember(
@PathVariable("writerNameId") final Long writerNameId,
@UserId final Long userId
@PathVariable("writerNameId") final Long writerNameId
);

@Operation(summary = "필명, 소개글 조회")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 8f65437

Please sign in to comment.