From f4b08a131322d7364c3696051921843f6e9f9df3 Mon Sep 17 00:00:00 2001 From: wjdtkdgns Date: Wed, 26 Jul 2023 21:35:49 +0900 Subject: [PATCH] =?UTF-8?q?[chore]=20spotless=20=EC=A0=81=EC=9A=A9=20#63?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/search/controller/SearchController.java | 1 - .../dto/request/DeleteLatestSearchRequest.java | 4 ++-- .../search/service/DeleteLatestSearchUseCase.java | 4 +--- .../service/GetRelativeSearchListUseCase.java | 1 - .../api/search/service/SearchArchivingUseCase.java | 12 ++++++------ .../archiving/adaptor/ArchivingAdaptor.java | 7 +++++-- .../repository/ArchivingCustomRepository.java | 7 +++++-- .../repository/ArchivingCustomRepositoryImpl.java | 13 ++++++++++--- .../ContentTagGroupCustomRepository.java | 1 - .../ContentTagGroupCustomRepositoryImpl.java | 2 +- .../search/adaptor/LatestSearchAdaptor.java | 1 - .../search/repository/LatestSearchRepository.java | 1 - .../search/service/LatestSearchDomainService.java | 3 +-- .../search/validator/LatestSearchValidator.java | 14 +++++++------- 14 files changed, 38 insertions(+), 33 deletions(-) diff --git a/Api/src/main/java/allchive/server/api/search/controller/SearchController.java b/Api/src/main/java/allchive/server/api/search/controller/SearchController.java index a474bc4e..3f74037f 100644 --- a/Api/src/main/java/allchive/server/api/search/controller/SearchController.java +++ b/Api/src/main/java/allchive/server/api/search/controller/SearchController.java @@ -2,7 +2,6 @@ import allchive.server.api.search.model.dto.request.DeleteLatestSearchRequest; -import allchive.server.api.search.model.dto.request.SearchRequest; import allchive.server.api.search.model.dto.response.SearchListResponse; import allchive.server.api.search.model.dto.response.SearchResponse; import allchive.server.api.search.model.dto.response.SearchVoListResponse; diff --git a/Api/src/main/java/allchive/server/api/search/model/dto/request/DeleteLatestSearchRequest.java b/Api/src/main/java/allchive/server/api/search/model/dto/request/DeleteLatestSearchRequest.java index 38af1f5e..c7c3b55d 100644 --- a/Api/src/main/java/allchive/server/api/search/model/dto/request/DeleteLatestSearchRequest.java +++ b/Api/src/main/java/allchive/server/api/search/model/dto/request/DeleteLatestSearchRequest.java @@ -1,9 +1,9 @@ package allchive.server.api.search.model.dto.request; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.List; +import lombok.Getter; @Getter public class DeleteLatestSearchRequest { diff --git a/Api/src/main/java/allchive/server/api/search/service/DeleteLatestSearchUseCase.java b/Api/src/main/java/allchive/server/api/search/service/DeleteLatestSearchUseCase.java index 6a4b04d2..9637d8b5 100644 --- a/Api/src/main/java/allchive/server/api/search/service/DeleteLatestSearchUseCase.java +++ b/Api/src/main/java/allchive/server/api/search/service/DeleteLatestSearchUseCase.java @@ -4,14 +4,12 @@ import allchive.server.api.config.security.SecurityUtil; import allchive.server.api.search.model.dto.request.DeleteLatestSearchRequest; import allchive.server.core.annotation.UseCase; -import allchive.server.domain.domains.search.adaptor.LatestSearchAdaptor; import allchive.server.domain.domains.search.service.LatestSearchDomainService; import allchive.server.domain.domains.search.validator.LatestSearchValidator; +import java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.transaction.annotation.Transactional; -import java.util.List; - @UseCase @RequiredArgsConstructor public class DeleteLatestSearchUseCase { diff --git a/Api/src/main/java/allchive/server/api/search/service/GetRelativeSearchListUseCase.java b/Api/src/main/java/allchive/server/api/search/service/GetRelativeSearchListUseCase.java index a5745048..d1d3f681 100644 --- a/Api/src/main/java/allchive/server/api/search/service/GetRelativeSearchListUseCase.java +++ b/Api/src/main/java/allchive/server/api/search/service/GetRelativeSearchListUseCase.java @@ -3,7 +3,6 @@ import static allchive.server.core.consts.AllchiveConst.SEARCH_KEY; import static jodd.util.StringPool.ASTERISK; -import allchive.server.api.search.model.dto.request.SearchRequest; import allchive.server.api.search.model.dto.response.SearchListResponse; import allchive.server.core.annotation.UseCase; import java.util.ArrayList; diff --git a/Api/src/main/java/allchive/server/api/search/service/SearchArchivingUseCase.java b/Api/src/main/java/allchive/server/api/search/service/SearchArchivingUseCase.java index cb13e0ba..bb0c88b6 100644 --- a/Api/src/main/java/allchive/server/api/search/service/SearchArchivingUseCase.java +++ b/Api/src/main/java/allchive/server/api/search/service/SearchArchivingUseCase.java @@ -21,15 +21,12 @@ import java.util.List; import java.util.Set; import java.util.stream.Collectors; - import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Slice; import org.springframework.transaction.annotation.Transactional; @UseCase -@Slf4j @RequiredArgsConstructor public class SearchArchivingUseCase { private final ArchivingAdaptor archivingAdaptor; @@ -67,7 +64,6 @@ public SearchResponse execute(Pageable pageable, ArchivingType type, String word private Set getTagArchivingIds(Long userId, String word) { List tags = tagAdaptor.findAllByUserIdAndName(userId, word); - tags.forEach(tag -> log.info(tag.getName())); return contentTagGroupAdaptor.queryContentTagGroupByTagInWithContent(tags).stream() .map(contentTagGroup -> contentTagGroup.getContent().getArchivingId()) .collect(Collectors.toSet()); @@ -85,14 +81,18 @@ private void renewalLatestSearch(Long userId, String keyword) { } private boolean isExistSearchKeyword(List searches, String keyword) { - return !searches.stream().filter(search -> search.getKeyword().equals(keyword)).toList().isEmpty(); + return !searches.stream() + .filter(search -> search.getKeyword().equals(keyword)) + .toList() + .isEmpty(); } private SliceResponse getMyArchivings( Long userId, String keyword, Pageable pageable, Set tagArchivingIds) { Slice archivingSlices = archivingAdaptor - .querySliceArchivingByUserIdAndKeywordsOrderByTagArchvingIds(userId, keyword, pageable, tagArchivingIds) + .querySliceArchivingByUserIdAndKeywordsOrderByTagArchvingIds( + userId, keyword, pageable, tagArchivingIds) .map(archiving -> ArchivingResponse.of(archiving, Boolean.FALSE)); return SliceResponse.of(archivingSlices); } diff --git a/Domain/src/main/java/allchive/server/domain/domains/archiving/adaptor/ArchivingAdaptor.java b/Domain/src/main/java/allchive/server/domain/domains/archiving/adaptor/ArchivingAdaptor.java index 1deab4d0..c887e32f 100644 --- a/Domain/src/main/java/allchive/server/domain/domains/archiving/adaptor/ArchivingAdaptor.java +++ b/Domain/src/main/java/allchive/server/domain/domains/archiving/adaptor/ArchivingAdaptor.java @@ -9,7 +9,6 @@ import allchive.server.domain.domains.archiving.repository.ArchivingRepository; import java.util.List; import java.util.Set; - import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Slice; @@ -82,7 +81,11 @@ public Slice querySliceArchivingByUserIdAndKeywordsOrderByTagArchving } public Slice querySliceArchivingByKeywordExceptBlockOrderByTagArchvingIds( - List archivingIdList, List blockList, String keyword, Pageable pageable, Set tagArchivingIds) { + List archivingIdList, + List blockList, + String keyword, + Pageable pageable, + Set tagArchivingIds) { return archivingRepository.querySliceArchivingByKeywordExceptBlockOrderByTagArchvingIds( archivingIdList, blockList, keyword, pageable, tagArchivingIds); } diff --git a/Domain/src/main/java/allchive/server/domain/domains/archiving/repository/ArchivingCustomRepository.java b/Domain/src/main/java/allchive/server/domain/domains/archiving/repository/ArchivingCustomRepository.java index 4325d0f7..db4b6c53 100644 --- a/Domain/src/main/java/allchive/server/domain/domains/archiving/repository/ArchivingCustomRepository.java +++ b/Domain/src/main/java/allchive/server/domain/domains/archiving/repository/ArchivingCustomRepository.java @@ -5,7 +5,6 @@ import allchive.server.domain.domains.archiving.domain.enums.Category; import java.util.List; import java.util.Set; - import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Slice; @@ -26,5 +25,9 @@ Slice querySliceArchivingByUserIdAndKeywordsOrderByTagArchvingIds( Long userId, String keyword, Pageable pageable, Set tagArchivingIds); Slice querySliceArchivingByKeywordExceptBlockOrderByTagArchvingIds( - List archivingIdList, List blockList, String keyword, Pageable pageable, Set tagArchivingIds); + List archivingIdList, + List blockList, + String keyword, + Pageable pageable, + Set tagArchivingIds); } diff --git a/Domain/src/main/java/allchive/server/domain/domains/archiving/repository/ArchivingCustomRepositoryImpl.java b/Domain/src/main/java/allchive/server/domain/domains/archiving/repository/ArchivingCustomRepositoryImpl.java index 8be90463..f1d64d47 100644 --- a/Domain/src/main/java/allchive/server/domain/domains/archiving/repository/ArchivingCustomRepositoryImpl.java +++ b/Domain/src/main/java/allchive/server/domain/domains/archiving/repository/ArchivingCustomRepositoryImpl.java @@ -13,7 +13,6 @@ import java.time.LocalDateTime; import java.util.List; import java.util.Set; - import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Slice; @@ -110,7 +109,11 @@ public Slice querySliceArchivingByUserIdAndKeywordsOrderByTagArchving @Override public Slice querySliceArchivingByKeywordExceptBlockOrderByTagArchvingIds( - List archivingIdList, List blockList, String keyword, Pageable pageable, Set tagArchivingIds) { + List archivingIdList, + List blockList, + String keyword, + Pageable pageable, + Set tagArchivingIds) { List archivings = queryFactory .select(archiving) @@ -120,7 +123,11 @@ public Slice querySliceArchivingByKeywordExceptBlockOrderByTagArchvin publicStatusTrue(), deleteStatusFalse(), titleContainOrIdIn(keyword, tagArchivingIds)) - .orderBy(idIn(tagArchivingIds), scrabListDesc(archivingIdList), scrapCntDesc(), createdAtDesc()) + .orderBy( + idIn(tagArchivingIds), + scrabListDesc(archivingIdList), + scrapCntDesc(), + createdAtDesc()) .offset(pageable.getOffset()) .limit(pageable.getPageSize() + 1) .fetch(); diff --git a/Domain/src/main/java/allchive/server/domain/domains/content/repository/ContentTagGroupCustomRepository.java b/Domain/src/main/java/allchive/server/domain/domains/content/repository/ContentTagGroupCustomRepository.java index c645d684..05105f26 100644 --- a/Domain/src/main/java/allchive/server/domain/domains/content/repository/ContentTagGroupCustomRepository.java +++ b/Domain/src/main/java/allchive/server/domain/domains/content/repository/ContentTagGroupCustomRepository.java @@ -4,7 +4,6 @@ import allchive.server.domain.domains.content.domain.Content; import allchive.server.domain.domains.content.domain.ContentTagGroup; import allchive.server.domain.domains.content.domain.Tag; - import java.util.List; public interface ContentTagGroupCustomRepository { diff --git a/Domain/src/main/java/allchive/server/domain/domains/content/repository/ContentTagGroupCustomRepositoryImpl.java b/Domain/src/main/java/allchive/server/domain/domains/content/repository/ContentTagGroupCustomRepositoryImpl.java index 0bbfcca9..055f32ce 100644 --- a/Domain/src/main/java/allchive/server/domain/domains/content/repository/ContentTagGroupCustomRepositoryImpl.java +++ b/Domain/src/main/java/allchive/server/domain/domains/content/repository/ContentTagGroupCustomRepositoryImpl.java @@ -1,8 +1,8 @@ package allchive.server.domain.domains.content.repository; +import static allchive.server.domain.domains.content.domain.QContent.content; import static allchive.server.domain.domains.content.domain.QContentTagGroup.contentTagGroup; import static allchive.server.domain.domains.content.domain.QTag.tag; -import static allchive.server.domain.domains.content.domain.QContent.content; import allchive.server.domain.domains.content.domain.Content; import allchive.server.domain.domains.content.domain.ContentTagGroup; diff --git a/Domain/src/main/java/allchive/server/domain/domains/search/adaptor/LatestSearchAdaptor.java b/Domain/src/main/java/allchive/server/domain/domains/search/adaptor/LatestSearchAdaptor.java index 64da619b..4b0c6cee 100644 --- a/Domain/src/main/java/allchive/server/domain/domains/search/adaptor/LatestSearchAdaptor.java +++ b/Domain/src/main/java/allchive/server/domain/domains/search/adaptor/LatestSearchAdaptor.java @@ -3,7 +3,6 @@ import allchive.server.core.annotation.Adaptor; import allchive.server.domain.domains.search.domain.LatestSearch; -import allchive.server.domain.domains.search.exception.exceptions.LatestSearchNotFoundException; import allchive.server.domain.domains.search.repository.LatestSearchRepository; import java.util.List; import lombok.RequiredArgsConstructor; diff --git a/Domain/src/main/java/allchive/server/domain/domains/search/repository/LatestSearchRepository.java b/Domain/src/main/java/allchive/server/domain/domains/search/repository/LatestSearchRepository.java index e78a85da..27636cca 100644 --- a/Domain/src/main/java/allchive/server/domain/domains/search/repository/LatestSearchRepository.java +++ b/Domain/src/main/java/allchive/server/domain/domains/search/repository/LatestSearchRepository.java @@ -3,7 +3,6 @@ import allchive.server.domain.domains.search.domain.LatestSearch; import java.util.List; -import java.util.Optional; import org.springframework.data.jpa.repository.JpaRepository; public interface LatestSearchRepository extends JpaRepository { diff --git a/Domain/src/main/java/allchive/server/domain/domains/search/service/LatestSearchDomainService.java b/Domain/src/main/java/allchive/server/domain/domains/search/service/LatestSearchDomainService.java index 80de8b03..2de4ad1c 100644 --- a/Domain/src/main/java/allchive/server/domain/domains/search/service/LatestSearchDomainService.java +++ b/Domain/src/main/java/allchive/server/domain/domains/search/service/LatestSearchDomainService.java @@ -4,9 +4,8 @@ import allchive.server.core.annotation.DomainService; import allchive.server.domain.domains.search.adaptor.LatestSearchAdaptor; import allchive.server.domain.domains.search.domain.LatestSearch; -import lombok.RequiredArgsConstructor; - import java.util.List; +import lombok.RequiredArgsConstructor; @DomainService @RequiredArgsConstructor diff --git a/Domain/src/main/java/allchive/server/domain/domains/search/validator/LatestSearchValidator.java b/Domain/src/main/java/allchive/server/domain/domains/search/validator/LatestSearchValidator.java index 6d6ab446..4829967c 100644 --- a/Domain/src/main/java/allchive/server/domain/domains/search/validator/LatestSearchValidator.java +++ b/Domain/src/main/java/allchive/server/domain/domains/search/validator/LatestSearchValidator.java @@ -6,9 +6,8 @@ import allchive.server.domain.domains.search.domain.LatestSearch; import allchive.server.domain.domains.search.exception.exceptions.LatestSearchNotFoundException; import allchive.server.domain.domains.search.exception.exceptions.NoAuthorityUpdateLatestSearchException; -import lombok.RequiredArgsConstructor; - import java.util.List; +import lombok.RequiredArgsConstructor; @Validator @RequiredArgsConstructor @@ -24,10 +23,11 @@ public void validateExistByIdIn(List ids) { public void verifyUserByIdIn(List ids, Long userId) { List searches = latestSearchAdaptor.findAllByIdIn(ids); - searches.forEach(search -> { - if (!search.getUserId().equals(userId)) { - throw NoAuthorityUpdateLatestSearchException.EXCEPTION; - } - }); + searches.forEach( + search -> { + if (!search.getUserId().equals(userId)) { + throw NoAuthorityUpdateLatestSearchException.EXCEPTION; + } + }); } }