diff --git a/src/main/java/team7/inplace/global/exception/code/VideoErrorCode.java b/src/main/java/team7/inplace/global/exception/code/VideoErrorCode.java new file mode 100644 index 00000000..483b97d0 --- /dev/null +++ b/src/main/java/team7/inplace/global/exception/code/VideoErrorCode.java @@ -0,0 +1,30 @@ +package team7.inplace.global.exception.code; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import org.springframework.http.HttpStatus; + +@AllArgsConstructor +@Getter +public enum VideoErrorCode implements ErrorCode{ + NO_SUCH_VIDEO(HttpStatus.NOT_FOUND, "V001", "Can't find such video info"); + + private final HttpStatus httpStatus; + private final String errorCode; + private final String message; + + @Override + public HttpStatus httpStatus() { + return httpStatus; + } + + @Override + public String code() { + return errorCode; + } + + @Override + public String message() { + return message; + } +} diff --git a/src/main/java/team7/inplace/video/application/VideoService.java b/src/main/java/team7/inplace/video/application/VideoService.java index 8fc1f7cc..0d78596d 100644 --- a/src/main/java/team7/inplace/video/application/VideoService.java +++ b/src/main/java/team7/inplace/video/application/VideoService.java @@ -2,12 +2,13 @@ import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; -import team7.inplace.influencer.domain.Influencer; -import team7.inplace.influencer.persistence.InfluencerRepository; -import team7.inplace.place.domain.Place; +import team7.inplace.global.exception.InplaceException; +import team7.inplace.global.exception.code.AuthorizationErrorCode; import team7.inplace.place.application.dto.PlaceForVideo; +import team7.inplace.place.domain.Place; import team7.inplace.place.persistence.PlaceRepository; import team7.inplace.video.application.dto.VideoInfo; import team7.inplace.video.domain.Video; @@ -22,64 +23,44 @@ public class VideoService { private final VideoRepository videoRepository; - private final InfluencerRepository influencerRepository; private final PlaceRepository placeRepository; - public List getByVideosInfluencer(List influencers) { - // 인플루언서 정보 처리 - List influencerIds = influencerRepository.findByNameIn(influencers).stream() - .map(Influencer::getId) - .toList(); - - // 인플루언서 정보로 필터링한 비디오 정보 불러오기 - List