diff --git a/src/main/java/team7/inplace/video/application/VideoService.java b/src/main/java/team7/inplace/video/application/VideoService.java index 7f2a7d48..b8de2858 100644 --- a/src/main/java/team7/inplace/video/application/VideoService.java +++ b/src/main/java/team7/inplace/video/application/VideoService.java @@ -7,12 +7,14 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import team7.inplace.global.exception.InplaceException; +import team7.inplace.global.exception.code.AuthorizationErrorCode; import team7.inplace.global.exception.code.PlaceErrorCode; import team7.inplace.global.exception.code.VideoErrorCode; import team7.inplace.influencer.persistence.InfluencerRepository; import team7.inplace.place.application.dto.PlaceForVideo; import team7.inplace.place.domain.Place; import team7.inplace.place.persistence.PlaceRepository; +import team7.inplace.security.util.AuthorizationUtil; import team7.inplace.video.application.command.VideoCommand; import team7.inplace.video.application.command.VideoCommand.Create; import team7.inplace.video.application.dto.VideoInfo; @@ -35,6 +37,10 @@ public class VideoService { @Transactional(readOnly = true) public List getVideosBySurround(VideoSearchParams videoSearchParams) { + // 토큰 정보에 대한 검증 + if (AuthorizationUtil.isNotLoginUser()) { + throw InplaceException.of(AuthorizationErrorCode.TOKEN_IS_EMPTY); + } // Place 엔티티 조회 Page places = placeRepository.findPlacesByDistanceAndFilters( videoSearchParams.topLeftLongitude(), diff --git a/src/main/java/team7/inplace/video/persistence/VideoRepository.java b/src/main/java/team7/inplace/video/persistence/VideoRepository.java index a9e79e59..0e59ecc7 100644 --- a/src/main/java/team7/inplace/video/persistence/VideoRepository.java +++ b/src/main/java/team7/inplace/video/persistence/VideoRepository.java @@ -14,7 +14,7 @@ public interface VideoRepository extends JpaRepository { @Query("SELECT v FROM Video v JOIN FETCH v.place JOIN FETCH v.influencer ORDER BY v.viewCountIncrease DESC") List