diff --git a/src/main/java/com/j9/bestmoments/controller/MyVideoController.java b/src/main/java/com/j9/bestmoments/controller/MyVideoController.java index cf93358..f48a193 100644 --- a/src/main/java/com/j9/bestmoments/controller/MyVideoController.java +++ b/src/main/java/com/j9/bestmoments/controller/MyVideoController.java @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; +import java.util.List; import java.util.UUID; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Page; @@ -100,4 +101,21 @@ public ResponseEntity> findDeletedVideos(Pageable pageable return ResponseEntity.ok(videos.map(VideoPreviewDto::of)); } + @Operation(summary = "태그 수정") + @PostMapping("/{videoId}/tags") + public ResponseEntity findAllByTag(@PathVariable UUID videoId, @RequestBody List tags) { + UUID memberId = UUID.fromString(SecurityContextHolder.getContext().getAuthentication().getPrincipal().toString()); + Video video = videoService.findByIdAndUploaderId(videoId, memberId); + videoService.setVideoTags(video, tags); + return ResponseEntity.ok(null); + } + + @Operation(summary = "태그로 동영상 목록 조회") + @GetMapping("/tags/{tag}") + public ResponseEntity> findAllByTag(@PathVariable String tag, Pageable pageable) { + UUID memberId = UUID.fromString(SecurityContextHolder.getContext().getAuthentication().getPrincipal().toString()); + Page