From ce292aed8bfd9da6348e5d22d2f6bac68addcb79 Mon Sep 17 00:00:00 2001 From: mingmingmon Date: Thu, 26 Dec 2024 20:54:16 +0900 Subject: [PATCH] =?UTF-8?q?refactor(convention):=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EC=BB=A8=EB=B2=A4=EC=85=98=20=EC=A4=80=EC=88=98=ED=95=98?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20import=EB=AC=B8=20=EC=9E=90=EB=8F=99=20?= =?UTF-8?q?=EC=A0=95=EB=A0=AC=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../in/web/HotBoardsRetrievalController.java | 3 +-- .../out/persistence/BoardPersistenceAdapter.java | 7 +++---- .../RedisHotBoardPersistenceAdapter.java | 7 +++---- .../application/dto/mapper/BoardDtoMapper.java | 1 - .../port/in/RetrieveHotBoardsUseCase.java | 3 +-- .../application/port/out/RetrieveBoardPort.java | 5 ++--- .../service/DefaultHotBoardSelectionStrategy.java | 13 ++++++------- .../service/HotBoardRegisterService.java | 5 ++--- .../service/HotBoardRetrievalService.java | 5 ++--- .../service/HotBoardSelectionStrategy.java | 3 +-- .../application/dto/request/HashtagRequestDto.java | 2 -- .../dto/response/HashtagResponseDto.java | 1 - 12 files changed, 21 insertions(+), 34 deletions(-) diff --git a/src/main/java/page/clab/api/domain/community/board/adapter/in/web/HotBoardsRetrievalController.java b/src/main/java/page/clab/api/domain/community/board/adapter/in/web/HotBoardsRetrievalController.java index 5236643cd..148b5ef9a 100644 --- a/src/main/java/page/clab/api/domain/community/board/adapter/in/web/HotBoardsRetrievalController.java +++ b/src/main/java/page/clab/api/domain/community/board/adapter/in/web/HotBoardsRetrievalController.java @@ -2,6 +2,7 @@ import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; +import java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.GetMapping; @@ -12,8 +13,6 @@ import page.clab.api.domain.community.board.application.port.in.RetrieveHotBoardsUseCase; import page.clab.api.global.common.dto.ApiResponse; -import java.util.List; - @RestController @RequestMapping("/api/v1/boards") @RequiredArgsConstructor diff --git a/src/main/java/page/clab/api/domain/community/board/adapter/out/persistence/BoardPersistenceAdapter.java b/src/main/java/page/clab/api/domain/community/board/adapter/out/persistence/BoardPersistenceAdapter.java index 9b8602ed3..502865f7d 100644 --- a/src/main/java/page/clab/api/domain/community/board/adapter/out/persistence/BoardPersistenceAdapter.java +++ b/src/main/java/page/clab/api/domain/community/board/adapter/out/persistence/BoardPersistenceAdapter.java @@ -1,5 +1,8 @@ package page.clab.api.domain.community.board.adapter.out.persistence; +import java.time.LocalDateTime; +import java.util.List; +import java.util.stream.Collectors; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; @@ -10,10 +13,6 @@ import page.clab.api.domain.community.board.domain.BoardCategory; import page.clab.api.global.exception.NotFoundException; -import java.time.LocalDateTime; -import java.util.List; -import java.util.stream.Collectors; - @Component @RequiredArgsConstructor public class BoardPersistenceAdapter implements diff --git a/src/main/java/page/clab/api/domain/community/board/adapter/out/persistence/RedisHotBoardPersistenceAdapter.java b/src/main/java/page/clab/api/domain/community/board/adapter/out/persistence/RedisHotBoardPersistenceAdapter.java index 3ff92cf92..2e1c45622 100644 --- a/src/main/java/page/clab/api/domain/community/board/adapter/out/persistence/RedisHotBoardPersistenceAdapter.java +++ b/src/main/java/page/clab/api/domain/community/board/adapter/out/persistence/RedisHotBoardPersistenceAdapter.java @@ -1,5 +1,8 @@ package page.clab.api.domain.community.board.adapter.out.persistence; +import java.util.List; +import java.util.Objects; +import java.util.Set; import lombok.RequiredArgsConstructor; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Component; @@ -7,10 +10,6 @@ import page.clab.api.domain.community.board.application.port.out.RemoveHotBoardPort; import page.clab.api.domain.community.board.application.port.out.RetrieveHotBoardPort; -import java.util.List; -import java.util.Objects; -import java.util.Set; - @Component @RequiredArgsConstructor public class RedisHotBoardPersistenceAdapter implements diff --git a/src/main/java/page/clab/api/domain/community/board/application/dto/mapper/BoardDtoMapper.java b/src/main/java/page/clab/api/domain/community/board/application/dto/mapper/BoardDtoMapper.java index 0ed4eae3e..33a546928 100644 --- a/src/main/java/page/clab/api/domain/community/board/application/dto/mapper/BoardDtoMapper.java +++ b/src/main/java/page/clab/api/domain/community/board/application/dto/mapper/BoardDtoMapper.java @@ -7,7 +7,6 @@ import page.clab.api.domain.community.board.application.dto.response.BoardDetailsResponseDto; import page.clab.api.domain.community.board.application.dto.response.BoardEmojiCountResponseDto; import page.clab.api.domain.community.board.application.dto.response.BoardHashtagResponseDto; -import page.clab.api.domain.community.board.application.dto.response.BoardEmojiToggleResponseDto; import page.clab.api.domain.community.board.application.dto.response.BoardListResponseDto; import page.clab.api.domain.community.board.application.dto.response.BoardMyResponseDto; import page.clab.api.domain.community.board.application.dto.response.BoardOverviewResponseDto; diff --git a/src/main/java/page/clab/api/domain/community/board/application/port/in/RetrieveHotBoardsUseCase.java b/src/main/java/page/clab/api/domain/community/board/application/port/in/RetrieveHotBoardsUseCase.java index 11da513c5..cf6d3f91a 100644 --- a/src/main/java/page/clab/api/domain/community/board/application/port/in/RetrieveHotBoardsUseCase.java +++ b/src/main/java/page/clab/api/domain/community/board/application/port/in/RetrieveHotBoardsUseCase.java @@ -1,8 +1,7 @@ package page.clab.api.domain.community.board.application.port.in; -import page.clab.api.domain.community.board.application.dto.response.BoardListResponseDto; - import java.util.List; +import page.clab.api.domain.community.board.application.dto.response.BoardListResponseDto; public interface RetrieveHotBoardsUseCase { List retrieveHotBoards(String strategyName); diff --git a/src/main/java/page/clab/api/domain/community/board/application/port/out/RetrieveBoardPort.java b/src/main/java/page/clab/api/domain/community/board/application/port/out/RetrieveBoardPort.java index 5e42bcc25..e9d5741d3 100644 --- a/src/main/java/page/clab/api/domain/community/board/application/port/out/RetrieveBoardPort.java +++ b/src/main/java/page/clab/api/domain/community/board/application/port/out/RetrieveBoardPort.java @@ -1,13 +1,12 @@ package page.clab.api.domain.community.board.application.port.out; +import java.time.LocalDateTime; +import java.util.List; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import page.clab.api.domain.community.board.domain.Board; import page.clab.api.domain.community.board.domain.BoardCategory; -import java.time.LocalDateTime; -import java.util.List; - public interface RetrieveBoardPort { Board getById(Long boardId); diff --git a/src/main/java/page/clab/api/domain/community/board/application/service/DefaultHotBoardSelectionStrategy.java b/src/main/java/page/clab/api/domain/community/board/application/service/DefaultHotBoardSelectionStrategy.java index b31a4f1c3..00d33bc04 100644 --- a/src/main/java/page/clab/api/domain/community/board/application/service/DefaultHotBoardSelectionStrategy.java +++ b/src/main/java/page/clab/api/domain/community/board/application/service/DefaultHotBoardSelectionStrategy.java @@ -1,5 +1,11 @@ package page.clab.api.domain.community.board.application.service; +import java.time.DayOfWeek; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.Comparator; +import java.util.List; +import java.util.stream.Collectors; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -8,13 +14,6 @@ import page.clab.api.domain.community.board.domain.Board; import page.clab.api.external.community.comment.application.port.ExternalRetrieveCommentUseCase; -import java.time.DayOfWeek; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.util.Comparator; -import java.util.List; -import java.util.stream.Collectors; - @Service(HotBoardSelectionStrategies.DEFAULT) @RequiredArgsConstructor public class DefaultHotBoardSelectionStrategy implements HotBoardSelectionStrategy { diff --git a/src/main/java/page/clab/api/domain/community/board/application/service/HotBoardRegisterService.java b/src/main/java/page/clab/api/domain/community/board/application/service/HotBoardRegisterService.java index 462ef38dc..b810954ac 100644 --- a/src/main/java/page/clab/api/domain/community/board/application/service/HotBoardRegisterService.java +++ b/src/main/java/page/clab/api/domain/community/board/application/service/HotBoardRegisterService.java @@ -1,5 +1,7 @@ package page.clab.api.domain.community.board.application.service; +import java.util.List; +import java.util.Map; import lombok.RequiredArgsConstructor; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; @@ -8,9 +10,6 @@ import page.clab.api.domain.community.board.application.port.out.RemoveHotBoardPort; import page.clab.api.domain.community.board.domain.Board; -import java.util.List; -import java.util.Map; - @Service @RequiredArgsConstructor public class HotBoardRegisterService { diff --git a/src/main/java/page/clab/api/domain/community/board/application/service/HotBoardRetrievalService.java b/src/main/java/page/clab/api/domain/community/board/application/service/HotBoardRetrievalService.java index 0aa370a62..ade6b8845 100644 --- a/src/main/java/page/clab/api/domain/community/board/application/service/HotBoardRetrievalService.java +++ b/src/main/java/page/clab/api/domain/community/board/application/service/HotBoardRetrievalService.java @@ -2,6 +2,8 @@ import com.drew.lang.annotations.NotNull; import jakarta.transaction.Transactional; +import java.util.List; +import java.util.Map; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import page.clab.api.domain.community.board.application.dto.mapper.BoardDtoMapper; @@ -15,9 +17,6 @@ import page.clab.api.external.community.comment.application.port.ExternalRetrieveCommentUseCase; import page.clab.api.external.memberManagement.member.application.port.ExternalRetrieveMemberUseCase; -import java.util.List; -import java.util.Map; - @Service @RequiredArgsConstructor public class HotBoardRetrievalService implements RetrieveHotBoardsUseCase { diff --git a/src/main/java/page/clab/api/domain/community/board/application/service/HotBoardSelectionStrategy.java b/src/main/java/page/clab/api/domain/community/board/application/service/HotBoardSelectionStrategy.java index 6a2d4a5c9..f15f70d43 100644 --- a/src/main/java/page/clab/api/domain/community/board/application/service/HotBoardSelectionStrategy.java +++ b/src/main/java/page/clab/api/domain/community/board/application/service/HotBoardSelectionStrategy.java @@ -1,8 +1,7 @@ package page.clab.api.domain.community.board.application.service; -import page.clab.api.domain.community.board.domain.Board; - import java.util.List; +import page.clab.api.domain.community.board.domain.Board; public interface HotBoardSelectionStrategy { List getHotBoards(); diff --git a/src/main/java/page/clab/api/domain/community/hashtag/application/dto/request/HashtagRequestDto.java b/src/main/java/page/clab/api/domain/community/hashtag/application/dto/request/HashtagRequestDto.java index 60dcde0fc..d83330082 100644 --- a/src/main/java/page/clab/api/domain/community/hashtag/application/dto/request/HashtagRequestDto.java +++ b/src/main/java/page/clab/api/domain/community/hashtag/application/dto/request/HashtagRequestDto.java @@ -1,7 +1,5 @@ package page.clab.api.domain.community.hashtag.application.dto.request; -import java.util.ArrayList; -import java.util.List; import lombok.Getter; import lombok.Setter; import page.clab.api.domain.community.hashtag.domain.HashtagCategory; diff --git a/src/main/java/page/clab/api/domain/community/hashtag/application/dto/response/HashtagResponseDto.java b/src/main/java/page/clab/api/domain/community/hashtag/application/dto/response/HashtagResponseDto.java index 808eca682..c7c9cb10b 100644 --- a/src/main/java/page/clab/api/domain/community/hashtag/application/dto/response/HashtagResponseDto.java +++ b/src/main/java/page/clab/api/domain/community/hashtag/application/dto/response/HashtagResponseDto.java @@ -2,7 +2,6 @@ import lombok.Builder; import lombok.Getter; -import page.clab.api.domain.community.hashtag.domain.HashtagCategory; @Getter @Builder