From 75f5c98d030ef5c17acc9106501f87747a2a7f55 Mon Sep 17 00:00:00 2001 From: Hanbee Lee Date: Thu, 8 Feb 2024 17:54:05 +0900 Subject: [PATCH 1/5] =?UTF-8?q?refactor:=20=EC=95=88=EC=93=B0=EB=8A=94=20i?= =?UTF-8?q?mport=20optimize?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Popcorn/controller/PopcornController.java | 10 +----- .../dto/request/PostPopcornReviewRequest.java | 5 --- .../Popcorn/dto/response/PopcornResponse.java | 2 -- .../dto/response/PopcornReviewMyResponse.java | 3 -- .../dto/response/PopcornReviewResponse.java | 6 ---- .../service/GetPopcornDetailUseCase.java | 1 - .../service/GetPopcornReviewUseCase.java | 7 +--- .../Popcorn/service/GetPopcornUseCase.java | 1 - .../service/GetTopRatedPopcornKeyword.java | 7 ++-- .../PostPopcornReviewComplainUseCase.java | 12 +------ .../service/PostPopcornReviewUseCase.java | 20 +---------- .../auth/service/OauthRegisterUseCase.java | 1 - .../auth/service/helper/KakaoOauthHelper.java | 2 -- .../example/api/config/SecurityConfig.java | 11 +----- .../api/config/response/SuccessResponse.java | 1 - .../config/security/AccessDeniedFilter.java | 4 +-- .../config/security/JwtExceptionFilter.java | 1 - .../controller/DiverseMovieController.java | 3 -- .../dto/response/DiverseMovieResponse.java | 1 - .../service/GetTopRatedMovies.java | 35 ------------------- .../api/fcm/controller/FcmController.java | 7 ---- .../RecommendedPopcornController.java | 5 +-- .../response/RecommendedPopcornResponse.java | 7 ---- .../GetRecommendedPopocornUseCase.java | 1 - .../GetRecommendedRandomPopcornUseCase.java | 5 +-- .../service/PostRecommendPopcornUseCase.java | 11 ------ .../controller/ScreeningController.java | 10 ------ .../dto/request/PostReviewRequest.java | 1 - .../dto/request/PostScreeningRequest.java | 9 ----- .../dto/response/BookMarkResponse.java | 3 -- .../dto/response/ScreeningInfoResponse.java | 1 - .../dto/response/ScreeningResponse.java | 4 --- .../response/ScreeningReviewUserResponse.java | 4 --- .../response/ScreeningStatisticsResponse.java | 1 - .../dto/response/ScreeningUploadResponse.java | 7 ---- .../GetBookMarkedScreeningsUseCase.java | 1 - .../service/GetPastScreeningListUseCase.java | 1 - .../service/GetReviewListUseCase.java | 5 --- .../screening/service/GetReviewUseCase.java | 1 - .../GetScreeningReviewListUseCase.java | 5 --- .../GetScreeningStatisticsUseCase.java | 3 -- .../service/GetScreeningUseCase.java | 4 --- .../service/PatchScreeningUseCase.java | 4 --- .../service/ScreeningUploadUseCase.java | 3 -- .../user/model/dto/GetUserInfoResponse.java | 11 ------ .../api/user/service/GetUserInfoUseCase.java | 3 -- .../user/service/PatchUserInfoUseCase.java | 2 -- .../service/GetTopRatedMoviesTest.java | 16 --------- .../GetRecommendedPopocornUseCaseTest.java | 2 -- .../java/com/example/CoreApplication.java | 2 -- .../java/com/example/adaptor/Adaptor.java | 2 -- .../java/com/example/jwt/JwtProperties.java | 4 --- .../properties/KakaoOAuthProperties.java | 5 --- .../exception/BlockExceptionErrorCode.java | 2 -- .../exceptions/DuplicateBlockRequest.java | 2 -- .../domains/common/ScheduleService.java | 3 -- .../domains/common/util/SliceUtil.java | 1 - .../diverseMovie/DiverseMovieRepository.java | 3 -- .../adaptor/DiverseMovieAdaptor.java | 1 - .../popcorn/adaptor/PopcornAdaptor.java | 10 ------ .../entity/dto/PopcornKeywordResponseDto.java | 1 - .../popcorn/schedule/PopcornSchedule.java | 3 -- .../popcorn/service/PopcornService.java | 4 --- .../adaptor/PopcornUserAdaptor.java | 6 ---- .../exceptions/DuplicatePopcorn.java | 2 -- .../adaptor/RecommendedPopcornAdaptor.java | 4 --- .../exceptions/DuplicateMovieId.java | 2 -- .../service/RecommendedPopcornService.java | 1 - .../entity/RecommendedPopcornUser.java | 1 - .../screening/adaptor/ScreeningAdaptor.java | 2 -- .../domains/screening/entity/Screening.java | 1 - .../entity/dto/ScreeningCountDto.java | 1 - .../entity/dto/ScreeningResponseDto.java | 1 - .../domains/screening/enums/Category.java | 1 - .../domains/screening/enums/HostInfo.java | 3 -- .../screening/enums/NegativeCount.java | 1 - .../screening/enums/PositiveCount.java | 2 -- .../exception/exceptions/NotPassedDate.java | 2 -- .../repository/ScreeningRepository.java | 3 -- .../repository/ScreeningRepositoryCustom.java | 1 - .../repository/ScreeningRepositoryImpl.java | 1 - .../adaptor/ReviewAdaptor.java | 9 ----- .../entity/ScreeningReview.java | 3 -- .../entity/dto/ReviewResponseDto.java | 3 -- .../dto/ScreeningReviewResponseDto.java | 5 +-- .../dto/ScreeningReviewUserResponseDto.java | 1 - .../entity/dto/ScreeningWithReviewDto.java | 1 - .../repository/ScreeningReviewRepository.java | 1 - .../domains/user/adaptor/UserAdaptor.java | 3 -- .../user/entity/RefreshTokenEntity.java | 5 ++- .../example/domains/user/enums/OauthInfo.java | 5 ++- .../domains/user/service/UserService.java | 2 -- .../domains/user/validator/UserValidator.java | 1 - .../adaptor/UserScreeningAdaptor.java | 4 --- .../userscreening/entity/UserScreening.java | 2 -- .../exception/UserScreeningErrorCode.java | 1 - .../exceptions/UserScreeningNotFound.java | 2 -- .../repository/UserScreeningRepository.java | 2 -- .../schedule/DiverseMovieScheduleTest.java | 18 ---------- .../java/com/example/InfraApplication.java | 3 -- .../oauth/client/KakaoOauthClient.java | 1 - .../oauth/exception/KakaoKauthErrorCode.java | 2 +- .../redis/config/RedisCacheManagerConfig.java | 3 -- .../com/example/redis/config/RedisConfig.java | 6 ---- 104 files changed, 21 insertions(+), 410 deletions(-) delete mode 100644 Api/src/main/java/com/example/api/recommendedPopcorn/dto/response/RecommendedPopcornResponse.java delete mode 100644 Api/src/main/java/com/example/api/screening/dto/response/ScreeningUploadResponse.java diff --git a/Api/src/main/java/com/example/api/Popcorn/controller/PopcornController.java b/Api/src/main/java/com/example/api/Popcorn/controller/PopcornController.java index ae1ffe5..0ae0ce0 100644 --- a/Api/src/main/java/com/example/api/Popcorn/controller/PopcornController.java +++ b/Api/src/main/java/com/example/api/Popcorn/controller/PopcornController.java @@ -3,10 +3,6 @@ import com.example.api.Popcorn.dto.request.PostPopcornReviewRequest; import com.example.api.Popcorn.dto.response.*; import com.example.api.Popcorn.service.*; -import com.example.api.screening.dto.request.PostReviewRequest; -import com.example.api.screening.dto.response.ScreeningReviewUserResponse; -import com.example.domains.popcorn.entity.Popcorn; -import com.example.domains.popcorn.entity.dto.PopcornKeywordResponseDto; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import lombok.RequiredArgsConstructor; @@ -14,7 +10,7 @@ import org.springframework.web.bind.annotation.*; import java.util.List; -import java.util.Map; + @RestController @RequestMapping("/popcorn") @@ -77,7 +73,6 @@ public void reviewsFromPopcorn(@PathVariable("popcornUserId") Long popcornUserId postPopcornReviewComplainUseCase.execute(popcornUserId); } - //TODO 내가 쓴 팝콘작 리뷰 @Operation(summary = "팝콘작들에 대한 나의 리뷰 반환", description = "popcornId 가져와서 요청하기") @GetMapping("/my/reviews") @@ -85,13 +80,10 @@ public List reviewMyResponseList() { return getPopcornReviewUseCase.getMyReviews(); } - //TODO 8: 팝콘 키워드 Top3 GET @Operation(summary = "팝콘 키워드 Top3 반환", description = "popcornId 가져와서 요청하기") @GetMapping("/top-keywords/{popcornId}") public PopcornKeywordResponse reviewMyResponseList(@PathVariable("popcornId") Long popcornId){ return getTopRatedPopcornKeyword.execute(popcornId); } - - } diff --git a/Api/src/main/java/com/example/api/Popcorn/dto/request/PostPopcornReviewRequest.java b/Api/src/main/java/com/example/api/Popcorn/dto/request/PostPopcornReviewRequest.java index 414bd9b..5b69a9d 100644 --- a/Api/src/main/java/com/example/api/Popcorn/dto/request/PostPopcornReviewRequest.java +++ b/Api/src/main/java/com/example/api/Popcorn/dto/request/PostPopcornReviewRequest.java @@ -1,11 +1,7 @@ package com.example.api.Popcorn.dto.request; -import com.example.domains.popcorn.entity.Popcorn; import com.example.domains.popcornUser.entity.enums.PopcornNegative; import com.example.domains.popcornUser.entity.enums.PopcornPositive; -import com.example.domains.screeningReview.entity.enums.Negative; -import com.example.domains.screeningReview.entity.enums.Positive; -import com.example.domains.user.entity.User; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Builder; import lombok.Getter; @@ -31,7 +27,6 @@ public class PostPopcornReviewRequest { @Schema(description = "Negative attributes") private PopcornNegative popcornNegative; - @Builder public PostPopcornReviewRequest(boolean hasWatched, boolean beforeScreening, boolean afterScreening, String review, boolean hasAgreed, PopcornPositive popcornPositive, PopcornNegative popcornNegative) { this.hasWatched=hasWatched; diff --git a/Api/src/main/java/com/example/api/Popcorn/dto/response/PopcornResponse.java b/Api/src/main/java/com/example/api/Popcorn/dto/response/PopcornResponse.java index 88ccb74..272ce4c 100644 --- a/Api/src/main/java/com/example/api/Popcorn/dto/response/PopcornResponse.java +++ b/Api/src/main/java/com/example/api/Popcorn/dto/response/PopcornResponse.java @@ -1,7 +1,5 @@ package com.example.api.Popcorn.dto.response; -import com.example.api.diverseMovie.dto.response.DiverseMovieResponse; -import com.example.domains.diverseMovie.entity.dto.DiverseMovieResponseDto; import com.example.domains.popcorn.entity.Popcorn; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Builder; diff --git a/Api/src/main/java/com/example/api/Popcorn/dto/response/PopcornReviewMyResponse.java b/Api/src/main/java/com/example/api/Popcorn/dto/response/PopcornReviewMyResponse.java index 9867460..8b08cf8 100644 --- a/Api/src/main/java/com/example/api/Popcorn/dto/response/PopcornReviewMyResponse.java +++ b/Api/src/main/java/com/example/api/Popcorn/dto/response/PopcornReviewMyResponse.java @@ -26,16 +26,13 @@ public class PopcornReviewMyResponse { private boolean afterScreening; @Schema(defaultValue = "너무 좋았습니다", description = "텍스트 리뷰") private String review; - @Schema(defaultValue = "true", description = "정책 약관") private boolean hasAgreed; - @Schema(description = "Positive attributes") private PopcornPositive popcornPositive; @Schema(description = "Negative attributes") private PopcornNegative popcornNegative; - @Builder public PopcornReviewMyResponse(Long userId,String nickName,int profileImgNum,Popcorn popcorn,boolean hasWatched, boolean beforeScreening, boolean afterScreening, String review, boolean hasAgreed, PopcornPositive popcornPositive, PopcornNegative popcornNegative) { this.userId=userId; diff --git a/Api/src/main/java/com/example/api/Popcorn/dto/response/PopcornReviewResponse.java b/Api/src/main/java/com/example/api/Popcorn/dto/response/PopcornReviewResponse.java index d2ba40d..dccb783 100644 --- a/Api/src/main/java/com/example/api/Popcorn/dto/response/PopcornReviewResponse.java +++ b/Api/src/main/java/com/example/api/Popcorn/dto/response/PopcornReviewResponse.java @@ -1,12 +1,9 @@ package com.example.api.Popcorn.dto.response; import com.example.domains.popcornUser.entity.PopcornUser; -import com.example.domains.popcornUser.entity.enums.PopcornNegative; -import com.example.domains.popcornUser.entity.enums.PopcornPositive; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Builder; import lombok.Getter; -import org.springframework.cglib.core.Local; import java.time.LocalDateTime; @@ -30,10 +27,8 @@ public class PopcornReviewResponse { private boolean afterScreening; @Schema(defaultValue = "너무 좋았습니다", description = "텍스트 리뷰") private String review; - @Schema(defaultValue = "true", description = "정책 약관") private boolean hasAgreed; - @Schema(defaultValue = "2024-01-31", description = "리뷰 등록 일자") private LocalDateTime createdAt; @@ -51,7 +46,6 @@ public PopcornReviewResponse(Long popcornUserId,Long userId, String nickName, in this.hasAgreed =hasAgreed; this.createdAt = createdAt; } - public static PopcornReviewResponse from(PopcornUser popcornUser) { return PopcornReviewResponse.builder() .popcornUserId(popcornUser.getId()) diff --git a/Api/src/main/java/com/example/api/Popcorn/service/GetPopcornDetailUseCase.java b/Api/src/main/java/com/example/api/Popcorn/service/GetPopcornDetailUseCase.java index 88b3867..3ce305c 100644 --- a/Api/src/main/java/com/example/api/Popcorn/service/GetPopcornDetailUseCase.java +++ b/Api/src/main/java/com/example/api/Popcorn/service/GetPopcornDetailUseCase.java @@ -2,7 +2,6 @@ import com.example.adaptor.UseCase; import com.example.api.Popcorn.dto.response.PopcornDetailResponse; -import com.example.api.Popcorn.dto.response.PopcornResponse; import com.example.domains.popcorn.adaptor.PopcornAdaptor; import com.example.domains.popcorn.entity.Popcorn; import lombok.RequiredArgsConstructor; diff --git a/Api/src/main/java/com/example/api/Popcorn/service/GetPopcornReviewUseCase.java b/Api/src/main/java/com/example/api/Popcorn/service/GetPopcornReviewUseCase.java index e62a12e..b39553e 100644 --- a/Api/src/main/java/com/example/api/Popcorn/service/GetPopcornReviewUseCase.java +++ b/Api/src/main/java/com/example/api/Popcorn/service/GetPopcornReviewUseCase.java @@ -5,7 +5,6 @@ import com.example.api.Popcorn.dto.response.PopcornReviewResponse; import com.example.api.config.security.SecurityUtil; import com.example.domains.popcorn.adaptor.PopcornAdaptor; -import com.example.domains.popcorn.entity.Popcorn; import com.example.domains.popcornUser.adaptor.PopcornUserAdaptor; import com.example.domains.popcornUser.entity.PopcornUser; import lombok.RequiredArgsConstructor; @@ -45,14 +44,10 @@ public int getRate(Long popcornId) { int length = popcornUsers.size(); if (length == 0) { - // Handle the case where there are no users to avoid division by zero - return 0; // Or you can choose a default value or throw an exception + return 0; } - int totalNumber = popcornAdaptor.findById(popcornId).getPopcornRate(); - // Perform rounding and return the result return Math.round((float) totalNumber / length); - } } diff --git a/Api/src/main/java/com/example/api/Popcorn/service/GetPopcornUseCase.java b/Api/src/main/java/com/example/api/Popcorn/service/GetPopcornUseCase.java index 6dcc249..eb79514 100644 --- a/Api/src/main/java/com/example/api/Popcorn/service/GetPopcornUseCase.java +++ b/Api/src/main/java/com/example/api/Popcorn/service/GetPopcornUseCase.java @@ -5,7 +5,6 @@ import com.example.domains.popcorn.adaptor.PopcornAdaptor; import com.example.domains.popcorn.entity.Popcorn; import lombok.RequiredArgsConstructor; -import org.springframework.security.core.parameters.P; import java.util.ArrayList; import java.util.List; diff --git a/Api/src/main/java/com/example/api/Popcorn/service/GetTopRatedPopcornKeyword.java b/Api/src/main/java/com/example/api/Popcorn/service/GetTopRatedPopcornKeyword.java index 6130150..15c56b3 100644 --- a/Api/src/main/java/com/example/api/Popcorn/service/GetTopRatedPopcornKeyword.java +++ b/Api/src/main/java/com/example/api/Popcorn/service/GetTopRatedPopcornKeyword.java @@ -5,10 +5,12 @@ import com.example.domains.popcorn.adaptor.PopcornAdaptor; import com.example.domains.popcorn.entity.dto.PopcornKeywordResponseDto; import com.example.domains.popcornUser.adaptor.PopcornUserAdaptor; -import com.example.domains.popcornUser.entity.PopcornUser; import lombok.RequiredArgsConstructor; -import java.util.*; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.stream.Collectors; @UseCase @@ -35,6 +37,7 @@ public PopcornKeywordResponse execute(Long popcornId) { return PopcornKeywordResponse.from(sortedList,participationCount,participatedUserCount); } + //TODO 더 좋은 방법 없을까? private Map addingToList(PopcornKeywordResponseDto keywordList) { Map valueMap = new HashMap<>(); valueMap.put("cineMaster", keywordList.getCineMaster()); diff --git a/Api/src/main/java/com/example/api/Popcorn/service/PostPopcornReviewComplainUseCase.java b/Api/src/main/java/com/example/api/Popcorn/service/PostPopcornReviewComplainUseCase.java index dd4b91b..6321ccd 100644 --- a/Api/src/main/java/com/example/api/Popcorn/service/PostPopcornReviewComplainUseCase.java +++ b/Api/src/main/java/com/example/api/Popcorn/service/PostPopcornReviewComplainUseCase.java @@ -2,26 +2,16 @@ import com.example.adaptor.UseCase; import com.example.api.config.security.SecurityUtil; -import com.example.domains.block.adaptor.BlockAdaptor; import com.example.domains.popcornUser.adaptor.PopcornUserAdaptor; -import com.example.domains.popcornUser.entity.PopcornUser; -import com.example.domains.popcornUser.repository.PopcornUserRepository; -import com.example.domains.screeningReview.entity.QScreeningReview; -import com.example.domains.screeningReview.entity.ScreeningReview; -import com.example.domains.user.entity.User; import lombok.RequiredArgsConstructor; -import org.springframework.transaction.annotation.Transactional; + @UseCase @RequiredArgsConstructor public class PostPopcornReviewComplainUseCase { - private final BlockAdaptor blockAdaptor; private final PopcornUserAdaptor popcornUserAdaptor; - private final PopcornUserRepository popcornUserRepository; public void execute(Long reviewId) { Long userId = SecurityUtil.getCurrentUserId(); popcornUserAdaptor.postComplain(reviewId,userId); } - - } diff --git a/Api/src/main/java/com/example/api/Popcorn/service/PostPopcornReviewUseCase.java b/Api/src/main/java/com/example/api/Popcorn/service/PostPopcornReviewUseCase.java index 1f1457e..f6a9acf 100644 --- a/Api/src/main/java/com/example/api/Popcorn/service/PostPopcornReviewUseCase.java +++ b/Api/src/main/java/com/example/api/Popcorn/service/PostPopcornReviewUseCase.java @@ -4,8 +4,6 @@ import com.example.api.Popcorn.dto.request.PostPopcornReviewRequest; import com.example.api.Popcorn.dto.response.PopcornReviewResponse; import com.example.api.config.security.SecurityUtil; -import com.example.api.screening.dto.request.PostReviewRequest; -import com.example.api.screening.dto.response.PostReviewResponse; import com.example.domains.popcorn.adaptor.PopcornAdaptor; import com.example.domains.popcorn.entity.Popcorn; import com.example.domains.popcornUser.adaptor.PopcornUserAdaptor; @@ -13,19 +11,8 @@ import com.example.domains.popcornUser.entity.enums.PopcornNegative; import com.example.domains.popcornUser.entity.enums.PopcornPositive; import com.example.domains.popcornUser.exceptions.NoPopcornReview; -import com.example.domains.screening.adaptor.ScreeningAdaptor; -import com.example.domains.screening.entity.Screening; -import com.example.domains.screening.validator.ScreeningValidator; -import com.example.domains.screeningReview.adaptor.ReviewAdaptor; -import com.example.domains.screeningReview.entity.ScreeningReview; -import com.example.domains.screeningReview.entity.enums.Negative; -import com.example.domains.screeningReview.entity.enums.Positive; -import com.example.domains.screeningReview.validator.ReviewValidator; import com.example.domains.user.adaptor.UserAdaptor; import com.example.domains.user.entity.User; -import com.example.domains.user.validator.UserValidator; -import com.example.domains.userscreening.adaptor.UserScreeningAdaptor; -import com.example.domains.userscreening.entity.UserScreening; import lombok.RequiredArgsConstructor; import org.springframework.transaction.annotation.Transactional; @@ -34,7 +21,6 @@ public class PostPopcornReviewUseCase { private final UserAdaptor userAdaptor; - private final ScreeningAdaptor screeningAdaptor; private final PopcornUserAdaptor popcornUserAdaptor; private final PopcornAdaptor popcornAdaptor; @@ -76,8 +62,6 @@ private PopcornReviewResponse reviewUpload(Popcorn popcorn, User user, PostPopco incrementNegative(request.getPopcornNegative(),popcorn); incrementPositive(request.getPopcornPositive(),popcorn); - - //save popcornUserAdaptor.save(newPopcornUser); //screeningAdaptor.save(screening); @@ -95,8 +79,7 @@ public void calculateRate(boolean afterScreening,boolean beforeScreening,Popcorn popcornUserAdaptor.incrementPopcornRate(popcorn,0); } } - - + //TODO 더 좋은 방법이 없을까? @Transactional public void incrementPositive(PopcornPositive positive, Popcorn popcorn) { if (positive != null) { @@ -200,7 +183,6 @@ public void incrementNegative(PopcornNegative negative, Popcorn popcorn) { if ( negative.isBadCasting()) { popcornAdaptor.incrementNegativeBadCasting(popcorn); } - // Add similar checks for other negative attributes } } diff --git a/Api/src/main/java/com/example/api/auth/service/OauthRegisterUseCase.java b/Api/src/main/java/com/example/api/auth/service/OauthRegisterUseCase.java index 4d6d96c..71384a6 100644 --- a/Api/src/main/java/com/example/api/auth/service/OauthRegisterUseCase.java +++ b/Api/src/main/java/com/example/api/auth/service/OauthRegisterUseCase.java @@ -11,7 +11,6 @@ import com.example.domains.user.enums.OauthProvider; import com.example.domains.user.service.UserService; import lombok.RequiredArgsConstructor; -import org.springframework.context.annotation.Profile; import org.springframework.transaction.annotation.Transactional; import java.util.Random; diff --git a/Api/src/main/java/com/example/api/auth/service/helper/KakaoOauthHelper.java b/Api/src/main/java/com/example/api/auth/service/helper/KakaoOauthHelper.java index 9161869..225d689 100644 --- a/Api/src/main/java/com/example/api/auth/service/helper/KakaoOauthHelper.java +++ b/Api/src/main/java/com/example/api/auth/service/helper/KakaoOauthHelper.java @@ -13,9 +13,7 @@ import com.example.oauth.dto.OIDCPublicKeysResponse; import com.example.properties.KakaoOAuthProperties; import lombok.RequiredArgsConstructor; - import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Value; import static com.example.consts.PopCornMateConsts.BEARER; diff --git a/Api/src/main/java/com/example/api/config/SecurityConfig.java b/Api/src/main/java/com/example/api/config/SecurityConfig.java index a2953f1..fc35903 100644 --- a/Api/src/main/java/com/example/api/config/SecurityConfig.java +++ b/Api/src/main/java/com/example/api/config/SecurityConfig.java @@ -1,22 +1,16 @@ package com.example.api.config; -import com.example.api.config.security.AccessDeniedFilter; import com.example.api.config.security.FilterConfig; -import com.example.api.config.security.JwtExceptionFilter; -import com.example.api.config.security.JwtTokenFilter; import lombok.RequiredArgsConstructor; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.http.HttpMethod; import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.web.SecurityFilterChain; import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; -import org.springframework.security.web.access.intercept.FilterSecurityInterceptor; -import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; -import org.springframework.security.web.authentication.www.BasicAuthenticationFilter; + @Configuration @RequiredArgsConstructor @@ -28,9 +22,6 @@ public class SecurityConfig { private final FilterConfig filterConfig; - private final JwtTokenFilter jwtTokenFilter; - private final JwtExceptionFilter jwtExceptionFilter; - private final AccessDeniedFilter accessDeniedFilter; @Bean diff --git a/Api/src/main/java/com/example/api/config/response/SuccessResponse.java b/Api/src/main/java/com/example/api/config/response/SuccessResponse.java index bccf53f..5ed937a 100644 --- a/Api/src/main/java/com/example/api/config/response/SuccessResponse.java +++ b/Api/src/main/java/com/example/api/config/response/SuccessResponse.java @@ -5,7 +5,6 @@ import lombok.Builder; import lombok.Getter; -import java.time.LocalDateTime; @Getter public class SuccessResponse { diff --git a/Api/src/main/java/com/example/api/config/security/AccessDeniedFilter.java b/Api/src/main/java/com/example/api/config/security/AccessDeniedFilter.java index 6354e73..113c9a0 100644 --- a/Api/src/main/java/com/example/api/config/security/AccessDeniedFilter.java +++ b/Api/src/main/java/com/example/api/config/security/AccessDeniedFilter.java @@ -1,9 +1,8 @@ package com.example.api.config.security; -import com.example.error.GlobalErrorCode; -import com.fasterxml.jackson.databind.ObjectMapper; import com.example.error.BaseErrorException; import com.example.error.ErrorResponse; +import com.example.error.GlobalErrorCode; import com.fasterxml.jackson.databind.ObjectMapper; import jakarta.servlet.FilterChain; import jakarta.servlet.ServletException; @@ -13,7 +12,6 @@ import org.springframework.http.MediaType; import org.springframework.security.access.AccessDeniedException; import org.springframework.stereotype.Component; -import org.springframework.util.PatternMatchUtils; import org.springframework.web.filter.OncePerRequestFilter; import java.io.IOException; diff --git a/Api/src/main/java/com/example/api/config/security/JwtExceptionFilter.java b/Api/src/main/java/com/example/api/config/security/JwtExceptionFilter.java index bc9ef88..d8522ab 100644 --- a/Api/src/main/java/com/example/api/config/security/JwtExceptionFilter.java +++ b/Api/src/main/java/com/example/api/config/security/JwtExceptionFilter.java @@ -10,7 +10,6 @@ import lombok.RequiredArgsConstructor; import org.springframework.http.MediaType; import org.springframework.stereotype.Component; - import org.springframework.web.filter.OncePerRequestFilter; import java.io.IOException; diff --git a/Api/src/main/java/com/example/api/diverseMovie/controller/DiverseMovieController.java b/Api/src/main/java/com/example/api/diverseMovie/controller/DiverseMovieController.java index 2f50fe3..da4e60f 100644 --- a/Api/src/main/java/com/example/api/diverseMovie/controller/DiverseMovieController.java +++ b/Api/src/main/java/com/example/api/diverseMovie/controller/DiverseMovieController.java @@ -22,9 +22,6 @@ public void savePopcorn(){ getTopRatedMovies.getTopRated(); } - - //TODO 1. 독립영화 Top5 매 주 월요일 저장 - 스케쥴링 - 완료 - @GetMapping("/toprated") public List getDiverseMovies() { return getTopRatedMovies.getTopratedList(); diff --git a/Api/src/main/java/com/example/api/diverseMovie/dto/response/DiverseMovieResponse.java b/Api/src/main/java/com/example/api/diverseMovie/dto/response/DiverseMovieResponse.java index 86d11c6..3fbdb0d 100644 --- a/Api/src/main/java/com/example/api/diverseMovie/dto/response/DiverseMovieResponse.java +++ b/Api/src/main/java/com/example/api/diverseMovie/dto/response/DiverseMovieResponse.java @@ -1,6 +1,5 @@ package com.example.api.diverseMovie.dto.response; -import com.example.api.screening.dto.response.BookMarkResponse; import com.example.domains.diverseMovie.entity.dto.DiverseMovieResponseDto; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Builder; diff --git a/Api/src/main/java/com/example/api/diverseMovie/service/GetTopRatedMovies.java b/Api/src/main/java/com/example/api/diverseMovie/service/GetTopRatedMovies.java index 4b57fdc..48def24 100644 --- a/Api/src/main/java/com/example/api/diverseMovie/service/GetTopRatedMovies.java +++ b/Api/src/main/java/com/example/api/diverseMovie/service/GetTopRatedMovies.java @@ -78,18 +78,6 @@ private void saveMovie(String responseData) throws JsonProcessingException { } -// public void getImages(String responseData) { -// // JSON 데이터를 BoxOfficeResult 객체로 매핑 -// BoxOfficeResult boxOfficeResult = parseJson(responseData); -// -// // "movieNm" 속성을 가져와서 리스트로 만들기 -// List movieNames = extractMovieNames(boxOfficeResult); -// -// // 결과 출력 -// System.out.println("Movie Names: " + movieNames); -// getImageUrl(movieNames); -// } - private static String getCurrentDate() { // 현재 날짜를 문자열로 변환 SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); @@ -117,27 +105,4 @@ public List getTopratedList() { } return responseList; } - -// private static BoxOfficeResult parseJson(String jsonString) { -// try { -// ObjectMapper objectMapper = new ObjectMapper(); -// return objectMapper.readValue(jsonString, BoxOfficeResult.class); -// } catch (Exception e) { -// e.printStackTrace(); -// return null; -// } -// } -// -// private static List extractMovieNames(BoxOfficeResult boxOfficeResult) { -// List movieNames = new ArrayList<>(); -// if (boxOfficeResult != null && boxOfficeResult.getBoxOfficeResult() != null -// && boxOfficeResult.getBoxOfficeResult().getDailyBoxOfficeList() != null) { -// for (DailyBoxOffice dailyBoxOffice : boxOfficeResult.getBoxOfficeResult().getDailyBoxOfficeList()) { -// if (dailyBoxOffice != null && dailyBoxOffice.getMovieNm() != null) { -// movieNames.add(dailyBoxOffice.getMovieNm()); -// } -// } -// } -// return movieNames; -// } } diff --git a/Api/src/main/java/com/example/api/fcm/controller/FcmController.java b/Api/src/main/java/com/example/api/fcm/controller/FcmController.java index 53da94a..5dac2b5 100644 --- a/Api/src/main/java/com/example/api/fcm/controller/FcmController.java +++ b/Api/src/main/java/com/example/api/fcm/controller/FcmController.java @@ -1,11 +1,9 @@ package com.example.api.fcm.controller; -import com.example.api.config.security.SecurityUtil; import com.example.fcm.request.FcmRegistrationRequest; import com.example.fcm.service.FcmService; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.FirebaseAuthException; -import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.http.ResponseEntity; @@ -18,14 +16,12 @@ @RequestMapping("/fcm") @RequiredArgsConstructor public class FcmController { - private final FcmService fcmService; @PostMapping("/{userId}") public ResponseEntity fcmTokenRegistration( @PathVariable("userId") Long userId, @RequestBody FcmRegistrationRequest request) { -// Long userId = SecurityUtil.getCurrentUserId(); fcmService.registerFCMToken(userId, request); return ResponseEntity .status(CREATED.code()) @@ -35,9 +31,6 @@ public ResponseEntity fcmTokenRegistration( @GetMapping public void fcmToken() throws FirebaseAuthException { String uid = "some-uid"; - String customToken = FirebaseAuth.getInstance().createCustomToken(uid); - System.out.println(customToken); } - } diff --git a/Api/src/main/java/com/example/api/recommendedPopcorn/controller/RecommendedPopcornController.java b/Api/src/main/java/com/example/api/recommendedPopcorn/controller/RecommendedPopcornController.java index 10cbe26..ca22244 100644 --- a/Api/src/main/java/com/example/api/recommendedPopcorn/controller/RecommendedPopcornController.java +++ b/Api/src/main/java/com/example/api/recommendedPopcorn/controller/RecommendedPopcornController.java @@ -1,16 +1,13 @@ package com.example.api.recommendedPopcorn.controller; import com.example.api.recommendedPopcorn.dto.request.RecommendedPopcornRequest; -import com.example.api.recommendedPopcorn.dto.response.RecommendedPopcornResponse; import com.example.api.recommendedPopcorn.service.GetRecommendedPopocornUseCase; import com.example.api.recommendedPopcorn.service.GetRecommendedRandomPopcornUseCase; import com.example.api.recommendedPopcorn.service.PostRecommendPopcornUseCase; import com.example.api.recommendedPopcorn.service.PostVoteRecommendedPopcorn; import com.example.domains.recommendedPopcorn.entity.RecommendedPopcorn; -import com.example.domains.recommendedPopcornUser.entity.RecommendedPopcornUser; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.*; @@ -47,11 +44,11 @@ public List getRandomThree() { public List getRecommendPopcornList() { return getRecommendedPopocornUseCase.execute(); } + //TODO 4. 예비 팝콘작 투표하기 @Operation(summary = " 예비 팝콘작 투표하기", description = "예비 팝콘작 투표하기") @PostMapping("/vote") public void voteByIdRecommendPopcorn(@RequestParam("recommendedPopcorn") Long recommendedPopcorn) { postVoteRecommendedPopcorn.execute(recommendedPopcorn); } - } diff --git a/Api/src/main/java/com/example/api/recommendedPopcorn/dto/response/RecommendedPopcornResponse.java b/Api/src/main/java/com/example/api/recommendedPopcorn/dto/response/RecommendedPopcornResponse.java deleted file mode 100644 index 1b20750..0000000 --- a/Api/src/main/java/com/example/api/recommendedPopcorn/dto/response/RecommendedPopcornResponse.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.example.api.recommendedPopcorn.dto.response; - -import lombok.Getter; - -@Getter -public class RecommendedPopcornResponse { -} diff --git a/Api/src/main/java/com/example/api/recommendedPopcorn/service/GetRecommendedPopocornUseCase.java b/Api/src/main/java/com/example/api/recommendedPopcorn/service/GetRecommendedPopocornUseCase.java index 046a2ba..a9beb16 100644 --- a/Api/src/main/java/com/example/api/recommendedPopcorn/service/GetRecommendedPopocornUseCase.java +++ b/Api/src/main/java/com/example/api/recommendedPopcorn/service/GetRecommendedPopocornUseCase.java @@ -1,7 +1,6 @@ package com.example.api.recommendedPopcorn.service; import com.example.adaptor.UseCase; -import com.example.api.recommendedPopcorn.dto.response.RecommendedPopcornResponse; import com.example.domains.recommendedPopcorn.adaptor.RecommendedPopcornAdaptor; import com.example.domains.recommendedPopcorn.entity.RecommendedPopcorn; import lombok.RequiredArgsConstructor; diff --git a/Api/src/main/java/com/example/api/recommendedPopcorn/service/GetRecommendedRandomPopcornUseCase.java b/Api/src/main/java/com/example/api/recommendedPopcorn/service/GetRecommendedRandomPopcornUseCase.java index 7ad6acf..426a328 100644 --- a/Api/src/main/java/com/example/api/recommendedPopcorn/service/GetRecommendedRandomPopcornUseCase.java +++ b/Api/src/main/java/com/example/api/recommendedPopcorn/service/GetRecommendedRandomPopcornUseCase.java @@ -5,16 +5,13 @@ import com.example.domains.recommendedPopcorn.entity.RecommendedPopcorn; import lombok.RequiredArgsConstructor; -import java.util.ArrayList; import java.util.List; -import java.util.Random; + @UseCase @RequiredArgsConstructor public class GetRecommendedRandomPopcornUseCase { private final RecommendedPopcornAdaptor recommendedPopcornAdaptor; - - public List execute() { List recommendedPopcornList = recommendedPopcornAdaptor.findByThreeIds(); return recommendedPopcornList; diff --git a/Api/src/main/java/com/example/api/recommendedPopcorn/service/PostRecommendPopcornUseCase.java b/Api/src/main/java/com/example/api/recommendedPopcorn/service/PostRecommendPopcornUseCase.java index 7ab6cb0..2640da4 100644 --- a/Api/src/main/java/com/example/api/recommendedPopcorn/service/PostRecommendPopcornUseCase.java +++ b/Api/src/main/java/com/example/api/recommendedPopcorn/service/PostRecommendPopcornUseCase.java @@ -3,32 +3,21 @@ import com.example.adaptor.UseCase; import com.example.api.config.security.SecurityUtil; import com.example.api.recommendedPopcorn.dto.request.RecommendedPopcornRequest; -import com.example.api.recommendedPopcorn.dto.response.RecommendedPopcornResponse; import com.example.domains.recommendedPopcorn.adaptor.RecommendedPopcornAdaptor; import com.example.domains.recommendedPopcorn.entity.RecommendedPopcorn; import com.example.domains.recommendedPopcornUser.adaptor.RecommendedPopcornUserAdaptor; import com.example.domains.recommendedPopcornUser.entity.RecommendedPopcornUser; import com.example.domains.user.adaptor.UserAdaptor; import com.example.domains.user.entity.User; -import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.gson.JsonElement; -import com.google.gson.JsonObject; import com.google.gson.JsonParser; -import io.swagger.v3.core.util.Json; -import lombok.AllArgsConstructor; -import lombok.NoArgsConstructor; import lombok.RequiredArgsConstructor; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.Response; -import okhttp3.ResponseBody; -import org.apache.tomcat.util.json.JSONParser; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.configurationprocessor.json.JSONObject; -import org.springframework.core.env.Environment; import java.io.IOException; diff --git a/Api/src/main/java/com/example/api/screening/controller/ScreeningController.java b/Api/src/main/java/com/example/api/screening/controller/ScreeningController.java index bc07ceb..7471f9c 100644 --- a/Api/src/main/java/com/example/api/screening/controller/ScreeningController.java +++ b/Api/src/main/java/com/example/api/screening/controller/ScreeningController.java @@ -12,12 +12,7 @@ import com.example.domains.screening.entity.Screening; import com.example.domains.screening.entity.dto.ScreeningResponseDto; import com.example.domains.screening.enums.Category; -import com.example.domains.screening.service.ScreeningService; import com.example.domains.screeningReview.adaptor.ReviewAdaptor; -import com.example.domains.screeningReview.entity.ScreeningReview; -import com.example.domains.screeningReview.entity.dto.ReviewResponseDto; -import com.example.domains.screeningReview.entity.dto.ScreeningReviewResponseDto; -import com.example.domains.screeningReview.entity.dto.ScreeningReviewUserResponseDto; import com.example.domains.screeningReview.entity.dto.ScreeningWithReviewDto; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.security.SecurityRequirement; @@ -25,17 +20,13 @@ import lombok.extern.slf4j.Slf4j; import org.springdoc.core.annotations.ParameterObject; import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Slice; import org.springframework.data.web.PageableDefault; -import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; import java.io.IOException; import java.util.Collections; import java.util.List; -import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE; @RestController @RequestMapping("/screening") @@ -60,7 +51,6 @@ public class ScreeningController { private final GetPastScreeningListUseCase getPastScreeningListUseCase; private final GetScreeningStatisticsUseCase getScreeningStatisticsUseCase; - // @Operation(description = "모임 대표 이미지") // @PostMapping(value = "/image", consumes = {MediaType.MULTIPART_FORM_DATA_VALUE, APPLICATION_JSON_VALUE}) // public SuccessResponse uploadImage(@RequestParam("file") MultipartFile file) throws IOException { diff --git a/Api/src/main/java/com/example/api/screening/dto/request/PostReviewRequest.java b/Api/src/main/java/com/example/api/screening/dto/request/PostReviewRequest.java index f6b483a..c176976 100644 --- a/Api/src/main/java/com/example/api/screening/dto/request/PostReviewRequest.java +++ b/Api/src/main/java/com/example/api/screening/dto/request/PostReviewRequest.java @@ -1,6 +1,5 @@ package com.example.api.screening.dto.request; -import com.example.domains.screening.enums.Category; import com.example.domains.screeningReview.entity.enums.Negative; import com.example.domains.screeningReview.entity.enums.Positive; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/Api/src/main/java/com/example/api/screening/dto/request/PostScreeningRequest.java b/Api/src/main/java/com/example/api/screening/dto/request/PostScreeningRequest.java index 0f1399c..85942f5 100644 --- a/Api/src/main/java/com/example/api/screening/dto/request/PostScreeningRequest.java +++ b/Api/src/main/java/com/example/api/screening/dto/request/PostScreeningRequest.java @@ -1,11 +1,6 @@ package com.example.api.screening.dto.request; -import com.example.api.user.model.dto.GetUserInfoResponse; -import com.example.domains.screening.entity.Screening; import com.example.domains.screening.enums.Category; -import com.example.domains.screening.enums.HostInfo; -import com.example.domains.user.entity.User; -import com.example.domains.user.enums.OauthProvider; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Builder; import lombok.Getter; @@ -73,8 +68,4 @@ public PostScreeningRequest( this.hostEmail = hostEmail; this.hostPhoneNumber = hostPhoneNumber; } - -// public static PostScreeningRequest from(Screening screening) { -// return -// } } diff --git a/Api/src/main/java/com/example/api/screening/dto/response/BookMarkResponse.java b/Api/src/main/java/com/example/api/screening/dto/response/BookMarkResponse.java index a641737..160b7db 100644 --- a/Api/src/main/java/com/example/api/screening/dto/response/BookMarkResponse.java +++ b/Api/src/main/java/com/example/api/screening/dto/response/BookMarkResponse.java @@ -1,8 +1,5 @@ package com.example.api.screening.dto.response; - -import com.example.api.user.model.dto.GetUserInfoResponse; -import com.example.domains.user.entity.User; import com.example.domains.userscreening.entity.UserScreening; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Builder; diff --git a/Api/src/main/java/com/example/api/screening/dto/response/ScreeningInfoResponse.java b/Api/src/main/java/com/example/api/screening/dto/response/ScreeningInfoResponse.java index 18525a4..81949d3 100644 --- a/Api/src/main/java/com/example/api/screening/dto/response/ScreeningInfoResponse.java +++ b/Api/src/main/java/com/example/api/screening/dto/response/ScreeningInfoResponse.java @@ -107,5 +107,4 @@ public static ScreeningInfoResponse from(Screening screening,boolean isBookmarke .isReviewed(isReviewed) .build(); } - } diff --git a/Api/src/main/java/com/example/api/screening/dto/response/ScreeningResponse.java b/Api/src/main/java/com/example/api/screening/dto/response/ScreeningResponse.java index cdf6e62..ae21d4e 100644 --- a/Api/src/main/java/com/example/api/screening/dto/response/ScreeningResponse.java +++ b/Api/src/main/java/com/example/api/screening/dto/response/ScreeningResponse.java @@ -1,9 +1,7 @@ package com.example.api.screening.dto.response; - import com.example.domains.screening.entity.Screening; import com.example.domains.screening.enums.Category; -import com.example.domains.screeningReview.entity.ScreeningReview; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Builder; import lombok.Getter; @@ -56,7 +54,6 @@ public class ScreeningResponse { @Schema(defaultValue = "false", description = "정책 동의 여부") private boolean isPrivate; - @Builder public ScreeningResponse(Long screeningId, String screeningTitle, String posterImgUrl, String hostName, String hostEmail, String hostPhoneNumber , String location, String formUrl, @@ -99,5 +96,4 @@ public static ScreeningResponse from(Screening screening) { .isPrivate(screening.isPrivate()) .build(); } - } diff --git a/Api/src/main/java/com/example/api/screening/dto/response/ScreeningReviewUserResponse.java b/Api/src/main/java/com/example/api/screening/dto/response/ScreeningReviewUserResponse.java index 15db34b..00d5adc 100644 --- a/Api/src/main/java/com/example/api/screening/dto/response/ScreeningReviewUserResponse.java +++ b/Api/src/main/java/com/example/api/screening/dto/response/ScreeningReviewUserResponse.java @@ -1,10 +1,6 @@ package com.example.api.screening.dto.response; import com.example.domains.screeningReview.entity.dto.ScreeningReviewResponseDto; -import com.example.domains.user.entity.User; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.PropertyNamingStrategies; -import com.fasterxml.jackson.databind.annotation.JsonNaming; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Builder; import lombok.Getter; diff --git a/Api/src/main/java/com/example/api/screening/dto/response/ScreeningStatisticsResponse.java b/Api/src/main/java/com/example/api/screening/dto/response/ScreeningStatisticsResponse.java index 94d73b8..43e9276 100644 --- a/Api/src/main/java/com/example/api/screening/dto/response/ScreeningStatisticsResponse.java +++ b/Api/src/main/java/com/example/api/screening/dto/response/ScreeningStatisticsResponse.java @@ -3,7 +3,6 @@ import com.example.domains.screening.entity.Screening; import com.example.domains.screening.enums.NegativeCount; import com.example.domains.screening.enums.PositiveCount; -import com.example.domains.screeningReview.entity.enums.Negative; import lombok.Builder; import lombok.Getter; diff --git a/Api/src/main/java/com/example/api/screening/dto/response/ScreeningUploadResponse.java b/Api/src/main/java/com/example/api/screening/dto/response/ScreeningUploadResponse.java deleted file mode 100644 index cea48ad..0000000 --- a/Api/src/main/java/com/example/api/screening/dto/response/ScreeningUploadResponse.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.example.api.screening.dto.response; - -import lombok.Getter; - -@Getter -public class ScreeningUploadResponse { -} diff --git a/Api/src/main/java/com/example/api/screening/service/GetBookMarkedScreeningsUseCase.java b/Api/src/main/java/com/example/api/screening/service/GetBookMarkedScreeningsUseCase.java index a7f62fe..1135307 100644 --- a/Api/src/main/java/com/example/api/screening/service/GetBookMarkedScreeningsUseCase.java +++ b/Api/src/main/java/com/example/api/screening/service/GetBookMarkedScreeningsUseCase.java @@ -5,7 +5,6 @@ import com.example.api.screening.dto.response.ScreeningResponse; import com.example.domains.screening.entity.Screening; import com.example.domains.userscreening.adaptor.UserScreeningAdaptor; -import com.example.domains.userscreening.entity.UserScreening; import lombok.RequiredArgsConstructor; import java.util.ArrayList; diff --git a/Api/src/main/java/com/example/api/screening/service/GetPastScreeningListUseCase.java b/Api/src/main/java/com/example/api/screening/service/GetPastScreeningListUseCase.java index be5001d..8ba906c 100644 --- a/Api/src/main/java/com/example/api/screening/service/GetPastScreeningListUseCase.java +++ b/Api/src/main/java/com/example/api/screening/service/GetPastScreeningListUseCase.java @@ -5,7 +5,6 @@ import com.example.api.screening.dto.response.ScreeningResponse; import com.example.domains.screening.adaptor.ScreeningAdaptor; import com.example.domains.screening.entity.Screening; -import com.example.domains.userscreening.adaptor.UserScreeningAdaptor; import lombok.RequiredArgsConstructor; import java.util.ArrayList; diff --git a/Api/src/main/java/com/example/api/screening/service/GetReviewListUseCase.java b/Api/src/main/java/com/example/api/screening/service/GetReviewListUseCase.java index 3b111dc..8976754 100644 --- a/Api/src/main/java/com/example/api/screening/service/GetReviewListUseCase.java +++ b/Api/src/main/java/com/example/api/screening/service/GetReviewListUseCase.java @@ -3,7 +3,6 @@ import com.example.adaptor.UseCase; import com.example.api.screening.dto.response.ScreeningReviewUserResponse; import com.example.domains.screeningReview.entity.dto.ScreeningReviewResponseDto; -import com.example.domains.user.adaptor.UserAdaptor; import com.example.domains.user.validator.UserValidator; import com.example.domains.userscreening.adaptor.UserScreeningAdaptor; import lombok.RequiredArgsConstructor; @@ -16,14 +15,12 @@ public class GetReviewListUseCase { private final UserValidator userValidator; private final UserScreeningAdaptor userScreeningAdaptor; - private final UserAdaptor userAdaptor; public List execute(Long screeningId) { List reviewResponseDtoList = userScreeningAdaptor.getReviewListByScreening(screeningId); List result = proceed(reviewResponseDtoList); - return result; } @@ -31,10 +28,8 @@ private List proceed(List screeningReviewResponseDtoList = new ArrayList<>(); for (ScreeningReviewResponseDto reviewResponseDto : reviewResponseDtoList) { - //System.out.println(reviewResponseDto.getReview()); screeningReviewResponseDtoList.add(ScreeningReviewUserResponse.from(reviewResponseDto)); } - //System.out.println(screeningReviewResponseDtoList.get(0).isAfterScreening()); return screeningReviewResponseDtoList; } diff --git a/Api/src/main/java/com/example/api/screening/service/GetReviewUseCase.java b/Api/src/main/java/com/example/api/screening/service/GetReviewUseCase.java index 5c5b4d0..e8a97ae 100644 --- a/Api/src/main/java/com/example/api/screening/service/GetReviewUseCase.java +++ b/Api/src/main/java/com/example/api/screening/service/GetReviewUseCase.java @@ -3,7 +3,6 @@ import com.example.adaptor.UseCase; import com.example.api.config.security.SecurityUtil; import com.example.api.screening.dto.response.PostReviewResponse; -import com.example.domains.screening.entity.Screening; import com.example.domains.screeningReview.adaptor.ReviewAdaptor; import com.example.domains.screeningReview.entity.ScreeningReview; import com.example.domains.user.validator.UserValidator; diff --git a/Api/src/main/java/com/example/api/screening/service/GetScreeningReviewListUseCase.java b/Api/src/main/java/com/example/api/screening/service/GetScreeningReviewListUseCase.java index 3ea4e5b..0b228ea 100644 --- a/Api/src/main/java/com/example/api/screening/service/GetScreeningReviewListUseCase.java +++ b/Api/src/main/java/com/example/api/screening/service/GetScreeningReviewListUseCase.java @@ -2,16 +2,11 @@ import com.example.adaptor.UseCase; import com.example.api.config.security.SecurityUtil; -import com.example.domains.screening.entity.Screening; import com.example.domains.screeningReview.adaptor.ReviewAdaptor; -import com.example.domains.screeningReview.entity.ScreeningReview; -import com.example.domains.screeningReview.entity.dto.ReviewResponseDto; import com.example.domains.screeningReview.entity.dto.ScreeningWithReviewDto; import com.example.domains.userscreening.adaptor.UserScreeningAdaptor; -import com.example.domains.userscreening.entity.UserScreening; import lombok.RequiredArgsConstructor; -import java.util.ArrayList; import java.util.List; @UseCase diff --git a/Api/src/main/java/com/example/api/screening/service/GetScreeningStatisticsUseCase.java b/Api/src/main/java/com/example/api/screening/service/GetScreeningStatisticsUseCase.java index 10036bf..15509a6 100644 --- a/Api/src/main/java/com/example/api/screening/service/GetScreeningStatisticsUseCase.java +++ b/Api/src/main/java/com/example/api/screening/service/GetScreeningStatisticsUseCase.java @@ -5,14 +5,11 @@ import com.example.api.screening.dto.response.ScreeningStatisticsResponse; import com.example.domains.screening.adaptor.ScreeningAdaptor; import com.example.domains.screening.entity.Screening; -import com.example.domains.user.entity.User; import com.example.domains.userscreening.adaptor.UserScreeningAdaptor; import com.example.domains.userscreening.entity.UserScreening; import com.example.domains.userscreening.exception.exceptions.UserScreeningIsNotHost; import lombok.RequiredArgsConstructor; -import java.util.List; - @UseCase @RequiredArgsConstructor public class GetScreeningStatisticsUseCase { diff --git a/Api/src/main/java/com/example/api/screening/service/GetScreeningUseCase.java b/Api/src/main/java/com/example/api/screening/service/GetScreeningUseCase.java index c35825b..8d11eea 100644 --- a/Api/src/main/java/com/example/api/screening/service/GetScreeningUseCase.java +++ b/Api/src/main/java/com/example/api/screening/service/GetScreeningUseCase.java @@ -4,16 +4,12 @@ import com.example.api.config.security.SecurityUtil; import com.example.api.screening.dto.response.ScreeningInfoResponse; import com.example.api.screening.dto.response.ScreeningResponse; -import com.example.api.screening.dto.response.ScreeningUploadResponse; import com.example.domains.screening.adaptor.ScreeningAdaptor; import com.example.domains.screening.entity.Screening; import com.example.domains.screeningReview.adaptor.ReviewAdaptor; -import com.example.domains.screeningReview.entity.ScreeningReview; -import com.example.domains.user.entity.User; import com.example.domains.user.validator.UserValidator; import com.example.domains.userscreening.adaptor.UserScreeningAdaptor; import com.example.domains.userscreening.entity.UserScreening; -import com.example.domains.userscreening.exception.exceptions.UserScreeningIsHost; import com.example.domains.userscreening.exception.exceptions.UserScreeningIsNotHost; import lombok.RequiredArgsConstructor; diff --git a/Api/src/main/java/com/example/api/screening/service/PatchScreeningUseCase.java b/Api/src/main/java/com/example/api/screening/service/PatchScreeningUseCase.java index f432ef9..546fec2 100644 --- a/Api/src/main/java/com/example/api/screening/service/PatchScreeningUseCase.java +++ b/Api/src/main/java/com/example/api/screening/service/PatchScreeningUseCase.java @@ -2,16 +2,12 @@ import com.example.adaptor.UseCase; import com.example.api.screening.dto.request.PostScreeningRequest; -import com.example.api.screening.dto.response.ScreeningUploadResponse; import com.example.domains.screening.adaptor.ScreeningAdaptor; import com.example.domains.screening.entity.Screening; import com.example.domains.screening.enums.HostInfo; -import com.example.domains.screening.repository.ScreeningRepository; import lombok.RequiredArgsConstructor; import org.springframework.transaction.annotation.Transactional; -import java.util.Optional; - @UseCase @RequiredArgsConstructor public class PatchScreeningUseCase { diff --git a/Api/src/main/java/com/example/api/screening/service/ScreeningUploadUseCase.java b/Api/src/main/java/com/example/api/screening/service/ScreeningUploadUseCase.java index 46cadac..8f7b728 100644 --- a/Api/src/main/java/com/example/api/screening/service/ScreeningUploadUseCase.java +++ b/Api/src/main/java/com/example/api/screening/service/ScreeningUploadUseCase.java @@ -8,14 +8,11 @@ import com.example.domains.screening.enums.HostInfo; import com.example.domains.user.adaptor.UserAdaptor; import com.example.domains.user.entity.User; -import com.example.domains.user.repository.UserRepository; import com.example.domains.user.validator.UserValidator; import com.example.domains.userscreening.adaptor.UserScreeningAdaptor; import com.example.domains.userscreening.entity.UserScreening; import com.example.s3.service.S3PresignedUrlService; import lombok.RequiredArgsConstructor; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.multipart.MultipartFile; import java.io.IOException; diff --git a/Api/src/main/java/com/example/api/user/model/dto/GetUserInfoResponse.java b/Api/src/main/java/com/example/api/user/model/dto/GetUserInfoResponse.java index 222bb6c..82482b3 100644 --- a/Api/src/main/java/com/example/api/user/model/dto/GetUserInfoResponse.java +++ b/Api/src/main/java/com/example/api/user/model/dto/GetUserInfoResponse.java @@ -1,23 +1,12 @@ package com.example.api.user.model.dto; -import com.example.adaptor.ValidEnum; -import com.example.domains.common.StringListConverter; import com.example.domains.user.entity.User; -import com.example.domains.user.enums.Genre; import com.example.domains.user.enums.OauthProvider; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import io.swagger.v3.oas.annotations.media.ArraySchema; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; import lombok.RequiredArgsConstructor; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; - @Getter @RequiredArgsConstructor public class GetUserInfoResponse { diff --git a/Api/src/main/java/com/example/api/user/service/GetUserInfoUseCase.java b/Api/src/main/java/com/example/api/user/service/GetUserInfoUseCase.java index 2fead83..0086413 100644 --- a/Api/src/main/java/com/example/api/user/service/GetUserInfoUseCase.java +++ b/Api/src/main/java/com/example/api/user/service/GetUserInfoUseCase.java @@ -6,14 +6,11 @@ import com.example.api.user.model.dto.GetUserInfoResponse; import com.example.domains.user.adaptor.UserAdaptor; import com.example.domains.user.entity.User; -import com.example.domains.user.enums.Genre; import com.example.domains.user.service.UserService; import com.example.domains.user.validator.UserValidator; import lombok.RequiredArgsConstructor; import org.springframework.transaction.annotation.Transactional; -import java.util.List; - @UseCase @RequiredArgsConstructor public class GetUserInfoUseCase { diff --git a/Api/src/main/java/com/example/api/user/service/PatchUserInfoUseCase.java b/Api/src/main/java/com/example/api/user/service/PatchUserInfoUseCase.java index 879d89c..3f5c7a5 100644 --- a/Api/src/main/java/com/example/api/user/service/PatchUserInfoUseCase.java +++ b/Api/src/main/java/com/example/api/user/service/PatchUserInfoUseCase.java @@ -3,8 +3,6 @@ import com.example.adaptor.UseCase; import com.example.api.config.security.SecurityUtil; import com.example.api.user.model.dto.UpdateUserInfoRequest; -import com.example.domains.user.adaptor.UserAdaptor; -import com.example.domains.user.entity.User; import com.example.domains.user.service.UserService; import lombok.RequiredArgsConstructor; import org.springframework.transaction.annotation.Transactional; diff --git a/Api/src/test/java/com/example/api/Popcorn/service/GetTopRatedMoviesTest.java b/Api/src/test/java/com/example/api/Popcorn/service/GetTopRatedMoviesTest.java index 52dde2c..da3e9af 100644 --- a/Api/src/test/java/com/example/api/Popcorn/service/GetTopRatedMoviesTest.java +++ b/Api/src/test/java/com/example/api/Popcorn/service/GetTopRatedMoviesTest.java @@ -1,20 +1,4 @@ package com.example.api.Popcorn.service; -import com.example.api.diverseMovie.service.GetTopRatedMovies; -import okhttp3.Call; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; - -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentMatchers; - -import java.io.IOException; - -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; -import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo; -import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess; - public class GetTopRatedMoviesTest { diff --git a/Api/src/test/java/com/example/api/recommendedPopcorn/service/GetRecommendedPopocornUseCaseTest.java b/Api/src/test/java/com/example/api/recommendedPopcorn/service/GetRecommendedPopocornUseCaseTest.java index 9549098..aae1530 100644 --- a/Api/src/test/java/com/example/api/recommendedPopcorn/service/GetRecommendedPopocornUseCaseTest.java +++ b/Api/src/test/java/com/example/api/recommendedPopcorn/service/GetRecommendedPopocornUseCaseTest.java @@ -1,7 +1,5 @@ package com.example.api.recommendedPopcorn.service; -import static org.junit.jupiter.api.Assertions.*; - class GetRecommendedPopocornUseCaseTest { //TODO 3. 예비 팝콘작 추천된거 보여주는 list 반환 diff --git a/Core/src/main/java/com/example/CoreApplication.java b/Core/src/main/java/com/example/CoreApplication.java index 67f1bf6..a373ac6 100644 --- a/Core/src/main/java/com/example/CoreApplication.java +++ b/Core/src/main/java/com/example/CoreApplication.java @@ -1,8 +1,6 @@ package com.example; -import org.springframework.boot.autoconfigure.ImportAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.context.properties.ConfigurationPropertiesScan; @SpringBootApplication public class CoreApplication {} \ No newline at end of file diff --git a/Core/src/main/java/com/example/adaptor/Adaptor.java b/Core/src/main/java/com/example/adaptor/Adaptor.java index 2b0cfca..1ac50af 100644 --- a/Core/src/main/java/com/example/adaptor/Adaptor.java +++ b/Core/src/main/java/com/example/adaptor/Adaptor.java @@ -1,7 +1,5 @@ package com.example.adaptor; -import com.example.jwt.JwtProperties; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.core.annotation.AliasFor; import org.springframework.stereotype.Component; diff --git a/Core/src/main/java/com/example/jwt/JwtProperties.java b/Core/src/main/java/com/example/jwt/JwtProperties.java index b444895..f86e539 100644 --- a/Core/src/main/java/com/example/jwt/JwtProperties.java +++ b/Core/src/main/java/com/example/jwt/JwtProperties.java @@ -1,13 +1,9 @@ package com.example.jwt; -import lombok.AllArgsConstructor; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.boot.context.properties.bind.ConstructorBinding; -import org.springframework.context.annotation.Configuration; -import org.springframework.stereotype.Component; @Getter @Setter diff --git a/Core/src/main/java/com/example/properties/KakaoOAuthProperties.java b/Core/src/main/java/com/example/properties/KakaoOAuthProperties.java index addbfb5..1ff6502 100644 --- a/Core/src/main/java/com/example/properties/KakaoOAuthProperties.java +++ b/Core/src/main/java/com/example/properties/KakaoOAuthProperties.java @@ -1,14 +1,9 @@ package com.example.properties; -import lombok.AllArgsConstructor; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.boot.context.properties.bind.ConstructorBinding; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.stereotype.Component; @Getter @Setter diff --git a/Domain/src/main/java/com/example/domains/block/exception/BlockExceptionErrorCode.java b/Domain/src/main/java/com/example/domains/block/exception/BlockExceptionErrorCode.java index 85bf964..6ad6add 100644 --- a/Domain/src/main/java/com/example/domains/block/exception/BlockExceptionErrorCode.java +++ b/Domain/src/main/java/com/example/domains/block/exception/BlockExceptionErrorCode.java @@ -5,8 +5,6 @@ import lombok.AllArgsConstructor; import lombok.Getter; -import static com.example.consts.PopCornMateConsts.NOT_FOUND; - @Getter @AllArgsConstructor diff --git a/Domain/src/main/java/com/example/domains/block/exception/exceptions/DuplicateBlockRequest.java b/Domain/src/main/java/com/example/domains/block/exception/exceptions/DuplicateBlockRequest.java index 347c437..25e050f 100644 --- a/Domain/src/main/java/com/example/domains/block/exception/exceptions/DuplicateBlockRequest.java +++ b/Domain/src/main/java/com/example/domains/block/exception/exceptions/DuplicateBlockRequest.java @@ -1,8 +1,6 @@ package com.example.domains.block.exception.exceptions; import com.example.domains.block.exception.BlockExceptionErrorCode; -import com.example.domains.screening.exception.ScreeningErrorCode; -import com.example.domains.screening.exception.exceptions.NotPassedDate; import com.example.error.BaseErrorException; public class DuplicateBlockRequest extends BaseErrorException { diff --git a/Domain/src/main/java/com/example/domains/common/ScheduleService.java b/Domain/src/main/java/com/example/domains/common/ScheduleService.java index c8b12fe..e795e49 100644 --- a/Domain/src/main/java/com/example/domains/common/ScheduleService.java +++ b/Domain/src/main/java/com/example/domains/common/ScheduleService.java @@ -1,13 +1,10 @@ package com.example.domains.common; import com.example.domains.screening.adaptor.ScreeningAdaptor; -import com.example.domains.screening.entity.Screening; -import com.example.domains.user.entity.User; import com.example.domains.user.repository.UserRepository; import com.example.domains.userscreening.adaptor.UserScreeningAdaptor; import com.example.domains.userscreening.entity.UserScreening; import com.example.fcm.adaptor.FcmTokenAdaptor; -import com.example.fcm.entity.FCMToken; import com.example.fcm.repository.FcmRepository; import com.example.fcm.request.NotificationRequest; import com.example.fcm.service.FcmService; diff --git a/Domain/src/main/java/com/example/domains/common/util/SliceUtil.java b/Domain/src/main/java/com/example/domains/common/util/SliceUtil.java index d1a32e0..850701b 100644 --- a/Domain/src/main/java/com/example/domains/common/util/SliceUtil.java +++ b/Domain/src/main/java/com/example/domains/common/util/SliceUtil.java @@ -4,7 +4,6 @@ import org.springframework.data.domain.Slice; import org.springframework.data.domain.SliceImpl; - import java.util.List; public class SliceUtil { diff --git a/Domain/src/main/java/com/example/domains/diverseMovie/DiverseMovieRepository.java b/Domain/src/main/java/com/example/domains/diverseMovie/DiverseMovieRepository.java index 4923d50..2855a3f 100644 --- a/Domain/src/main/java/com/example/domains/diverseMovie/DiverseMovieRepository.java +++ b/Domain/src/main/java/com/example/domains/diverseMovie/DiverseMovieRepository.java @@ -2,9 +2,6 @@ import com.example.domains.diverseMovie.entity.DiverseMovie; import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.Query; - -import java.util.List; public interface DiverseMovieRepository extends JpaRepository { } diff --git a/Domain/src/main/java/com/example/domains/diverseMovie/adaptor/DiverseMovieAdaptor.java b/Domain/src/main/java/com/example/domains/diverseMovie/adaptor/DiverseMovieAdaptor.java index 51a0414..5649e67 100644 --- a/Domain/src/main/java/com/example/domains/diverseMovie/adaptor/DiverseMovieAdaptor.java +++ b/Domain/src/main/java/com/example/domains/diverseMovie/adaptor/DiverseMovieAdaptor.java @@ -12,7 +12,6 @@ import java.time.LocalDateTime; import java.time.temporal.WeekFields; import java.util.List; -import java.util.stream.Collectors; import static com.example.domains.diverseMovie.entity.QDiverseMovie.diverseMovie; diff --git a/Domain/src/main/java/com/example/domains/popcorn/adaptor/PopcornAdaptor.java b/Domain/src/main/java/com/example/domains/popcorn/adaptor/PopcornAdaptor.java index 20dab46..5898968 100644 --- a/Domain/src/main/java/com/example/domains/popcorn/adaptor/PopcornAdaptor.java +++ b/Domain/src/main/java/com/example/domains/popcorn/adaptor/PopcornAdaptor.java @@ -4,30 +4,20 @@ import com.example.domains.popcorn.entity.Popcorn; import com.example.domains.popcorn.entity.QPopcorn; import com.example.domains.popcorn.entity.dto.PopcornKeywordResponseDto; -import com.example.domains.popcorn.entity.dto.PopcornResponseDto; import com.example.domains.popcorn.entity.dto.QPopcornKeywordResponseDto; import com.example.domains.popcorn.repository.PopcornRepository; import com.example.domains.recommendedPopcorn.entity.QRecommendedPopcorn; import com.example.domains.recommendedPopcorn.entity.RecommendedPopcorn; -import com.example.domains.screening.entity.QScreening; -import com.querydsl.core.Tuple; import com.querydsl.jpa.impl.JPAQueryFactory; import com.querydsl.jpa.impl.JPAUpdateClause; import lombok.RequiredArgsConstructor; import org.springframework.transaction.annotation.Transactional; -import java.lang.reflect.Field; import java.time.LocalDate; import java.time.LocalDateTime; -import java.time.temporal.TemporalField; -import java.time.temporal.WeekFields; -import java.util.ArrayList; import java.util.List; -import java.util.Locale; import java.util.Optional; -import java.util.stream.Collectors; -import static com.example.domains.diverseMovie.entity.QDiverseMovie.diverseMovie; import static com.example.domains.popcorn.entity.QPopcorn.popcorn; @Adaptor diff --git a/Domain/src/main/java/com/example/domains/popcorn/entity/dto/PopcornKeywordResponseDto.java b/Domain/src/main/java/com/example/domains/popcorn/entity/dto/PopcornKeywordResponseDto.java index fa251f1..8a9175b 100644 --- a/Domain/src/main/java/com/example/domains/popcorn/entity/dto/PopcornKeywordResponseDto.java +++ b/Domain/src/main/java/com/example/domains/popcorn/entity/dto/PopcornKeywordResponseDto.java @@ -3,7 +3,6 @@ import com.querydsl.core.annotations.QueryProjection; import lombok.Getter; import lombok.NoArgsConstructor; -import lombok.RequiredArgsConstructor; @Getter @NoArgsConstructor diff --git a/Domain/src/main/java/com/example/domains/popcorn/schedule/PopcornSchedule.java b/Domain/src/main/java/com/example/domains/popcorn/schedule/PopcornSchedule.java index 26602fc..0e72548 100644 --- a/Domain/src/main/java/com/example/domains/popcorn/schedule/PopcornSchedule.java +++ b/Domain/src/main/java/com/example/domains/popcorn/schedule/PopcornSchedule.java @@ -1,13 +1,10 @@ package com.example.domains.popcorn.schedule; import com.example.domains.popcorn.service.PopcornService; -import com.example.domains.recommendedPopcorn.entity.RecommendedPopcorn; import lombok.RequiredArgsConstructor; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; -import java.util.List; - @Service @RequiredArgsConstructor public class PopcornSchedule { diff --git a/Domain/src/main/java/com/example/domains/popcorn/service/PopcornService.java b/Domain/src/main/java/com/example/domains/popcorn/service/PopcornService.java index 587ffb7..3e73cae 100644 --- a/Domain/src/main/java/com/example/domains/popcorn/service/PopcornService.java +++ b/Domain/src/main/java/com/example/domains/popcorn/service/PopcornService.java @@ -2,12 +2,8 @@ import com.example.adaptor.DomainService; import com.example.domains.popcorn.adaptor.PopcornAdaptor; -import com.example.domains.popcorn.entity.Popcorn; -import com.example.domains.recommendedPopcorn.entity.RecommendedPopcorn; import lombok.RequiredArgsConstructor; -import java.util.List; - @DomainService @RequiredArgsConstructor public class PopcornService { diff --git a/Domain/src/main/java/com/example/domains/popcornUser/adaptor/PopcornUserAdaptor.java b/Domain/src/main/java/com/example/domains/popcornUser/adaptor/PopcornUserAdaptor.java index 0585401..dd6a10d 100644 --- a/Domain/src/main/java/com/example/domains/popcornUser/adaptor/PopcornUserAdaptor.java +++ b/Domain/src/main/java/com/example/domains/popcornUser/adaptor/PopcornUserAdaptor.java @@ -8,20 +8,14 @@ import com.example.domains.popcornUser.entity.QPopcornUser; import com.example.domains.popcornUser.exceptions.DuplicatePopcorn; import com.example.domains.popcornUser.repository.PopcornUserRepository; -import com.example.domains.screeningReview.entity.QScreeningReview; -import com.example.domains.screeningReview.entity.ScreeningReview; import com.example.domains.user.entity.User; -import com.google.api.client.util.SecurityUtils; import com.querydsl.jpa.impl.JPAQueryFactory; import com.querydsl.jpa.impl.JPAUpdateClause; import lombok.RequiredArgsConstructor; -import org.apache.catalina.security.SecurityUtil; import org.springframework.transaction.annotation.Transactional; import java.util.List; -import static com.example.domains.popcorn.entity.QPopcorn.popcorn; - @Adaptor @RequiredArgsConstructor public class PopcornUserAdaptor { diff --git a/Domain/src/main/java/com/example/domains/popcornUser/exceptions/DuplicatePopcorn.java b/Domain/src/main/java/com/example/domains/popcornUser/exceptions/DuplicatePopcorn.java index f1cfad1..d62d31e 100644 --- a/Domain/src/main/java/com/example/domains/popcornUser/exceptions/DuplicatePopcorn.java +++ b/Domain/src/main/java/com/example/domains/popcornUser/exceptions/DuplicatePopcorn.java @@ -1,7 +1,5 @@ package com.example.domains.popcornUser.exceptions; -import com.example.domains.recommendedPopcorn.exceptions.NoMovieSearched; -import com.example.domains.recommendedPopcorn.exceptions.RecommendedErrorCode; import com.example.error.BaseErrorException; public class DuplicatePopcorn extends BaseErrorException { diff --git a/Domain/src/main/java/com/example/domains/recommendedPopcorn/adaptor/RecommendedPopcornAdaptor.java b/Domain/src/main/java/com/example/domains/recommendedPopcorn/adaptor/RecommendedPopcornAdaptor.java index 18979da..ced3f47 100644 --- a/Domain/src/main/java/com/example/domains/recommendedPopcorn/adaptor/RecommendedPopcornAdaptor.java +++ b/Domain/src/main/java/com/example/domains/recommendedPopcorn/adaptor/RecommendedPopcornAdaptor.java @@ -6,18 +6,14 @@ import com.example.domains.recommendedPopcorn.exceptions.DuplicateMovieId; import com.example.domains.recommendedPopcorn.exceptions.NoRecommendedPopcorn; import com.example.domains.recommendedPopcorn.repository.RecommendedPopcornRepository; -import com.example.domains.screening.entity.QScreening; -import com.example.domains.screening.entity.Screening; import com.querydsl.jpa.impl.JPAQueryFactory; import com.querydsl.jpa.impl.JPAUpdateClause; import lombok.RequiredArgsConstructor; import org.springframework.transaction.annotation.Transactional; -import java.nio.file.Path; import java.time.DayOfWeek; import java.time.LocalDate; import java.time.LocalDateTime; -import java.time.LocalTime; import java.util.*; import java.util.concurrent.ThreadLocalRandom; diff --git a/Domain/src/main/java/com/example/domains/recommendedPopcorn/exceptions/DuplicateMovieId.java b/Domain/src/main/java/com/example/domains/recommendedPopcorn/exceptions/DuplicateMovieId.java index 6414d05..72bbbcb 100644 --- a/Domain/src/main/java/com/example/domains/recommendedPopcorn/exceptions/DuplicateMovieId.java +++ b/Domain/src/main/java/com/example/domains/recommendedPopcorn/exceptions/DuplicateMovieId.java @@ -1,7 +1,5 @@ package com.example.domains.recommendedPopcorn.exceptions; -import com.example.domains.screening.exception.ScreeningErrorCode; -import com.example.domains.screening.exception.exceptions.NotPassedDate; import com.example.error.BaseErrorException; public class DuplicateMovieId extends BaseErrorException { diff --git a/Domain/src/main/java/com/example/domains/recommendedPopcorn/service/RecommendedPopcornService.java b/Domain/src/main/java/com/example/domains/recommendedPopcorn/service/RecommendedPopcornService.java index 874dc0e..1b89573 100644 --- a/Domain/src/main/java/com/example/domains/recommendedPopcorn/service/RecommendedPopcornService.java +++ b/Domain/src/main/java/com/example/domains/recommendedPopcorn/service/RecommendedPopcornService.java @@ -3,7 +3,6 @@ import com.example.adaptor.DomainService; import com.example.domains.recommendedPopcorn.adaptor.RecommendedPopcornAdaptor; import lombok.RequiredArgsConstructor; -import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @DomainService diff --git a/Domain/src/main/java/com/example/domains/recommendedPopcornUser/entity/RecommendedPopcornUser.java b/Domain/src/main/java/com/example/domains/recommendedPopcornUser/entity/RecommendedPopcornUser.java index 24fbdf7..1dc9534 100644 --- a/Domain/src/main/java/com/example/domains/recommendedPopcornUser/entity/RecommendedPopcornUser.java +++ b/Domain/src/main/java/com/example/domains/recommendedPopcornUser/entity/RecommendedPopcornUser.java @@ -1,7 +1,6 @@ package com.example.domains.recommendedPopcornUser.entity; import com.example.domains.recommendedPopcorn.entity.RecommendedPopcorn; -import com.example.domains.screening.entity.Screening; import com.example.domains.user.entity.User; import jakarta.persistence.*; import lombok.AccessLevel; diff --git a/Domain/src/main/java/com/example/domains/screening/adaptor/ScreeningAdaptor.java b/Domain/src/main/java/com/example/domains/screening/adaptor/ScreeningAdaptor.java index 4bb519e..42022ad 100644 --- a/Domain/src/main/java/com/example/domains/screening/adaptor/ScreeningAdaptor.java +++ b/Domain/src/main/java/com/example/domains/screening/adaptor/ScreeningAdaptor.java @@ -5,7 +5,6 @@ import com.example.domains.screening.entity.QScreening; import com.example.domains.screening.entity.Screening; import com.example.domains.screening.entity.dto.QScreeningResponseDto; -import com.example.domains.screening.entity.dto.ScreeningCountDto; import com.example.domains.screening.entity.dto.ScreeningResponseDto; import com.example.domains.screening.enums.Category; import com.example.domains.screening.repository.ScreeningRepository; @@ -18,7 +17,6 @@ import com.querydsl.jpa.impl.JPAUpdateClause; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Slice; import org.springframework.transaction.annotation.Transactional; import java.time.LocalDate; diff --git a/Domain/src/main/java/com/example/domains/screening/entity/Screening.java b/Domain/src/main/java/com/example/domains/screening/entity/Screening.java index b14740a..667d55a 100644 --- a/Domain/src/main/java/com/example/domains/screening/entity/Screening.java +++ b/Domain/src/main/java/com/example/domains/screening/entity/Screening.java @@ -10,7 +10,6 @@ import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; -import org.springframework.transaction.annotation.Transactional; import java.time.LocalDateTime; import java.util.Date; diff --git a/Domain/src/main/java/com/example/domains/screening/entity/dto/ScreeningCountDto.java b/Domain/src/main/java/com/example/domains/screening/entity/dto/ScreeningCountDto.java index ec2112c..d99db94 100644 --- a/Domain/src/main/java/com/example/domains/screening/entity/dto/ScreeningCountDto.java +++ b/Domain/src/main/java/com/example/domains/screening/entity/dto/ScreeningCountDto.java @@ -1,6 +1,5 @@ package com.example.domains.screening.entity.dto; -import com.querydsl.core.annotations.QueryProjection; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/Domain/src/main/java/com/example/domains/screening/entity/dto/ScreeningResponseDto.java b/Domain/src/main/java/com/example/domains/screening/entity/dto/ScreeningResponseDto.java index 9fc3dd2..773ee48 100644 --- a/Domain/src/main/java/com/example/domains/screening/entity/dto/ScreeningResponseDto.java +++ b/Domain/src/main/java/com/example/domains/screening/entity/dto/ScreeningResponseDto.java @@ -2,7 +2,6 @@ import com.example.domains.screening.enums.Category; import com.querydsl.core.annotations.QueryProjection; -import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/Domain/src/main/java/com/example/domains/screening/enums/Category.java b/Domain/src/main/java/com/example/domains/screening/enums/Category.java index 935aa6a..ea4da17 100644 --- a/Domain/src/main/java/com/example/domains/screening/enums/Category.java +++ b/Domain/src/main/java/com/example/domains/screening/enums/Category.java @@ -1,6 +1,5 @@ package com.example.domains.screening.enums; -import com.example.domains.user.enums.OauthProvider; import com.fasterxml.jackson.annotation.JsonCreator; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/Domain/src/main/java/com/example/domains/screening/enums/HostInfo.java b/Domain/src/main/java/com/example/domains/screening/enums/HostInfo.java index 2f94b90..8181b51 100644 --- a/Domain/src/main/java/com/example/domains/screening/enums/HostInfo.java +++ b/Domain/src/main/java/com/example/domains/screening/enums/HostInfo.java @@ -1,8 +1,5 @@ package com.example.domains.screening.enums; -import com.example.domains.common.model.BaseTimeEntity; -import com.example.domains.user.enums.OauthInfo; -import com.example.domains.user.enums.OauthProvider; import jakarta.persistence.Embeddable; import lombok.AccessLevel; import lombok.Builder; diff --git a/Domain/src/main/java/com/example/domains/screening/enums/NegativeCount.java b/Domain/src/main/java/com/example/domains/screening/enums/NegativeCount.java index ef0ed98..acf75b4 100644 --- a/Domain/src/main/java/com/example/domains/screening/enums/NegativeCount.java +++ b/Domain/src/main/java/com/example/domains/screening/enums/NegativeCount.java @@ -1,7 +1,6 @@ package com.example.domains.screening.enums; import jakarta.persistence.Embeddable; -import lombok.AccessLevel; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/Domain/src/main/java/com/example/domains/screening/enums/PositiveCount.java b/Domain/src/main/java/com/example/domains/screening/enums/PositiveCount.java index 66739ce..5ec2764 100644 --- a/Domain/src/main/java/com/example/domains/screening/enums/PositiveCount.java +++ b/Domain/src/main/java/com/example/domains/screening/enums/PositiveCount.java @@ -1,8 +1,6 @@ package com.example.domains.screening.enums; -import com.example.domains.screening.entity.Screening; import jakarta.persistence.Embeddable; -import lombok.AccessLevel; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/Domain/src/main/java/com/example/domains/screening/exception/exceptions/NotPassedDate.java b/Domain/src/main/java/com/example/domains/screening/exception/exceptions/NotPassedDate.java index 8abf7c0..ac1b6b3 100644 --- a/Domain/src/main/java/com/example/domains/screening/exception/exceptions/NotPassedDate.java +++ b/Domain/src/main/java/com/example/domains/screening/exception/exceptions/NotPassedDate.java @@ -1,8 +1,6 @@ package com.example.domains.screening.exception.exceptions; import com.example.domains.screening.exception.ScreeningErrorCode; -import com.example.domains.user.exception.UserErrorCode; -import com.example.domains.user.exception.exceptions.AlreadySignUpUserException; import com.example.error.BaseErrorException; public class NotPassedDate extends BaseErrorException { diff --git a/Domain/src/main/java/com/example/domains/screening/repository/ScreeningRepository.java b/Domain/src/main/java/com/example/domains/screening/repository/ScreeningRepository.java index 6efafe6..fd29b2f 100644 --- a/Domain/src/main/java/com/example/domains/screening/repository/ScreeningRepository.java +++ b/Domain/src/main/java/com/example/domains/screening/repository/ScreeningRepository.java @@ -1,9 +1,6 @@ package com.example.domains.screening.repository; import com.example.domains.screening.entity.Screening; -import com.example.domains.screening.enums.Category; -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Slice; import org.springframework.data.jpa.repository.JpaRepository; import java.time.LocalDateTime; diff --git a/Domain/src/main/java/com/example/domains/screening/repository/ScreeningRepositoryCustom.java b/Domain/src/main/java/com/example/domains/screening/repository/ScreeningRepositoryCustom.java index 7dcc29e..2d594c0 100644 --- a/Domain/src/main/java/com/example/domains/screening/repository/ScreeningRepositoryCustom.java +++ b/Domain/src/main/java/com/example/domains/screening/repository/ScreeningRepositoryCustom.java @@ -4,7 +4,6 @@ import com.example.domains.screening.entity.Screening; import com.example.domains.screening.enums.Category; import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Slice; public interface ScreeningRepositoryCustom { diff --git a/Domain/src/main/java/com/example/domains/screening/repository/ScreeningRepositoryImpl.java b/Domain/src/main/java/com/example/domains/screening/repository/ScreeningRepositoryImpl.java index 4316137..906df7d 100644 --- a/Domain/src/main/java/com/example/domains/screening/repository/ScreeningRepositoryImpl.java +++ b/Domain/src/main/java/com/example/domains/screening/repository/ScreeningRepositoryImpl.java @@ -9,7 +9,6 @@ import com.querydsl.jpa.impl.JPAQueryFactory; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Slice; import java.util.List; diff --git a/Domain/src/main/java/com/example/domains/screeningReview/adaptor/ReviewAdaptor.java b/Domain/src/main/java/com/example/domains/screeningReview/adaptor/ReviewAdaptor.java index 613c872..77bf31f 100644 --- a/Domain/src/main/java/com/example/domains/screeningReview/adaptor/ReviewAdaptor.java +++ b/Domain/src/main/java/com/example/domains/screeningReview/adaptor/ReviewAdaptor.java @@ -2,28 +2,19 @@ import com.example.adaptor.Adaptor; import com.example.domains.block.adaptor.BlockAdaptor; -import com.example.domains.screening.entity.QScreening; import com.example.domains.screeningReview.entity.QScreeningReview; import com.example.domains.screeningReview.entity.ScreeningReview; import com.example.domains.screeningReview.entity.dto.QScreeningWithReviewDto; -import com.example.domains.screeningReview.entity.dto.ReviewResponseDto; import com.example.domains.screeningReview.entity.dto.ScreeningWithReviewDto; import com.example.domains.screeningReview.repository.ScreeningReviewRepository; -import com.example.domains.user.entity.QUser; import com.example.domains.user.entity.User; -import com.example.domains.user.enums.UserState; import com.example.domains.userscreening.entity.QUserScreening; -import com.example.domains.userscreening.entity.UserScreening; import com.example.fcm.adaptor.FcmTokenAdaptor; -import com.google.api.client.util.SecurityUtils; -import com.querydsl.core.types.Projections; import com.querydsl.jpa.impl.JPAQueryFactory; import com.querydsl.jpa.impl.JPAUpdateClause; import lombok.RequiredArgsConstructor; -import org.apache.catalina.security.SecurityUtil; import org.springframework.transaction.annotation.Transactional; -import java.util.Collections; import java.util.List; @Adaptor diff --git a/Domain/src/main/java/com/example/domains/screeningReview/entity/ScreeningReview.java b/Domain/src/main/java/com/example/domains/screeningReview/entity/ScreeningReview.java index 3587ca3..308e32a 100644 --- a/Domain/src/main/java/com/example/domains/screeningReview/entity/ScreeningReview.java +++ b/Domain/src/main/java/com/example/domains/screeningReview/entity/ScreeningReview.java @@ -1,11 +1,8 @@ package com.example.domains.screeningReview.entity; import com.example.domains.common.model.BaseTimeEntity; -import com.example.domains.screening.entity.Screening; -import com.example.domains.screening.enums.PositiveCount; import com.example.domains.screeningReview.entity.enums.Negative; import com.example.domains.screeningReview.entity.enums.Positive; -import com.example.domains.user.entity.User; import com.example.domains.userscreening.entity.UserScreening; import jakarta.persistence.*; import lombok.AccessLevel; diff --git a/Domain/src/main/java/com/example/domains/screeningReview/entity/dto/ReviewResponseDto.java b/Domain/src/main/java/com/example/domains/screeningReview/entity/dto/ReviewResponseDto.java index 4064988..a6482f8 100644 --- a/Domain/src/main/java/com/example/domains/screeningReview/entity/dto/ReviewResponseDto.java +++ b/Domain/src/main/java/com/example/domains/screeningReview/entity/dto/ReviewResponseDto.java @@ -1,13 +1,10 @@ package com.example.domains.screeningReview.entity.dto; import com.example.domains.screeningReview.entity.ScreeningReview; -import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; -import java.time.LocalDateTime; - @Getter @NoArgsConstructor public class ReviewResponseDto { diff --git a/Domain/src/main/java/com/example/domains/screeningReview/entity/dto/ScreeningReviewResponseDto.java b/Domain/src/main/java/com/example/domains/screeningReview/entity/dto/ScreeningReviewResponseDto.java index 131dba7..4ae7a10 100644 --- a/Domain/src/main/java/com/example/domains/screeningReview/entity/dto/ScreeningReviewResponseDto.java +++ b/Domain/src/main/java/com/example/domains/screeningReview/entity/dto/ScreeningReviewResponseDto.java @@ -1,11 +1,8 @@ package com.example.domains.screeningReview.entity.dto; -import com.example.domains.screeningReview.entity.ScreeningReview; -import com.example.domains.user.entity.User; import com.querydsl.core.annotations.QueryProjection; -import lombok.*; +import lombok.Getter; -import java.time.LocalDate; import java.time.LocalDateTime; @Getter diff --git a/Domain/src/main/java/com/example/domains/screeningReview/entity/dto/ScreeningReviewUserResponseDto.java b/Domain/src/main/java/com/example/domains/screeningReview/entity/dto/ScreeningReviewUserResponseDto.java index c137de2..ba50046 100644 --- a/Domain/src/main/java/com/example/domains/screeningReview/entity/dto/ScreeningReviewUserResponseDto.java +++ b/Domain/src/main/java/com/example/domains/screeningReview/entity/dto/ScreeningReviewUserResponseDto.java @@ -3,7 +3,6 @@ import com.example.domains.user.entity.User; import lombok.Builder; import lombok.Getter; -import lombok.NoArgsConstructor; import java.time.LocalDateTime; diff --git a/Domain/src/main/java/com/example/domains/screeningReview/entity/dto/ScreeningWithReviewDto.java b/Domain/src/main/java/com/example/domains/screeningReview/entity/dto/ScreeningWithReviewDto.java index 1579d24..8881119 100644 --- a/Domain/src/main/java/com/example/domains/screeningReview/entity/dto/ScreeningWithReviewDto.java +++ b/Domain/src/main/java/com/example/domains/screeningReview/entity/dto/ScreeningWithReviewDto.java @@ -1,6 +1,5 @@ package com.example.domains.screeningReview.entity.dto; -import com.example.domains.screening.entity.Screening; import com.example.domains.screeningReview.entity.ScreeningReview; import com.querydsl.core.annotations.QueryProjection; import lombok.Builder; diff --git a/Domain/src/main/java/com/example/domains/screeningReview/repository/ScreeningReviewRepository.java b/Domain/src/main/java/com/example/domains/screeningReview/repository/ScreeningReviewRepository.java index f056890..709ae95 100644 --- a/Domain/src/main/java/com/example/domains/screeningReview/repository/ScreeningReviewRepository.java +++ b/Domain/src/main/java/com/example/domains/screeningReview/repository/ScreeningReviewRepository.java @@ -1,7 +1,6 @@ package com.example.domains.screeningReview.repository; import com.example.domains.screeningReview.entity.ScreeningReview; -import com.example.domains.userscreening.entity.UserScreening; import org.springframework.data.jpa.repository.JpaRepository; public interface ScreeningReviewRepository extends JpaRepository { diff --git a/Domain/src/main/java/com/example/domains/user/adaptor/UserAdaptor.java b/Domain/src/main/java/com/example/domains/user/adaptor/UserAdaptor.java index 820af18..026c7eb 100644 --- a/Domain/src/main/java/com/example/domains/user/adaptor/UserAdaptor.java +++ b/Domain/src/main/java/com/example/domains/user/adaptor/UserAdaptor.java @@ -2,13 +2,10 @@ import com.example.adaptor.Adaptor; import com.example.domains.user.entity.User; -import com.example.domains.user.enums.OauthInfo; import com.example.domains.user.exception.exceptions.UserNotFoundException; import com.example.domains.user.repository.UserRepository; import lombok.RequiredArgsConstructor; -import java.util.List; - @Adaptor @RequiredArgsConstructor public class UserAdaptor { diff --git a/Domain/src/main/java/com/example/domains/user/entity/RefreshTokenEntity.java b/Domain/src/main/java/com/example/domains/user/entity/RefreshTokenEntity.java index 0e62e98..322279e 100644 --- a/Domain/src/main/java/com/example/domains/user/entity/RefreshTokenEntity.java +++ b/Domain/src/main/java/com/example/domains/user/entity/RefreshTokenEntity.java @@ -1,11 +1,10 @@ package com.example.domains.user.entity; import lombok.AccessLevel; - -import lombok.NoArgsConstructor; -import org.springframework.data.annotation.Id; import lombok.Builder; import lombok.Getter; +import lombok.NoArgsConstructor; +import org.springframework.data.annotation.Id; import org.springframework.data.redis.core.RedisHash; import org.springframework.data.redis.core.TimeToLive; import org.springframework.data.redis.core.index.Indexed; diff --git a/Domain/src/main/java/com/example/domains/user/enums/OauthInfo.java b/Domain/src/main/java/com/example/domains/user/enums/OauthInfo.java index c8ba961..9f19304 100644 --- a/Domain/src/main/java/com/example/domains/user/enums/OauthInfo.java +++ b/Domain/src/main/java/com/example/domains/user/enums/OauthInfo.java @@ -3,7 +3,10 @@ import jakarta.persistence.Embeddable; import jakarta.persistence.EnumType; import jakarta.persistence.Enumerated; -import lombok.*; +import lombok.AccessLevel; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; @Getter @Embeddable diff --git a/Domain/src/main/java/com/example/domains/user/service/UserService.java b/Domain/src/main/java/com/example/domains/user/service/UserService.java index 6f6794f..38fa6ae 100644 --- a/Domain/src/main/java/com/example/domains/user/service/UserService.java +++ b/Domain/src/main/java/com/example/domains/user/service/UserService.java @@ -5,14 +5,12 @@ import com.example.domains.user.entity.User; import com.example.domains.user.enums.Genre; import com.example.domains.user.enums.OauthInfo; -import com.example.domains.user.exception.exceptions.UserNotFoundException; import com.example.domains.user.repository.UserRepository; import com.example.domains.user.validator.UserValidator; import lombok.RequiredArgsConstructor; import org.springframework.transaction.annotation.Transactional; import java.util.List; -import java.util.logging.Level; @DomainService @RequiredArgsConstructor diff --git a/Domain/src/main/java/com/example/domains/user/validator/UserValidator.java b/Domain/src/main/java/com/example/domains/user/validator/UserValidator.java index 34bbbeb..c737ac6 100644 --- a/Domain/src/main/java/com/example/domains/user/validator/UserValidator.java +++ b/Domain/src/main/java/com/example/domains/user/validator/UserValidator.java @@ -2,7 +2,6 @@ import com.example.adaptor.Validator; import com.example.domains.user.adaptor.UserAdaptor; -import com.example.domains.user.enums.OauthInfo; import com.example.domains.user.exception.exceptions.AlreadySignUpUserException; import com.example.domains.user.exception.exceptions.UserNotFoundException; import lombok.RequiredArgsConstructor; diff --git a/Domain/src/main/java/com/example/domains/userscreening/adaptor/UserScreeningAdaptor.java b/Domain/src/main/java/com/example/domains/userscreening/adaptor/UserScreeningAdaptor.java index eb96044..cde8cd5 100644 --- a/Domain/src/main/java/com/example/domains/userscreening/adaptor/UserScreeningAdaptor.java +++ b/Domain/src/main/java/com/example/domains/userscreening/adaptor/UserScreeningAdaptor.java @@ -3,11 +3,7 @@ import com.example.adaptor.Adaptor; import com.example.domains.screening.entity.Screening; import com.example.domains.screeningReview.entity.QScreeningReview; -import com.example.domains.screeningReview.entity.dto.ReviewResponseDto; import com.example.domains.screeningReview.entity.dto.ScreeningReviewResponseDto; -import com.example.domains.user.entity.User; -import com.example.domains.user.repository.UserRepository; -import com.example.domains.userscreening.entity.QUserScreening; import com.example.domains.userscreening.entity.UserScreening; import com.example.domains.userscreening.exception.exceptions.UserScreeningNotFound; import com.example.domains.userscreening.repository.UserScreeningRepository; diff --git a/Domain/src/main/java/com/example/domains/userscreening/entity/UserScreening.java b/Domain/src/main/java/com/example/domains/userscreening/entity/UserScreening.java index 84013c1..ee5d426 100644 --- a/Domain/src/main/java/com/example/domains/userscreening/entity/UserScreening.java +++ b/Domain/src/main/java/com/example/domains/userscreening/entity/UserScreening.java @@ -1,8 +1,6 @@ package com.example.domains.userscreening.entity; -import com.example.domains.common.model.BaseTimeEntity; import com.example.domains.screening.entity.Screening; -import com.example.domains.screeningReview.entity.ScreeningReview; import com.example.domains.user.entity.User; import jakarta.persistence.*; import lombok.AccessLevel; diff --git a/Domain/src/main/java/com/example/domains/userscreening/exception/UserScreeningErrorCode.java b/Domain/src/main/java/com/example/domains/userscreening/exception/UserScreeningErrorCode.java index 5cbfe57..b46fe77 100644 --- a/Domain/src/main/java/com/example/domains/userscreening/exception/UserScreeningErrorCode.java +++ b/Domain/src/main/java/com/example/domains/userscreening/exception/UserScreeningErrorCode.java @@ -5,7 +5,6 @@ import lombok.AllArgsConstructor; import lombok.Getter; -import static com.example.consts.PopCornMateConsts.BAD_REQUEST; import static com.example.consts.PopCornMateConsts.NOT_FOUND; @Getter diff --git a/Domain/src/main/java/com/example/domains/userscreening/exception/exceptions/UserScreeningNotFound.java b/Domain/src/main/java/com/example/domains/userscreening/exception/exceptions/UserScreeningNotFound.java index 02b9da8..b48abc9 100644 --- a/Domain/src/main/java/com/example/domains/userscreening/exception/exceptions/UserScreeningNotFound.java +++ b/Domain/src/main/java/com/example/domains/userscreening/exception/exceptions/UserScreeningNotFound.java @@ -1,7 +1,5 @@ package com.example.domains.userscreening.exception.exceptions; -import com.example.domains.user.exception.UserErrorCode; -import com.example.domains.user.exception.exceptions.AlreadySignUpUserException; import com.example.domains.userscreening.exception.UserScreeningErrorCode; import com.example.error.BaseErrorException; diff --git a/Domain/src/main/java/com/example/domains/userscreening/repository/UserScreeningRepository.java b/Domain/src/main/java/com/example/domains/userscreening/repository/UserScreeningRepository.java index 861bbf2..efeb24f 100644 --- a/Domain/src/main/java/com/example/domains/userscreening/repository/UserScreeningRepository.java +++ b/Domain/src/main/java/com/example/domains/userscreening/repository/UserScreeningRepository.java @@ -1,7 +1,5 @@ package com.example.domains.userscreening.repository; -import com.example.domains.screening.entity.Screening; -import com.example.domains.screeningReview.entity.ScreeningReview; import com.example.domains.userscreening.entity.UserScreening; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/Domain/src/test/java/com/example/domains/diverseMovie/schedule/DiverseMovieScheduleTest.java b/Domain/src/test/java/com/example/domains/diverseMovie/schedule/DiverseMovieScheduleTest.java index 5dcf277..d728560 100644 --- a/Domain/src/test/java/com/example/domains/diverseMovie/schedule/DiverseMovieScheduleTest.java +++ b/Domain/src/test/java/com/example/domains/diverseMovie/schedule/DiverseMovieScheduleTest.java @@ -1,23 +1,5 @@ package com.example.domains.diverseMovie.schedule; -import com.example.domains.common.config.SchedulingConfig; -import lombok.AllArgsConstructor; -import lombok.RequiredArgsConstructor; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.scheduling.annotation.SchedulingConfigurer; -import org.springframework.scheduling.config.ScheduledTaskRegistrar; -import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; -import org.springframework.test.context.junit4.SpringRunner; - -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; - -import static org.assertj.core.api.FactoryBasedNavigableListAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertTrue; - - //@SpringJUnitConfig(SchedulingConfig.class) //@SpringBootTest //@AllArgsConstructor diff --git a/Infra/src/main/java/com/example/InfraApplication.java b/Infra/src/main/java/com/example/InfraApplication.java index 2e52ff1..bae2d4e 100644 --- a/Infra/src/main/java/com/example/InfraApplication.java +++ b/Infra/src/main/java/com/example/InfraApplication.java @@ -1,10 +1,7 @@ package com.example; -import org.springframework.boot.autoconfigure.ImportAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.properties.ConfigurationPropertiesScan; -import org.springframework.cloud.openfeign.EnableFeignClients; -import org.springframework.cloud.openfeign.FeignAutoConfiguration; @SpringBootApplication diff --git a/Infra/src/main/java/com/example/oauth/client/KakaoOauthClient.java b/Infra/src/main/java/com/example/oauth/client/KakaoOauthClient.java index ef60b19..12b4587 100644 --- a/Infra/src/main/java/com/example/oauth/client/KakaoOauthClient.java +++ b/Infra/src/main/java/com/example/oauth/client/KakaoOauthClient.java @@ -3,7 +3,6 @@ import com.example.oauth.config.KakaoKauthConfig; import com.example.oauth.dto.KakaoTokenResponse; import com.example.oauth.dto.OIDCPublicKeysResponse; -import org.springframework.cache.annotation.Cacheable; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.GetMapping; diff --git a/Infra/src/main/java/com/example/oauth/exception/KakaoKauthErrorCode.java b/Infra/src/main/java/com/example/oauth/exception/KakaoKauthErrorCode.java index 3b59f79..9c55180 100644 --- a/Infra/src/main/java/com/example/oauth/exception/KakaoKauthErrorCode.java +++ b/Infra/src/main/java/com/example/oauth/exception/KakaoKauthErrorCode.java @@ -6,7 +6,7 @@ import lombok.AllArgsConstructor; import lombok.Getter; -import static com.example.consts.PopCornMateConsts.*; +import static com.example.consts.PopCornMateConsts.BAD_REQUEST; @Getter @AllArgsConstructor diff --git a/Infra/src/main/java/com/example/redis/config/RedisCacheManagerConfig.java b/Infra/src/main/java/com/example/redis/config/RedisCacheManagerConfig.java index 809c958..bac0c6e 100644 --- a/Infra/src/main/java/com/example/redis/config/RedisCacheManagerConfig.java +++ b/Infra/src/main/java/com/example/redis/config/RedisCacheManagerConfig.java @@ -1,6 +1,5 @@ package com.example.redis.config; -import lombok.RequiredArgsConstructor; import org.springframework.cache.CacheManager; import org.springframework.cache.annotation.EnableCaching; import org.springframework.context.annotation.Bean; @@ -14,8 +13,6 @@ import org.springframework.data.redis.serializer.StringRedisSerializer; import java.time.Duration; -import java.util.HashMap; -import java.util.Map; diff --git a/Infra/src/main/java/com/example/redis/config/RedisConfig.java b/Infra/src/main/java/com/example/redis/config/RedisConfig.java index f0cb7a3..e65b605 100644 --- a/Infra/src/main/java/com/example/redis/config/RedisConfig.java +++ b/Infra/src/main/java/com/example/redis/config/RedisConfig.java @@ -1,10 +1,5 @@ package com.example.redis.config; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import com.fasterxml.jackson.databind.jsontype.BasicPolymorphicTypeValidator; -import com.fasterxml.jackson.databind.jsontype.PolymorphicTypeValidator; -import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; @@ -16,7 +11,6 @@ import org.springframework.data.redis.core.RedisKeyValueAdapter; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.repository.configuration.EnableRedisRepositories; -import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; import org.springframework.data.redis.serializer.StringRedisSerializer; import java.time.Duration; From 24836026af1033b8d1d1aa5da62d5771c8410e56 Mon Sep 17 00:00:00 2001 From: Hanbee Lee Date: Thu, 8 Feb 2024 17:59:20 +0900 Subject: [PATCH 2/5] =?UTF-8?q?refactor:=20=ED=95=84=EC=9A=94=EC=97=86?= =?UTF-8?q?=EB=8A=94=20System.println.out=EC=A7=80=EC=9A=B0=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../example/api/auth/service/helper/KakaoOauthHelper.java | 4 ---- .../api/diverseMovie/service/GetTopRatedMovies.java | 2 -- .../service/PostRecommendPopcornUseCase.java | 8 -------- .../api/screening/dto/response/BookMarkResponse.java | 1 - .../api/screening/service/GetRateCountUseCase.java | 7 +------ .../api/screening/service/GetScreeningUseCase.java | 3 --- .../api/Popcorn/service/GetTopRatedMoviesTest.java | 1 - .../com/example/domains/block/adaptor/BlockAdaptor.java | 1 - .../java/com/example/domains/common/ScheduleService.java | 6 ------ .../com/example/domains/common/StringListConverter.java | 1 - .../java/com/example/domains/common/util/SliceUtil.java | 4 ---- .../domains/diverseMovie/service/DiverseMovieService.java | 2 -- .../adaptor/RecommendedPopcornAdaptor.java | 1 - .../domains/screeningReview/adaptor/ReviewAdaptor.java | 3 --- .../oauth/apple/config/AppleOAuthErrorDecoder.java | 2 -- 15 files changed, 1 insertion(+), 45 deletions(-) diff --git a/Api/src/main/java/com/example/api/auth/service/helper/KakaoOauthHelper.java b/Api/src/main/java/com/example/api/auth/service/helper/KakaoOauthHelper.java index 225d689..5af98c8 100644 --- a/Api/src/main/java/com/example/api/auth/service/helper/KakaoOauthHelper.java +++ b/Api/src/main/java/com/example/api/auth/service/helper/KakaoOauthHelper.java @@ -45,7 +45,6 @@ public String getKaKaoOauthLinkDev() { /** token * */ public KakaoTokenResponse getKakaoOauthToken(String code, String referer) { - System.out.println(referer); return kakaoOauthClient.kakaoAuth( kakaoOauthProperties.getClientId(), "http://localhost:3000/kakao/callback", @@ -63,9 +62,7 @@ public KakaoTokenResponse getKakaoOauthTokenDev(String code) { /** idtoken 분석 * */ public OauthInfo getKakaoOauthInfoByIdToken(String idToken) { - System.out.println(idToken); OIDCDecodePayload oidcDecodePayload = getOIDCDecodePayload(idToken); - System.out.println(oidcDecodePayload.getSub()); return OauthInfo.of(OauthProvider.KAKAO, oidcDecodePayload.getSub(),oidcDecodePayload.getEmail()); } @@ -77,7 +74,6 @@ public OauthInfo getKakaoOauthInfoByIdTokenDev(String idToken) { /** oidc decode * */ public OIDCDecodePayload getOIDCDecodePayload(String token) { OIDCPublicKeysResponse oidcPublicKeysResponse = kakaoOauthClient.getKakaoOIDCOpenKeys(); - System.out.println(oidcPublicKeysResponse); return oauthOIDCHelper.getPayloadFromIdToken( token, kakaoOauthProperties.getBaseUrl(), diff --git a/Api/src/main/java/com/example/api/diverseMovie/service/GetTopRatedMovies.java b/Api/src/main/java/com/example/api/diverseMovie/service/GetTopRatedMovies.java index 48def24..1d6d1b2 100644 --- a/Api/src/main/java/com/example/api/diverseMovie/service/GetTopRatedMovies.java +++ b/Api/src/main/java/com/example/api/diverseMovie/service/GetTopRatedMovies.java @@ -42,8 +42,6 @@ public void getTopRated() { if (response.isSuccessful()) { String responseData = response.body().string(); - System.out.println("Response Data:"); - System.out.println(responseData); saveMovie(responseData); } else { System.out.println("Request failed with code: " + response.code()); diff --git a/Api/src/main/java/com/example/api/recommendedPopcorn/service/PostRecommendPopcornUseCase.java b/Api/src/main/java/com/example/api/recommendedPopcorn/service/PostRecommendPopcornUseCase.java index 2640da4..af38aa2 100644 --- a/Api/src/main/java/com/example/api/recommendedPopcorn/service/PostRecommendPopcornUseCase.java +++ b/Api/src/main/java/com/example/api/recommendedPopcorn/service/PostRecommendPopcornUseCase.java @@ -34,7 +34,6 @@ public void execute(RecommendedPopcornRequest request) throws IOException { validateMovieId(request.getMovieId()); - System.out.println(tmdb); JsonParser parser = new JsonParser(); JsonElement jsonObject = parser.parse(request.getMovieId()); String movieTypeWithoutQuotes = request.getMovieType().replaceAll("\"", ""); @@ -61,7 +60,6 @@ private void getApi( .build(); try (Response response = client.newCall(request).execute()) { - System.out.println(response.message()); if (!response.isSuccessful()) { throw new IOException("Unexpected code " + response); } @@ -81,12 +79,6 @@ private void getApi( String plotText = movieData.path("plots").path("plot").path(0).path("plotText").asText(); String firstPosterUrl = movieData.path("posters").asText().split("\\|")[0]; - // Displaying the extracted information - System.out.println("Title: " + title); - System.out.println("Director: " + directorNm); - System.out.println("Plot: " + plotText); - System.out.println("First Poster URL: " + firstPosterUrl); - postRecommendation(movieId.toString(),title,plotText,firstPosterUrl,directorNm,popcornRequest); } } diff --git a/Api/src/main/java/com/example/api/screening/dto/response/BookMarkResponse.java b/Api/src/main/java/com/example/api/screening/dto/response/BookMarkResponse.java index 160b7db..ef33b9d 100644 --- a/Api/src/main/java/com/example/api/screening/dto/response/BookMarkResponse.java +++ b/Api/src/main/java/com/example/api/screening/dto/response/BookMarkResponse.java @@ -23,7 +23,6 @@ public BookMarkResponse(Long screeningId, boolean isBookMarked, boolean canCance this.canCancel = canCancel; } public static BookMarkResponse from(UserScreening userScreening) { - System.out.println(userScreening.isBookmarked()); //새로 만들어졌을 경우를 위해 조건 수정해야함 if (!userScreening.isBookmarked()){ return BookMarkResponse.builder() diff --git a/Api/src/main/java/com/example/api/screening/service/GetRateCountUseCase.java b/Api/src/main/java/com/example/api/screening/service/GetRateCountUseCase.java index ffc4fba..c30d68b 100644 --- a/Api/src/main/java/com/example/api/screening/service/GetRateCountUseCase.java +++ b/Api/src/main/java/com/example/api/screening/service/GetRateCountUseCase.java @@ -44,15 +44,11 @@ public ScreeningCountDto getScreeningCount(Long screeningId) { private Long getScreeningRate(Screening screening) { List userScreenings = userScreeningAdaptor.findByScreeningId(screening.getId()); int count = screening.getScreeningRate(); - System.out.println(count); - int total = getTotal(userScreenings); - //int total = userScreenings.size() - 1; - System.out.println(total); + if(total==0){ return (long) 0.0; } { - System.out.println((long) ((count / (double) total) * 100)); return (long) ((count / (double) total) * 100); } } @@ -71,7 +67,6 @@ private int getTotal(List userScreenings) { } } } - System.out.println(reviews1.size()); return reviews1.size(); } } diff --git a/Api/src/main/java/com/example/api/screening/service/GetScreeningUseCase.java b/Api/src/main/java/com/example/api/screening/service/GetScreeningUseCase.java index 8d11eea..f61f6d5 100644 --- a/Api/src/main/java/com/example/api/screening/service/GetScreeningUseCase.java +++ b/Api/src/main/java/com/example/api/screening/service/GetScreeningUseCase.java @@ -37,9 +37,6 @@ public ScreeningInfoResponse execute(Long screeningId) { isBookMarked = userScreening.isBookmarked(); }; - System.out.println(isBookMarked); - - return ScreeningInfoResponse.from(screening,isBookMarked,isReviewed); } diff --git a/Api/src/test/java/com/example/api/Popcorn/service/GetTopRatedMoviesTest.java b/Api/src/test/java/com/example/api/Popcorn/service/GetTopRatedMoviesTest.java index da3e9af..09a1fe5 100644 --- a/Api/src/test/java/com/example/api/Popcorn/service/GetTopRatedMoviesTest.java +++ b/Api/src/test/java/com/example/api/Popcorn/service/GetTopRatedMoviesTest.java @@ -12,7 +12,6 @@ public class GetTopRatedMoviesTest { // when(mockHttpClient.newCall(ArgumentMatchers.any(Request.class))).thenReturn(mockCall); // when(mockCall.execute()).thenReturn(mockResponse); // when(mockResponse.isSuccessful()).thenReturn(true); -// System.out.println(mockResponse.body()); // // //GetTopRatedMovies getTopRatedMovies = new GetTopRatedMovies(); // diff --git a/Domain/src/main/java/com/example/domains/block/adaptor/BlockAdaptor.java b/Domain/src/main/java/com/example/domains/block/adaptor/BlockAdaptor.java index 573bbaf..7e46a62 100644 --- a/Domain/src/main/java/com/example/domains/block/adaptor/BlockAdaptor.java +++ b/Domain/src/main/java/com/example/domains/block/adaptor/BlockAdaptor.java @@ -20,7 +20,6 @@ public void save(Long userId,Long reportedUserId, Long reviewId,Long popcornRevi } private void validateUser(Long userId, Long reviewId,Long popcornReviewId) { - System.out.println(blockRepository.existsByUserIdAndPopcornReviewId(userId,popcornReviewId));; if (reviewId == null) { if(blockRepository.existsByUserIdAndPopcornReviewId(userId,popcornReviewId)) { throw DuplicateBlockRequest.EXCEPTION; diff --git a/Domain/src/main/java/com/example/domains/common/ScheduleService.java b/Domain/src/main/java/com/example/domains/common/ScheduleService.java index e795e49..e4f567a 100644 --- a/Domain/src/main/java/com/example/domains/common/ScheduleService.java +++ b/Domain/src/main/java/com/example/domains/common/ScheduleService.java @@ -83,8 +83,6 @@ private void notifyReservation() { LocalDateTime now = LocalDateTime.now().withSecond(0).withNano(0); LocalDateTime reservationTime = now.plusDays(1); - System.out.println("test"); - //userScreening에서 isBookMarked인 것들 중에서 user id, screening id가져와서 List List //screening에서 startDate가져와서 startDate가 내일이면 알람을 보낼 수 있게 짜봐 fcm이랑 스프링 쓰고 있어 @@ -177,12 +175,9 @@ private void notifyReservation() { // } private boolean checkFcmExists(Long userId) { - System.out.println(userId); if (fcmRepository.findByUserId(userId).isPresent()){ - System.out.println("test23 "); return true; } else { - System.out.println("false"); return false; } } @@ -190,7 +185,6 @@ private boolean checkFcmExists(Long userId) { private void sendNotifications(NotificationRequest requests) { // FCM을 사용하여 알림을 보내는 로직 - System.out.println("test2"); fcmService.sendMessageByToken(requests); } diff --git a/Domain/src/main/java/com/example/domains/common/StringListConverter.java b/Domain/src/main/java/com/example/domains/common/StringListConverter.java index f0b511f..e5ebe77 100644 --- a/Domain/src/main/java/com/example/domains/common/StringListConverter.java +++ b/Domain/src/main/java/com/example/domains/common/StringListConverter.java @@ -33,7 +33,6 @@ public List convertToEntityAttribute(String dbData) { try { return mapper.readValue(dbData, typeReference); } catch (IOException e) { - System.out.println(e.getMessage()); throw InternalServerError.EXCEPTION; } } diff --git a/Domain/src/main/java/com/example/domains/common/util/SliceUtil.java b/Domain/src/main/java/com/example/domains/common/util/SliceUtil.java index 850701b..8acc0c1 100644 --- a/Domain/src/main/java/com/example/domains/common/util/SliceUtil.java +++ b/Domain/src/main/java/com/example/domains/common/util/SliceUtil.java @@ -9,16 +9,12 @@ public class SliceUtil { public static Slice toSlice(List contents, Pageable pageable) { boolean hasNext = hasNext(contents, pageable); - System.out.println(hasNext); return new SliceImpl<>( hasNext ? getContent(contents, pageable) : contents, pageable, hasNext); } // 다음 페이지 있는지 확인 private static boolean hasNext(List content, Pageable pageable) { - System.out.println(content.size()); - System.out.println(pageable.getPageSize()); - System.out.println(pageable.isPaged()); return pageable.isPaged() && content.size() > pageable.getPageSize(); } diff --git a/Domain/src/main/java/com/example/domains/diverseMovie/service/DiverseMovieService.java b/Domain/src/main/java/com/example/domains/diverseMovie/service/DiverseMovieService.java index d783eed..3cfe954 100644 --- a/Domain/src/main/java/com/example/domains/diverseMovie/service/DiverseMovieService.java +++ b/Domain/src/main/java/com/example/domains/diverseMovie/service/DiverseMovieService.java @@ -42,8 +42,6 @@ public void getTopRated() { if (response.isSuccessful()) { String responseData = response.body().string(); - System.out.println("Response Data:"); - System.out.println(responseData); saveMovie(responseData); } else { System.out.println("Request failed with code: " + response.code()); diff --git a/Domain/src/main/java/com/example/domains/recommendedPopcorn/adaptor/RecommendedPopcornAdaptor.java b/Domain/src/main/java/com/example/domains/recommendedPopcorn/adaptor/RecommendedPopcornAdaptor.java index ced3f47..14b6187 100644 --- a/Domain/src/main/java/com/example/domains/recommendedPopcorn/adaptor/RecommendedPopcornAdaptor.java +++ b/Domain/src/main/java/com/example/domains/recommendedPopcorn/adaptor/RecommendedPopcornAdaptor.java @@ -70,7 +70,6 @@ public List findByThreeIds() { return thisWeekList; } Set numberArray = generate(thisWeekList); - System.out.println(numberArray.size()); for (Long number : numberArray) { Optional foundItem = recommendedPopcornRepository.findById(number); diff --git a/Domain/src/main/java/com/example/domains/screeningReview/adaptor/ReviewAdaptor.java b/Domain/src/main/java/com/example/domains/screeningReview/adaptor/ReviewAdaptor.java index 77bf31f..634200a 100644 --- a/Domain/src/main/java/com/example/domains/screeningReview/adaptor/ReviewAdaptor.java +++ b/Domain/src/main/java/com/example/domains/screeningReview/adaptor/ReviewAdaptor.java @@ -74,9 +74,7 @@ public void postComplain(Long reviewId,Long userId) { ScreeningReview screeningReview = findById(reviewId); blockAdaptor.save(userId,screeningReview.getUserScreening().getUser().getId(),reviewId,null); - System.out.println("testing"); int complainCount = screeningReview.getComplaintCount(); - System.out.println(complainCount); if (complainCount == 4) { incrementComplaintCount(screeningReview); // Get user from the screeningReview @@ -89,7 +87,6 @@ public void postComplain(Long reviewId,Long userId) { // Delete the screeningReview changeBlindStatus(screeningReview); // Assuming there is a method to delete screeningReview } else { - System.out.println("test"); incrementComplaintCount(screeningReview); } } diff --git a/Infra/src/main/java/com/example/oauth/apple/config/AppleOAuthErrorDecoder.java b/Infra/src/main/java/com/example/oauth/apple/config/AppleOAuthErrorDecoder.java index 3fd7e43..1b96944 100644 --- a/Infra/src/main/java/com/example/oauth/apple/config/AppleOAuthErrorDecoder.java +++ b/Infra/src/main/java/com/example/oauth/apple/config/AppleOAuthErrorDecoder.java @@ -25,8 +25,6 @@ public Exception decode(String methodKey, Response response) { jsonNode.get("error_description") == null ? null : jsonNode.get("error_description").asText(); - - System.out.println(jsonNode); throw new BaseRunTimeException(response.status(), error, errorDescription); } } From 22b2b7753a6fc3b213672999dd5c107b9325a38a Mon Sep 17 00:00:00 2001 From: Hanbee Lee Date: Sat, 10 Feb 2024 16:55:47 +0900 Subject: [PATCH 3/5] =?UTF-8?q?refactor=20:=20static=20LocalDate=20?= =?UTF-8?q?=EB=B9=BC=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/auth/model/dto/OauthUserInfoDto.java | 2 +- .../dto/response/OauthTokenResponse.java | 2 +- .../auth/service/helper/AppleOauthHelper.java | 2 +- .../auth/service/helper/KakaoOauthHelper.java | 12 ++++++------ .../auth/service/helper/OauthOIDCHelper.java | 4 ++-- .../popcorn/adaptor/PopcornAdaptor.java | 19 +++++-------------- .../oauth/apple/client/AppleOIDCClient.java | 2 +- .../{ => kakao}/client/KakaoInfoClient.java | 8 ++++---- .../{ => kakao}/client/KakaoOauthClient.java | 8 ++++---- .../{ => kakao}/config/KakaoInfoConfig.java | 2 +- .../config/KakaoInfoErrorDecoder.java | 2 +- .../{ => kakao}/config/KakaoKauthConfig.java | 2 +- .../config/KakaoKauthErrorDecoder.java | 6 +++--- .../{ => kakao}/dto/KakaoInfoResponseDto.java | 2 +- .../dto/KakaoKauthErrorResponse.java | 2 +- .../{ => kakao}/dto/KakaoTokenResponse.java | 2 +- .../{ => kakao}/dto/KakaoUnlinkTarget.java | 2 +- .../{ => kakao}/dto/OIDCPublicKeyDto.java | 2 +- .../dto/OIDCPublicKeysResponse.java | 2 +- .../exception/KakaoKauthErrorCode.java | 2 +- 20 files changed, 38 insertions(+), 47 deletions(-) rename Infra/src/main/java/com/example/oauth/{ => kakao}/client/KakaoInfoClient.java (80%) rename Infra/src/main/java/com/example/oauth/{ => kakao}/client/KakaoOauthClient.java (82%) rename Infra/src/main/java/com/example/oauth/{ => kakao}/config/KakaoInfoConfig.java (93%) rename Infra/src/main/java/com/example/oauth/{ => kakao}/config/KakaoInfoErrorDecoder.java (96%) rename Infra/src/main/java/com/example/oauth/{ => kakao}/config/KakaoKauthConfig.java (93%) rename Infra/src/main/java/com/example/oauth/{ => kakao}/config/KakaoKauthErrorDecoder.java (81%) rename Infra/src/main/java/com/example/oauth/{ => kakao}/dto/KakaoInfoResponseDto.java (96%) rename Infra/src/main/java/com/example/oauth/{ => kakao}/dto/KakaoKauthErrorResponse.java (96%) rename Infra/src/main/java/com/example/oauth/{ => kakao}/dto/KakaoTokenResponse.java (91%) rename Infra/src/main/java/com/example/oauth/{ => kakao}/dto/KakaoUnlinkTarget.java (91%) rename Infra/src/main/java/com/example/oauth/{ => kakao}/dto/OIDCPublicKeyDto.java (86%) rename Infra/src/main/java/com/example/oauth/{ => kakao}/dto/OIDCPublicKeysResponse.java (83%) rename Infra/src/main/java/com/example/oauth/{ => kakao}/exception/KakaoKauthErrorCode.java (98%) diff --git a/Api/src/main/java/com/example/api/auth/model/dto/OauthUserInfoDto.java b/Api/src/main/java/com/example/api/auth/model/dto/OauthUserInfoDto.java index a74c679..501bd5f 100644 --- a/Api/src/main/java/com/example/api/auth/model/dto/OauthUserInfoDto.java +++ b/Api/src/main/java/com/example/api/auth/model/dto/OauthUserInfoDto.java @@ -1,7 +1,7 @@ package com.example.api.auth.model.dto; import com.example.domains.user.enums.OauthProvider; -import com.example.oauth.dto.KakaoInfoResponseDto; +import com.example.oauth.kakao.dto.KakaoInfoResponseDto; import lombok.Builder; import lombok.Getter; diff --git a/Api/src/main/java/com/example/api/auth/model/dto/response/OauthTokenResponse.java b/Api/src/main/java/com/example/api/auth/model/dto/response/OauthTokenResponse.java index fb039c6..4398bb6 100644 --- a/Api/src/main/java/com/example/api/auth/model/dto/response/OauthTokenResponse.java +++ b/Api/src/main/java/com/example/api/auth/model/dto/response/OauthTokenResponse.java @@ -1,7 +1,7 @@ package com.example.api.auth.model.dto.response; import com.example.oauth.apple.AppleTokenResponse; -import com.example.oauth.dto.KakaoTokenResponse; +import com.example.oauth.kakao.dto.KakaoTokenResponse; import lombok.Builder; import lombok.Getter; diff --git a/Api/src/main/java/com/example/api/auth/service/helper/AppleOauthHelper.java b/Api/src/main/java/com/example/api/auth/service/helper/AppleOauthHelper.java index 8d102bd..d7a2f23 100644 --- a/Api/src/main/java/com/example/api/auth/service/helper/AppleOauthHelper.java +++ b/Api/src/main/java/com/example/api/auth/service/helper/AppleOauthHelper.java @@ -9,7 +9,7 @@ import com.example.oauth.apple.client.AppleOAuthClient; import com.example.oauth.apple.client.AppleOIDCClient; import com.example.oauth.apple.helper.AppleLoginUtil; -import com.example.oauth.dto.OIDCPublicKeysResponse; +import com.example.oauth.kakao.dto.OIDCPublicKeysResponse; import com.example.properties.AppleOAuthProperties; import lombok.RequiredArgsConstructor; diff --git a/Api/src/main/java/com/example/api/auth/service/helper/KakaoOauthHelper.java b/Api/src/main/java/com/example/api/auth/service/helper/KakaoOauthHelper.java index 5af98c8..b68cc93 100644 --- a/Api/src/main/java/com/example/api/auth/service/helper/KakaoOauthHelper.java +++ b/Api/src/main/java/com/example/api/auth/service/helper/KakaoOauthHelper.java @@ -5,12 +5,12 @@ import com.example.domains.user.enums.OauthInfo; import com.example.domains.user.enums.OauthProvider; import com.example.dto.OIDCDecodePayload; -import com.example.oauth.client.KakaoInfoClient; -import com.example.oauth.client.KakaoOauthClient; -import com.example.oauth.dto.KakaoInfoResponseDto; -import com.example.oauth.dto.KakaoTokenResponse; -import com.example.oauth.dto.KakaoUnlinkTarget; -import com.example.oauth.dto.OIDCPublicKeysResponse; +import com.example.oauth.kakao.client.KakaoInfoClient; +import com.example.oauth.kakao.client.KakaoOauthClient; +import com.example.oauth.kakao.dto.KakaoInfoResponseDto; +import com.example.oauth.kakao.dto.KakaoTokenResponse; +import com.example.oauth.kakao.dto.KakaoUnlinkTarget; +import com.example.oauth.kakao.dto.OIDCPublicKeysResponse; import com.example.properties.KakaoOAuthProperties; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/Api/src/main/java/com/example/api/auth/service/helper/OauthOIDCHelper.java b/Api/src/main/java/com/example/api/auth/service/helper/OauthOIDCHelper.java index 8a76541..6824536 100644 --- a/Api/src/main/java/com/example/api/auth/service/helper/OauthOIDCHelper.java +++ b/Api/src/main/java/com/example/api/auth/service/helper/OauthOIDCHelper.java @@ -4,8 +4,8 @@ import com.example.adaptor.Helper; import com.example.dto.OIDCDecodePayload; import com.example.jwt.JwtOIDCProvider; -import com.example.oauth.dto.OIDCPublicKeyDto; -import com.example.oauth.dto.OIDCPublicKeysResponse; +import com.example.oauth.kakao.dto.OIDCPublicKeyDto; +import com.example.oauth.kakao.dto.OIDCPublicKeysResponse; import lombok.RequiredArgsConstructor; @Helper diff --git a/Domain/src/main/java/com/example/domains/popcorn/adaptor/PopcornAdaptor.java b/Domain/src/main/java/com/example/domains/popcorn/adaptor/PopcornAdaptor.java index 5898968..f56ba20 100644 --- a/Domain/src/main/java/com/example/domains/popcorn/adaptor/PopcornAdaptor.java +++ b/Domain/src/main/java/com/example/domains/popcorn/adaptor/PopcornAdaptor.java @@ -25,6 +25,9 @@ public class PopcornAdaptor { private final PopcornRepository popcornRepository; private final JPAQueryFactory jpaQueryFactory; + private static LocalDate today = LocalDate.now(); + private static LocalDate startOfLastWeek = today.minusDays(today.getDayOfWeek().getValue() + 6); // 지난 주의 월요일 + private static LocalDate endOfLastWeek = startOfLastWeek.plusDays(6); // 지난 주의 일요일 @Transactional public void save(Popcorn popcorn){ @@ -40,18 +43,14 @@ public void saveToPopcorn() { } } - public Popcorn convertToPopcorn(RecommendedPopcorn rp){ - final Popcorn popcorn = Popcorn.of(rp.getMovieId(),rp.getMovieTitle(),rp.getImageUrl(),rp.getMovieDetail(),rp.getMovieDirector(),rp.getRecommendationReason(),rp.getRecommendationCount()); + public Popcorn convertToPopcorn(RecommendedPopcorn recommendedPopcorn){ + final Popcorn popcorn = Popcorn.of(recommendedPopcorn.getMovieId(),recommendedPopcorn.getMovieTitle(),recommendedPopcorn.getImageUrl(),recommendedPopcorn.getMovieDetail(),recommendedPopcorn.getMovieDirector(),recommendedPopcorn.getRecommendationReason(),recommendedPopcorn.getRecommendationCount()); return popcorn; } public List findTopThree() { QRecommendedPopcorn recommendedPopcorn = QRecommendedPopcorn.recommendedPopcorn; - LocalDate today = LocalDate.now(); - LocalDate startOfLastWeek = today.minusDays(today.getDayOfWeek().getValue() + 6); // 지난 주의 월요일 - LocalDate endOfLastWeek = startOfLastWeek.plusDays(6); // 지난 주의 일요일 - return jpaQueryFactory .selectFrom(recommendedPopcorn) .where(recommendedPopcorn.createdAt.between(startOfLastWeek.atStartOfDay(), endOfLastWeek.atTime(23, 59, 59))) @@ -85,10 +84,6 @@ public List findTopThreeTest() { public List findLastWeekPopcorns() { QPopcorn popcorn = QPopcorn.popcorn; - LocalDate today = LocalDate.now(); - LocalDate startOfLastWeek = today.minusDays(today.getDayOfWeek().getValue() + 6); // 지난 주의 월요일 - LocalDate endOfLastWeek = startOfLastWeek.plusDays(6); // 지난 주의 일요일 - return jpaQueryFactory .selectFrom(popcorn) .where(popcorn.createdAt.between(startOfLastWeek.atStartOfDay(), endOfLastWeek.atTime(23, 59, 59))) @@ -451,10 +446,6 @@ public PopcornKeywordResponseDto getTopRatedCounts(Long popcornId) { return resultList; - -// .where(popcorn.id.eq(popcornId)) -// .orderBy(popcorn.popcornPostiveCount.desc()) -// .limit(3) } public List findPastHoursPopcorns() { diff --git a/Infra/src/main/java/com/example/oauth/apple/client/AppleOIDCClient.java b/Infra/src/main/java/com/example/oauth/apple/client/AppleOIDCClient.java index 56e5878..67d1636 100644 --- a/Infra/src/main/java/com/example/oauth/apple/client/AppleOIDCClient.java +++ b/Infra/src/main/java/com/example/oauth/apple/client/AppleOIDCClient.java @@ -2,7 +2,7 @@ import com.example.oauth.apple.config.AppleOAuthConfig; -import com.example.oauth.dto.OIDCPublicKeysResponse; +import com.example.oauth.kakao.dto.OIDCPublicKeysResponse; import org.springframework.cache.annotation.Cacheable; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; diff --git a/Infra/src/main/java/com/example/oauth/client/KakaoInfoClient.java b/Infra/src/main/java/com/example/oauth/kakao/client/KakaoInfoClient.java similarity index 80% rename from Infra/src/main/java/com/example/oauth/client/KakaoInfoClient.java rename to Infra/src/main/java/com/example/oauth/kakao/client/KakaoInfoClient.java index ece53c1..7025c20 100644 --- a/Infra/src/main/java/com/example/oauth/client/KakaoInfoClient.java +++ b/Infra/src/main/java/com/example/oauth/kakao/client/KakaoInfoClient.java @@ -1,8 +1,8 @@ -package com.example.oauth.client; +package com.example.oauth.kakao.client; -import com.example.oauth.config.KakaoInfoConfig; -import com.example.oauth.dto.KakaoInfoResponseDto; -import com.example.oauth.dto.KakaoUnlinkTarget; +import com.example.oauth.kakao.config.KakaoInfoConfig; +import com.example.oauth.kakao.dto.KakaoInfoResponseDto; +import com.example.oauth.kakao.dto.KakaoUnlinkTarget; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; import org.springframework.stereotype.Component; diff --git a/Infra/src/main/java/com/example/oauth/client/KakaoOauthClient.java b/Infra/src/main/java/com/example/oauth/kakao/client/KakaoOauthClient.java similarity index 82% rename from Infra/src/main/java/com/example/oauth/client/KakaoOauthClient.java rename to Infra/src/main/java/com/example/oauth/kakao/client/KakaoOauthClient.java index 12b4587..86b8d14 100644 --- a/Infra/src/main/java/com/example/oauth/client/KakaoOauthClient.java +++ b/Infra/src/main/java/com/example/oauth/kakao/client/KakaoOauthClient.java @@ -1,8 +1,8 @@ -package com.example.oauth.client; +package com.example.oauth.kakao.client; -import com.example.oauth.config.KakaoKauthConfig; -import com.example.oauth.dto.KakaoTokenResponse; -import com.example.oauth.dto.OIDCPublicKeysResponse; +import com.example.oauth.kakao.config.KakaoKauthConfig; +import com.example.oauth.kakao.dto.KakaoTokenResponse; +import com.example.oauth.kakao.dto.OIDCPublicKeysResponse; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.GetMapping; diff --git a/Infra/src/main/java/com/example/oauth/config/KakaoInfoConfig.java b/Infra/src/main/java/com/example/oauth/kakao/config/KakaoInfoConfig.java similarity index 93% rename from Infra/src/main/java/com/example/oauth/config/KakaoInfoConfig.java rename to Infra/src/main/java/com/example/oauth/kakao/config/KakaoInfoConfig.java index f348e48..04767ce 100644 --- a/Infra/src/main/java/com/example/oauth/config/KakaoInfoConfig.java +++ b/Infra/src/main/java/com/example/oauth/kakao/config/KakaoInfoConfig.java @@ -1,4 +1,4 @@ -package com.example.oauth.config; +package com.example.oauth.kakao.config; import feign.codec.Encoder; import feign.codec.ErrorDecoder; diff --git a/Infra/src/main/java/com/example/oauth/config/KakaoInfoErrorDecoder.java b/Infra/src/main/java/com/example/oauth/kakao/config/KakaoInfoErrorDecoder.java similarity index 96% rename from Infra/src/main/java/com/example/oauth/config/KakaoInfoErrorDecoder.java rename to Infra/src/main/java/com/example/oauth/kakao/config/KakaoInfoErrorDecoder.java index c9d0300..3027d12 100644 --- a/Infra/src/main/java/com/example/oauth/config/KakaoInfoErrorDecoder.java +++ b/Infra/src/main/java/com/example/oauth/kakao/config/KakaoInfoErrorDecoder.java @@ -1,4 +1,4 @@ -package com.example.oauth.config; +package com.example.oauth.kakao.config; import com.example.error.exception.ServerBadRequestException; import com.example.error.exception.ServerExpiredTokenException; diff --git a/Infra/src/main/java/com/example/oauth/config/KakaoKauthConfig.java b/Infra/src/main/java/com/example/oauth/kakao/config/KakaoKauthConfig.java similarity index 93% rename from Infra/src/main/java/com/example/oauth/config/KakaoKauthConfig.java rename to Infra/src/main/java/com/example/oauth/kakao/config/KakaoKauthConfig.java index 3e3444a..3aa0211 100644 --- a/Infra/src/main/java/com/example/oauth/config/KakaoKauthConfig.java +++ b/Infra/src/main/java/com/example/oauth/kakao/config/KakaoKauthConfig.java @@ -1,4 +1,4 @@ -package com.example.oauth.config; +package com.example.oauth.kakao.config; import feign.codec.Encoder; import feign.codec.ErrorDecoder; diff --git a/Infra/src/main/java/com/example/oauth/config/KakaoKauthErrorDecoder.java b/Infra/src/main/java/com/example/oauth/kakao/config/KakaoKauthErrorDecoder.java similarity index 81% rename from Infra/src/main/java/com/example/oauth/config/KakaoKauthErrorDecoder.java rename to Infra/src/main/java/com/example/oauth/kakao/config/KakaoKauthErrorDecoder.java index d5ef372..9182cfd 100644 --- a/Infra/src/main/java/com/example/oauth/config/KakaoKauthErrorDecoder.java +++ b/Infra/src/main/java/com/example/oauth/kakao/config/KakaoKauthErrorDecoder.java @@ -1,7 +1,7 @@ -package com.example.oauth.config; +package com.example.oauth.kakao.config; -import com.example.oauth.dto.KakaoKauthErrorResponse; -import com.example.oauth.exception.KakaoKauthErrorCode; +import com.example.oauth.kakao.dto.KakaoKauthErrorResponse; +import com.example.oauth.kakao.exception.KakaoKauthErrorCode; import feign.Response; import feign.codec.ErrorDecoder; diff --git a/Infra/src/main/java/com/example/oauth/dto/KakaoInfoResponseDto.java b/Infra/src/main/java/com/example/oauth/kakao/dto/KakaoInfoResponseDto.java similarity index 96% rename from Infra/src/main/java/com/example/oauth/dto/KakaoInfoResponseDto.java rename to Infra/src/main/java/com/example/oauth/kakao/dto/KakaoInfoResponseDto.java index e255cc8..1a8307a 100644 --- a/Infra/src/main/java/com/example/oauth/dto/KakaoInfoResponseDto.java +++ b/Infra/src/main/java/com/example/oauth/kakao/dto/KakaoInfoResponseDto.java @@ -1,4 +1,4 @@ -package com.example.oauth.dto; +package com.example.oauth.kakao.dto; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; diff --git a/Infra/src/main/java/com/example/oauth/dto/KakaoKauthErrorResponse.java b/Infra/src/main/java/com/example/oauth/kakao/dto/KakaoKauthErrorResponse.java similarity index 96% rename from Infra/src/main/java/com/example/oauth/dto/KakaoKauthErrorResponse.java rename to Infra/src/main/java/com/example/oauth/kakao/dto/KakaoKauthErrorResponse.java index 0f832d0..68860cb 100644 --- a/Infra/src/main/java/com/example/oauth/dto/KakaoKauthErrorResponse.java +++ b/Infra/src/main/java/com/example/oauth/kakao/dto/KakaoKauthErrorResponse.java @@ -1,4 +1,4 @@ -package com.example.oauth.dto; +package com.example.oauth.kakao.dto; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.PropertyNamingStrategies; diff --git a/Infra/src/main/java/com/example/oauth/dto/KakaoTokenResponse.java b/Infra/src/main/java/com/example/oauth/kakao/dto/KakaoTokenResponse.java similarity index 91% rename from Infra/src/main/java/com/example/oauth/dto/KakaoTokenResponse.java rename to Infra/src/main/java/com/example/oauth/kakao/dto/KakaoTokenResponse.java index af5045e..2d6dc79 100644 --- a/Infra/src/main/java/com/example/oauth/dto/KakaoTokenResponse.java +++ b/Infra/src/main/java/com/example/oauth/kakao/dto/KakaoTokenResponse.java @@ -1,4 +1,4 @@ -package com.example.oauth.dto; +package com.example.oauth.kakao.dto; import com.fasterxml.jackson.databind.PropertyNamingStrategies; diff --git a/Infra/src/main/java/com/example/oauth/dto/KakaoUnlinkTarget.java b/Infra/src/main/java/com/example/oauth/kakao/dto/KakaoUnlinkTarget.java similarity index 91% rename from Infra/src/main/java/com/example/oauth/dto/KakaoUnlinkTarget.java rename to Infra/src/main/java/com/example/oauth/kakao/dto/KakaoUnlinkTarget.java index 0daec50..130475e 100644 --- a/Infra/src/main/java/com/example/oauth/dto/KakaoUnlinkTarget.java +++ b/Infra/src/main/java/com/example/oauth/kakao/dto/KakaoUnlinkTarget.java @@ -1,4 +1,4 @@ -package com.example.oauth.dto; +package com.example.oauth.kakao.dto; import lombok.Getter; diff --git a/Infra/src/main/java/com/example/oauth/dto/OIDCPublicKeyDto.java b/Infra/src/main/java/com/example/oauth/kakao/dto/OIDCPublicKeyDto.java similarity index 86% rename from Infra/src/main/java/com/example/oauth/dto/OIDCPublicKeyDto.java rename to Infra/src/main/java/com/example/oauth/kakao/dto/OIDCPublicKeyDto.java index 750c545..b3237da 100644 --- a/Infra/src/main/java/com/example/oauth/dto/OIDCPublicKeyDto.java +++ b/Infra/src/main/java/com/example/oauth/kakao/dto/OIDCPublicKeyDto.java @@ -1,4 +1,4 @@ -package com.example.oauth.dto; +package com.example.oauth.kakao.dto; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/Infra/src/main/java/com/example/oauth/dto/OIDCPublicKeysResponse.java b/Infra/src/main/java/com/example/oauth/kakao/dto/OIDCPublicKeysResponse.java similarity index 83% rename from Infra/src/main/java/com/example/oauth/dto/OIDCPublicKeysResponse.java rename to Infra/src/main/java/com/example/oauth/kakao/dto/OIDCPublicKeysResponse.java index 43e1c39..583e3f5 100644 --- a/Infra/src/main/java/com/example/oauth/dto/OIDCPublicKeysResponse.java +++ b/Infra/src/main/java/com/example/oauth/kakao/dto/OIDCPublicKeysResponse.java @@ -1,4 +1,4 @@ -package com.example.oauth.dto; +package com.example.oauth.kakao.dto; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/Infra/src/main/java/com/example/oauth/exception/KakaoKauthErrorCode.java b/Infra/src/main/java/com/example/oauth/kakao/exception/KakaoKauthErrorCode.java similarity index 98% rename from Infra/src/main/java/com/example/oauth/exception/KakaoKauthErrorCode.java rename to Infra/src/main/java/com/example/oauth/kakao/exception/KakaoKauthErrorCode.java index 9c55180..af99507 100644 --- a/Infra/src/main/java/com/example/oauth/exception/KakaoKauthErrorCode.java +++ b/Infra/src/main/java/com/example/oauth/kakao/exception/KakaoKauthErrorCode.java @@ -1,4 +1,4 @@ -package com.example.oauth.exception; +package com.example.oauth.kakao.exception; import com.example.dto.ErrorReason; import com.example.error.BaseErrorCode; From cff8ca7dc624761cae31d7afaf21de701810a0f7 Mon Sep 17 00:00:00 2001 From: Hanbee Lee Date: Sat, 10 Feb 2024 17:57:38 +0900 Subject: [PATCH 4/5] =?UTF-8?q?refactor=20:=20screeningAdaptor=20=EB=A9=94?= =?UTF-8?q?=EC=84=9C=EB=93=9C=20UseCase=EB=A1=9C=20=EB=B0=94=EA=BE=B8?= =?UTF-8?q?=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Popcorn/controller/PopcornController.java | 8 ++--- ...onse.java => PopcornMyReviewResponse.java} | 8 ++--- .../service/GetPopcornReviewUseCase.java | 8 ++--- .../controller/ScreeningController.java | 28 ++++++++------- ...etBookmarkedUpcomingScreeningsUseCase.java | 19 ++++++++++ .../GetMostRecentScreeningUseCase.java | 18 ++++++++++ .../service/GetMostReviewedUseCase.java | 17 +++++++++ .../service/GetMyScreeningUseCase.java | 36 +++++++++++++++++++ .../service/GetScreeningUseCase.java | 11 +----- .../service/GetThisWeekScreeningsUseCase.java | 18 ++++++++++ .../service/PostReviewComplainUseCase.java | 16 +++++++++ ...iewUseCase.java => PostReviewUseCase.java} | 2 +- 12 files changed, 154 insertions(+), 35 deletions(-) rename Api/src/main/java/com/example/api/Popcorn/dto/response/{PopcornReviewMyResponse.java => PopcornMyReviewResponse.java} (85%) create mode 100644 Api/src/main/java/com/example/api/screening/service/GetBookmarkedUpcomingScreeningsUseCase.java create mode 100644 Api/src/main/java/com/example/api/screening/service/GetMostRecentScreeningUseCase.java create mode 100644 Api/src/main/java/com/example/api/screening/service/GetMostReviewedUseCase.java create mode 100644 Api/src/main/java/com/example/api/screening/service/GetMyScreeningUseCase.java create mode 100644 Api/src/main/java/com/example/api/screening/service/GetThisWeekScreeningsUseCase.java create mode 100644 Api/src/main/java/com/example/api/screening/service/PostReviewComplainUseCase.java rename Api/src/main/java/com/example/api/screening/service/{ReviewUseCase.java => PostReviewUseCase.java} (99%) diff --git a/Api/src/main/java/com/example/api/Popcorn/controller/PopcornController.java b/Api/src/main/java/com/example/api/Popcorn/controller/PopcornController.java index 0ae0ce0..4237c70 100644 --- a/Api/src/main/java/com/example/api/Popcorn/controller/PopcornController.java +++ b/Api/src/main/java/com/example/api/Popcorn/controller/PopcornController.java @@ -54,14 +54,14 @@ public PopcornReviewResponse reviewOnScreening(@PathVariable("popcornId") Long p //TODO 7: 팝콘작 팝콘지수 산출 로직 팝콘지수 GET @Operation(summary = "특정 팝콘작들에 대한 팝콘 지수", description = "popcornId 가져와서 요청하기") @GetMapping("/rate/{popcornId}") - public int popcornRate(@PathVariable("popcornId") Long popcornId) { + public int getPopcornRate(@PathVariable("popcornId") Long popcornId) { return getPopcornReviewUseCase.getRate(popcornId); } //TODO 팝콘작들에 대한 리뷰 반환 @Operation(summary = "팝콘작들에 대한 리뷰 반환", description = "popcornId 가져와서 요청하기") @GetMapping("/reviews/{popcornId}") - public List reviewResponseList(@PathVariable("popcornId") Long popcornId) { + public List getReviewResponseList(@PathVariable("popcornId") Long popcornId) { return getPopcornReviewUseCase.execute(popcornId); } @@ -76,14 +76,14 @@ public void reviewsFromPopcorn(@PathVariable("popcornUserId") Long popcornUserId //TODO 내가 쓴 팝콘작 리뷰 @Operation(summary = "팝콘작들에 대한 나의 리뷰 반환", description = "popcornId 가져와서 요청하기") @GetMapping("/my/reviews") - public List reviewMyResponseList() { + public List getReviewMyResponseList() { return getPopcornReviewUseCase.getMyReviews(); } //TODO 8: 팝콘 키워드 Top3 GET @Operation(summary = "팝콘 키워드 Top3 반환", description = "popcornId 가져와서 요청하기") @GetMapping("/top-keywords/{popcornId}") - public PopcornKeywordResponse reviewMyResponseList(@PathVariable("popcornId") Long popcornId){ + public PopcornKeywordResponse getTopPopcornKeywords(@PathVariable("popcornId") Long popcornId){ return getTopRatedPopcornKeyword.execute(popcornId); } } diff --git a/Api/src/main/java/com/example/api/Popcorn/dto/response/PopcornReviewMyResponse.java b/Api/src/main/java/com/example/api/Popcorn/dto/response/PopcornMyReviewResponse.java similarity index 85% rename from Api/src/main/java/com/example/api/Popcorn/dto/response/PopcornReviewMyResponse.java rename to Api/src/main/java/com/example/api/Popcorn/dto/response/PopcornMyReviewResponse.java index 8b08cf8..ad02cfe 100644 --- a/Api/src/main/java/com/example/api/Popcorn/dto/response/PopcornReviewMyResponse.java +++ b/Api/src/main/java/com/example/api/Popcorn/dto/response/PopcornMyReviewResponse.java @@ -9,7 +9,7 @@ import lombok.Getter; @Getter -public class PopcornReviewMyResponse { +public class PopcornMyReviewResponse { @Schema(defaultValue = "1", description = "유저 id") private Long userId; @Schema(defaultValue = "닉네임", description = "유저 닉네임") @@ -34,7 +34,7 @@ public class PopcornReviewMyResponse { private PopcornNegative popcornNegative; @Builder - public PopcornReviewMyResponse(Long userId,String nickName,int profileImgNum,Popcorn popcorn,boolean hasWatched, boolean beforeScreening, boolean afterScreening, String review, boolean hasAgreed, PopcornPositive popcornPositive, PopcornNegative popcornNegative) { + public PopcornMyReviewResponse(Long userId, String nickName, int profileImgNum, Popcorn popcorn, boolean hasWatched, boolean beforeScreening, boolean afterScreening, String review, boolean hasAgreed, PopcornPositive popcornPositive, PopcornNegative popcornNegative) { this.userId=userId; this.nickName=nickName; this.profileImgNum=profileImgNum; @@ -48,8 +48,8 @@ public PopcornReviewMyResponse(Long userId,String nickName,int profileImgNum,Pop this.popcornNegative = popcornNegative; } - public static PopcornReviewMyResponse from(PopcornUser popcornUser) { - return PopcornReviewMyResponse.builder() + public static PopcornMyReviewResponse from(PopcornUser popcornUser) { + return PopcornMyReviewResponse.builder() .userId(popcornUser.getUser().getId()) .nickName(popcornUser.getUser().getNickname()) .profileImgNum(popcornUser.getUser().getProfileImgNum()) diff --git a/Api/src/main/java/com/example/api/Popcorn/service/GetPopcornReviewUseCase.java b/Api/src/main/java/com/example/api/Popcorn/service/GetPopcornReviewUseCase.java index b39553e..25ce641 100644 --- a/Api/src/main/java/com/example/api/Popcorn/service/GetPopcornReviewUseCase.java +++ b/Api/src/main/java/com/example/api/Popcorn/service/GetPopcornReviewUseCase.java @@ -1,7 +1,7 @@ package com.example.api.Popcorn.service; import com.example.adaptor.UseCase; -import com.example.api.Popcorn.dto.response.PopcornReviewMyResponse; +import com.example.api.Popcorn.dto.response.PopcornMyReviewResponse; import com.example.api.Popcorn.dto.response.PopcornReviewResponse; import com.example.api.config.security.SecurityUtil; import com.example.domains.popcorn.adaptor.PopcornAdaptor; @@ -27,13 +27,13 @@ public List execute(Long popcornId) { return popcornReviewResponses; } - public List getMyReviews() { + public List getMyReviews() { Long userId = SecurityUtil.getCurrentUserId(); List popcornUserList = popcornUserAdaptor.findAllByUserId(userId); - List popcornReviewResponses = new ArrayList<>(); + List popcornReviewResponses = new ArrayList<>(); for (PopcornUser popcornUser : popcornUserList) { - final PopcornReviewMyResponse newPopcornReview = PopcornReviewMyResponse.from(popcornUser); + final PopcornMyReviewResponse newPopcornReview = PopcornMyReviewResponse.from(popcornUser); popcornReviewResponses.add(newPopcornReview); } return popcornReviewResponses; diff --git a/Api/src/main/java/com/example/api/screening/controller/ScreeningController.java b/Api/src/main/java/com/example/api/screening/controller/ScreeningController.java index 7471f9c..da7ba68 100644 --- a/Api/src/main/java/com/example/api/screening/controller/ScreeningController.java +++ b/Api/src/main/java/com/example/api/screening/controller/ScreeningController.java @@ -37,7 +37,7 @@ public class ScreeningController { private final GetRateCountUseCase getRateCountUseCase; private final ScreeningUploadUseCase screeningUploadUseCase; private final GetScreeningUseCase getScreeningUseCase; - private final ReviewUseCase reviewUseCase; + private final PostReviewUseCase postReviewUseCase; private final BookMarkScreeningUseCase bookMarkScreeningUseCase; private final GetScreeningListUseCase getScreeningListUseCase; private final GetScreeningReviewListUseCase getScreeningReviewListUseCase; @@ -50,6 +50,12 @@ public class ScreeningController { private final GetBookMarkedScreeningsUseCase getBookMarkedScreeningUseCase; private final GetPastScreeningListUseCase getPastScreeningListUseCase; private final GetScreeningStatisticsUseCase getScreeningStatisticsUseCase; + private final GetMyScreeningUseCase getMyScreeningUseCase; + private final GetMostReviewedUseCase getMostReviewedUseCase; + private final GetThisWeekScreeningsUseCase getThisWeekScreeningsUseCase; + private final GetMostRecentScreeningUseCase getMostRecentScreeningUseCase; + private final GetBookmarkedUpcomingScreeningsUseCase getBookmarkedUpcomingScreeningsUseCase; + private final PostReviewComplainUseCase postReviewComplainUseCase; // @Operation(description = "모임 대표 이미지") // @PostMapping(value = "/image", consumes = {MediaType.MULTIPART_FORM_DATA_VALUE, APPLICATION_JSON_VALUE}) @@ -112,7 +118,7 @@ public BookMarkResponse bookMarkScreening(@PathVariable("screeningId") Long scre @PostMapping("/review/{screeningId}") public void reviewOnScreening(@PathVariable("screeningId")Long screeningId, @RequestBody PostReviewRequest request) { - reviewUseCase.execute(screeningId,request); + postReviewUseCase.execute(screeningId,request); } @Operation(summary = "특정 스크리닝에 리뷰 리스트 가져오기", description = "screening id로 리뷰리스트 가져오기") @@ -134,7 +140,8 @@ public List getScreeningReviewList() { @Operation(summary = "나의 스크리닝 id별로 가져오기", description = "screening id가져와서 요청하기") @GetMapping("/myScreening/{screeningId}") public ScreeningResponse getMyScreening(@PathVariable("screeningId") Long screeningId) { - return getScreeningUseCase.getMyScreening(screeningId); + //getMyScreeningUseCase + return getMyScreeningUseCase.execute(screeningId); } @Operation(summary = "나의 스크리닝 비공개 on/off하기", description = "screening id가져와서 요청하기") @@ -182,16 +189,16 @@ public SliceResponse searchScreenings( //TODO 댓글 많은 수 Top3 반환- private0 - @Operation(summary = "댓글 많은 수 Top3 반환", description = "댓글 많은 수 Top3 반환") + @Operation(summary = "댓글 많은 수 Top3 반환", description = "좋아요 많은 수 Top3 반환") @GetMapping("/most-reviewed") public List getMostReviewed() { - return screeningAdaptor.getMostReviewed(); + return getMostReviewedUseCase.execute(); } @Operation(summary = "현재시점에서 이번주 상영작 3개 반환", description = "현재시점에서 다음주 상영작 3개 반환") @GetMapping("/upcoming-Screening") public List getTopThreeScreening() { - return screeningAdaptor.getTopThree(); + return getThisWeekScreeningsUseCase.execute(); } @@ -199,7 +206,7 @@ public List getTopThreeScreening() { @Operation(summary = "현재시점에서 가장 치근에 올라온 3개 반환", description = "현재시점에서 가장 치근에 올라온 3개 반환") @GetMapping("/recent-Screening") public List getRecentScreening() { - return screeningAdaptor.getMostRecentScreening(); + return getMostRecentScreeningUseCase.execute(); } //TODO 관람예정(찜하기 한 것 중에서 날짜 지난거) - private 0 @@ -211,16 +218,13 @@ public List getPassedScreenings() { //TODO 관람예정(찜하기 한 것 중에서 날짜 안지난거) -> try해봐야함() - private 0 @GetMapping("/screenings/upcoming") public List getPastScreenings() { - Long userId = SecurityUtil.getCurrentUserId(); - return screeningAdaptor.getUpcomingScreenings(userId); + return getBookmarkedUpcomingScreeningsUseCase.execute(); } //TODO duplicate 없애기 @PostMapping("/review/complain/{reviewId}") public void postReviewComplain(@RequestParam("reviewId") Long reviewId) { - - Long userId = SecurityUtil.getCurrentUserId(); - reviewAdaptor.postComplain(reviewId,userId); + postReviewComplainUseCase.execute(reviewId); } //TODO 스크리닝 장소, 운영, 감상 개수 pos, neg,스크리닝지수 마다 반환 (0) diff --git a/Api/src/main/java/com/example/api/screening/service/GetBookmarkedUpcomingScreeningsUseCase.java b/Api/src/main/java/com/example/api/screening/service/GetBookmarkedUpcomingScreeningsUseCase.java new file mode 100644 index 0000000..8758f60 --- /dev/null +++ b/Api/src/main/java/com/example/api/screening/service/GetBookmarkedUpcomingScreeningsUseCase.java @@ -0,0 +1,19 @@ +package com.example.api.screening.service; + +import com.example.adaptor.UseCase; +import com.example.api.config.security.SecurityUtil; +import com.example.domains.screening.adaptor.ScreeningAdaptor; +import com.example.domains.screening.entity.Screening; +import lombok.RequiredArgsConstructor; + +import java.util.List; + +@UseCase +@RequiredArgsConstructor +public class GetBookmarkedUpcomingScreeningsUseCase { + private final ScreeningAdaptor screeningAdaptor; + public List execute(){ + Long userId = SecurityUtil.getCurrentUserId(); + return screeningAdaptor.getUpcomingScreenings(userId); + } +} diff --git a/Api/src/main/java/com/example/api/screening/service/GetMostRecentScreeningUseCase.java b/Api/src/main/java/com/example/api/screening/service/GetMostRecentScreeningUseCase.java new file mode 100644 index 0000000..952049f --- /dev/null +++ b/Api/src/main/java/com/example/api/screening/service/GetMostRecentScreeningUseCase.java @@ -0,0 +1,18 @@ +package com.example.api.screening.service; + +import com.example.adaptor.UseCase; +import com.example.domains.screening.adaptor.ScreeningAdaptor; +import com.example.domains.screening.entity.dto.ScreeningResponseDto; +import lombok.RequiredArgsConstructor; + +import java.util.List; + +@UseCase +@RequiredArgsConstructor +public class GetMostRecentScreeningUseCase { + private final ScreeningAdaptor screeningAdaptor; + + public List execute(){ + return screeningAdaptor.getMostRecentScreening(); + } +} diff --git a/Api/src/main/java/com/example/api/screening/service/GetMostReviewedUseCase.java b/Api/src/main/java/com/example/api/screening/service/GetMostReviewedUseCase.java new file mode 100644 index 0000000..77879a2 --- /dev/null +++ b/Api/src/main/java/com/example/api/screening/service/GetMostReviewedUseCase.java @@ -0,0 +1,17 @@ +package com.example.api.screening.service; + +import com.example.adaptor.UseCase; +import com.example.domains.screening.adaptor.ScreeningAdaptor; +import com.example.domains.screening.entity.dto.ScreeningResponseDto; +import lombok.RequiredArgsConstructor; + +import java.util.List; + +@UseCase +@RequiredArgsConstructor +public class GetMostReviewedUseCase { + private final ScreeningAdaptor screeningAdaptor; + public List execute(){ + return screeningAdaptor.getMostReviewed(); + } +} diff --git a/Api/src/main/java/com/example/api/screening/service/GetMyScreeningUseCase.java b/Api/src/main/java/com/example/api/screening/service/GetMyScreeningUseCase.java new file mode 100644 index 0000000..10c1a1a --- /dev/null +++ b/Api/src/main/java/com/example/api/screening/service/GetMyScreeningUseCase.java @@ -0,0 +1,36 @@ +package com.example.api.screening.service; + +import com.example.adaptor.UseCase; +import com.example.api.config.security.SecurityUtil; +import com.example.api.screening.dto.response.ScreeningResponse; +import com.example.domains.screening.adaptor.ScreeningAdaptor; +import com.example.domains.screening.entity.Screening; +import com.example.domains.user.validator.UserValidator; +import com.example.domains.userscreening.adaptor.UserScreeningAdaptor; +import com.example.domains.userscreening.entity.UserScreening; +import com.example.domains.userscreening.exception.exceptions.UserScreeningIsNotHost; +import lombok.RequiredArgsConstructor; + +@UseCase +@RequiredArgsConstructor +public class GetMyScreeningUseCase { + private final UserValidator userValidator; + private final ScreeningAdaptor screeningAdaptor; + private final UserScreeningAdaptor userScreeningAdaptor; + + public ScreeningResponse execute(Long screeningId) { + Long userId = SecurityUtil.getCurrentUserId(); + validateExecution(userId); + UserScreening userScreening = userScreeningAdaptor.findByUserAndScreening(userId,screeningId); + Screening screening = screeningAdaptor.findById(screeningId); + if (!userScreening.isHost()) { + throw UserScreeningIsNotHost.EXCEPTION; + } + return ScreeningResponse.from(screening); + } + + private void validateExecution(Long userId) { + userValidator.validateUserStatusNormal(userId); + } + +} diff --git a/Api/src/main/java/com/example/api/screening/service/GetScreeningUseCase.java b/Api/src/main/java/com/example/api/screening/service/GetScreeningUseCase.java index f61f6d5..5f03cc0 100644 --- a/Api/src/main/java/com/example/api/screening/service/GetScreeningUseCase.java +++ b/Api/src/main/java/com/example/api/screening/service/GetScreeningUseCase.java @@ -53,14 +53,5 @@ private void validateExecution(Long userId) { userValidator.validateUserStatusNormal(userId); } - public ScreeningResponse getMyScreening(Long screeningId) { - Long userId = SecurityUtil.getCurrentUserId(); - validateExecution(userId); - UserScreening userScreening = userScreeningAdaptor.findByUserAndScreening(userId,screeningId); - Screening screening = screeningAdaptor.findById(screeningId); - if (!userScreening.isHost()) { - throw UserScreeningIsNotHost.EXCEPTION; - } - return ScreeningResponse.from(screening); - } + } diff --git a/Api/src/main/java/com/example/api/screening/service/GetThisWeekScreeningsUseCase.java b/Api/src/main/java/com/example/api/screening/service/GetThisWeekScreeningsUseCase.java new file mode 100644 index 0000000..f7061c0 --- /dev/null +++ b/Api/src/main/java/com/example/api/screening/service/GetThisWeekScreeningsUseCase.java @@ -0,0 +1,18 @@ +package com.example.api.screening.service; + +import com.example.adaptor.UseCase; +import com.example.domains.screening.adaptor.ScreeningAdaptor; +import com.example.domains.screening.entity.dto.ScreeningResponseDto; +import lombok.RequiredArgsConstructor; + +import java.util.List; + +@UseCase +@RequiredArgsConstructor +public class GetThisWeekScreeningsUseCase { + private final ScreeningAdaptor screeningAdaptor; + + public List execute(){ + return screeningAdaptor.getTopThree(); + } +} diff --git a/Api/src/main/java/com/example/api/screening/service/PostReviewComplainUseCase.java b/Api/src/main/java/com/example/api/screening/service/PostReviewComplainUseCase.java new file mode 100644 index 0000000..e65c050 --- /dev/null +++ b/Api/src/main/java/com/example/api/screening/service/PostReviewComplainUseCase.java @@ -0,0 +1,16 @@ +package com.example.api.screening.service; + +import com.example.adaptor.UseCase; +import com.example.api.config.security.SecurityUtil; +import com.example.domains.screeningReview.adaptor.ReviewAdaptor; +import lombok.RequiredArgsConstructor; + +@UseCase +@RequiredArgsConstructor +public class PostReviewComplainUseCase { + private final ReviewAdaptor reviewAdaptor; + public void execute(Long reviewId) { + Long userId = SecurityUtil.getCurrentUserId(); + reviewAdaptor.postComplain(reviewId,userId); + } +} diff --git a/Api/src/main/java/com/example/api/screening/service/ReviewUseCase.java b/Api/src/main/java/com/example/api/screening/service/PostReviewUseCase.java similarity index 99% rename from Api/src/main/java/com/example/api/screening/service/ReviewUseCase.java rename to Api/src/main/java/com/example/api/screening/service/PostReviewUseCase.java index 93baaa8..4a78c3f 100644 --- a/Api/src/main/java/com/example/api/screening/service/ReviewUseCase.java +++ b/Api/src/main/java/com/example/api/screening/service/PostReviewUseCase.java @@ -23,7 +23,7 @@ @UseCase @RequiredArgsConstructor -public class ReviewUseCase { +public class PostReviewUseCase { private final UserValidator userValidator; private final ReviewValidator reviewValidator; From 4ce77e32454a74ed50633fdabe461fb4b07e067a Mon Sep 17 00:00:00 2001 From: Hanbee Lee Date: Sat, 10 Feb 2024 18:15:02 +0900 Subject: [PATCH 5/5] =?UTF-8?q?fix:=20popcorn=20Schedule=20=EC=8B=9C?= =?UTF-8?q?=EA=B0=84=EB=8C=80=20=EB=B3=80=EA=B2=BD=20=EC=9B=94=20->=20?= =?UTF-8?q?=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/example/domains/popcorn/adaptor/PopcornAdaptor.java | 5 ++++- .../example/domains/popcorn/schedule/PopcornSchedule.java | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Domain/src/main/java/com/example/domains/popcorn/adaptor/PopcornAdaptor.java b/Domain/src/main/java/com/example/domains/popcorn/adaptor/PopcornAdaptor.java index f56ba20..19f04f0 100644 --- a/Domain/src/main/java/com/example/domains/popcorn/adaptor/PopcornAdaptor.java +++ b/Domain/src/main/java/com/example/domains/popcorn/adaptor/PopcornAdaptor.java @@ -13,6 +13,7 @@ import lombok.RequiredArgsConstructor; import org.springframework.transaction.annotation.Transactional; +import java.time.DayOfWeek; import java.time.LocalDate; import java.time.LocalDateTime; import java.util.List; @@ -28,6 +29,8 @@ public class PopcornAdaptor { private static LocalDate today = LocalDate.now(); private static LocalDate startOfLastWeek = today.minusDays(today.getDayOfWeek().getValue() + 6); // 지난 주의 월요일 private static LocalDate endOfLastWeek = startOfLastWeek.plusDays(6); // 지난 주의 일요일 + private static LocalDate startOfThisWeek = today.with(DayOfWeek.MONDAY); + private static LocalDate endOfThisWeek = today.with(DayOfWeek.SATURDAY); @Transactional public void save(Popcorn popcorn){ @@ -53,7 +56,7 @@ public List findTopThree() { return jpaQueryFactory .selectFrom(recommendedPopcorn) - .where(recommendedPopcorn.createdAt.between(startOfLastWeek.atStartOfDay(), endOfLastWeek.atTime(23, 59, 59))) + .where(recommendedPopcorn.createdAt.between(startOfThisWeek.atStartOfDay(), endOfThisWeek.atTime(23, 59, 59))) .orderBy( recommendedPopcorn.recommendationCount.desc(), recommendedPopcorn.createdAt.desc() diff --git a/Domain/src/main/java/com/example/domains/popcorn/schedule/PopcornSchedule.java b/Domain/src/main/java/com/example/domains/popcorn/schedule/PopcornSchedule.java index 0e72548..f8beaa8 100644 --- a/Domain/src/main/java/com/example/domains/popcorn/schedule/PopcornSchedule.java +++ b/Domain/src/main/java/com/example/domains/popcorn/schedule/PopcornSchedule.java @@ -11,7 +11,7 @@ public class PopcornSchedule { private final PopcornService popcornService; // 매 주 일요일 0시 0분에 실행되도록 cron 설정-ㄱㄷ미 - @Scheduled(cron = "0 0 0 * * MON") + @Scheduled(cron = "0 0 0 * * SUN") public void scheduledMethod() { popcornService.getTopRecommended(); System.out.println("매 주 일요일에 실행되는 작업");