diff --git a/module-api/src/main/java/com/mile/controller/topic/TopicController.java b/module-api/src/main/java/com/mile/controller/topic/TopicController.java index 7db4a404..150ee0dd 100644 --- a/module-api/src/main/java/com/mile/controller/topic/TopicController.java +++ b/module-api/src/main/java/com/mile/controller/topic/TopicController.java @@ -1,5 +1,7 @@ package com.mile.controller.topic; +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; @@ -59,13 +61,14 @@ public ResponseEntity deleteTopic( } @PutMapping("/{topicId}") + @UserAuthAnnotation(UserAuthenticationType.OWNER) public ResponseEntity putTopic( @RequestBody @Valid final TopicPutRequest topicPutRequest, @TopicIdPathVariable final Long topicId, - @UserId final Long userId, @PathVariable("topicId") final String topicUrl ) { - topicService.putTopic(userId, topicId, topicPutRequest); + topicService.putTopic(topicId, topicPutRequest); return ResponseEntity.ok(SuccessResponse.of(SuccessMessage.TOPIC_PUT_SUCCESS)); } + } diff --git a/module-api/src/main/java/com/mile/controller/topic/TopicControllerSwagger.java b/module-api/src/main/java/com/mile/controller/topic/TopicControllerSwagger.java index e76194c1..e20aa4ee 100644 --- a/module-api/src/main/java/com/mile/controller/topic/TopicControllerSwagger.java +++ b/module-api/src/main/java/com/mile/controller/topic/TopicControllerSwagger.java @@ -95,7 +95,6 @@ ResponseEntity deleteTopic( ResponseEntity putTopic( @RequestBody final TopicPutRequest topicPutRequest, @Parameter(schema = @Schema(implementation = String.class), in = ParameterIn.PATH) final Long topicId, - @Parameter(schema = @Schema(implementation = String.class), in = ParameterIn.PATH) @UserId final Long userId, @PathVariable("topicId") final String topicUrl ); } diff --git a/module-domain/src/main/java/com/mile/moim/service/MoimService.java b/module-domain/src/main/java/com/mile/moim/service/MoimService.java index e82c9b68..95ba6434 100644 --- a/module-domain/src/main/java/com/mile/moim/service/MoimService.java +++ b/module-domain/src/main/java/com/mile/moim/service/MoimService.java @@ -90,6 +90,7 @@ public WriterNameInformationResponse getWriterNameOfUser( return writerNameRetriever.findWriterNameInfo(writerNameId); } + public WriterNameConflictCheckResponse checkConflictOfWriterName(Long moimId, String writerName) { if (writerName.length() > WRITER_NAME_MAX_VALUE) { throw new BadRequestException(ErrorMessage.WRITER_NAME_LENGTH_WRONG); diff --git a/module-domain/src/main/java/com/mile/topic/service/TopicService.java b/module-domain/src/main/java/com/mile/topic/service/TopicService.java index c34bee67..a30a4a2f 100644 --- a/module-domain/src/main/java/com/mile/topic/service/TopicService.java +++ b/module-domain/src/main/java/com/mile/topic/service/TopicService.java @@ -57,11 +57,10 @@ public void deleteTopic( } public void putTopic( - final Long userId, final Long topicId, final TopicPutRequest topicPutRequest ) { - topicUpdator.putTopic(userId, topicId, topicPutRequest); + topicUpdator.putTopic(topicId, topicPutRequest); } } diff --git a/module-domain/src/main/java/com/mile/topic/service/TopicUpdator.java b/module-domain/src/main/java/com/mile/topic/service/TopicUpdator.java index 811ca528..4287883c 100644 --- a/module-domain/src/main/java/com/mile/topic/service/TopicUpdator.java +++ b/module-domain/src/main/java/com/mile/topic/service/TopicUpdator.java @@ -18,13 +18,10 @@ public class TopicUpdator { @Transactional public void putTopic( - final Long userId, final Long topicId, final TopicPutRequest topicPutRequest ) { Topic topic = topicRetriever.findById(topicId); - User user = userService.findById(userId); - topicRetriever.authenticateTopicWithUser(topic, user); topic.updateTopic(topicPutRequest); }