diff --git a/src/main/java/page/clab/api/external/community/board/application/port/ExternalRegisterBoardHashtagUseCase.java b/src/main/java/page/clab/api/domain/community/board/application/port/in/RegisterBoardHashtagUseCase.java similarity index 57% rename from src/main/java/page/clab/api/external/community/board/application/port/ExternalRegisterBoardHashtagUseCase.java rename to src/main/java/page/clab/api/domain/community/board/application/port/in/RegisterBoardHashtagUseCase.java index fb9cd2c4a..91b847645 100644 --- a/src/main/java/page/clab/api/external/community/board/application/port/ExternalRegisterBoardHashtagUseCase.java +++ b/src/main/java/page/clab/api/domain/community/board/application/port/in/RegisterBoardHashtagUseCase.java @@ -1,7 +1,7 @@ -package page.clab.api.external.community.board.application.port; +package page.clab.api.domain.community.board.application.port.in; import page.clab.api.domain.community.board.application.dto.request.BoardHashtagRequestDto; -public interface ExternalRegisterBoardHashtagUseCase { +public interface RegisterBoardHashtagUseCase { Long registerBoardHashtag(BoardHashtagRequestDto requestDto); } diff --git a/src/main/java/page/clab/api/external/community/board/application/port/ExternalRetrieveBoardHashtagUseCase.java b/src/main/java/page/clab/api/domain/community/board/application/port/in/RetrieveBoardHashtagUseCase.java similarity index 71% rename from src/main/java/page/clab/api/external/community/board/application/port/ExternalRetrieveBoardHashtagUseCase.java rename to src/main/java/page/clab/api/domain/community/board/application/port/in/RetrieveBoardHashtagUseCase.java index 1764ada44..1433b9188 100644 --- a/src/main/java/page/clab/api/external/community/board/application/port/ExternalRetrieveBoardHashtagUseCase.java +++ b/src/main/java/page/clab/api/domain/community/board/application/port/in/RetrieveBoardHashtagUseCase.java @@ -1,12 +1,10 @@ -package page.clab.api.external.community.board.application.port; +package page.clab.api.domain.community.board.application.port.in; import java.util.List; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; import page.clab.api.domain.community.board.application.dto.response.BoardHashtagResponseDto; import page.clab.api.domain.community.board.domain.BoardHashtag; -public interface ExternalRetrieveBoardHashtagUseCase { +public interface RetrieveBoardHashtagUseCase { List getBoardHashtagInfoByBoardId(Long boardId); List getAllByBoardId(Long boardId); diff --git a/src/main/java/page/clab/api/domain/community/board/application/service/BoardDetailsRetrievalService.java b/src/main/java/page/clab/api/domain/community/board/application/service/BoardDetailsRetrievalService.java index 4221b9e36..45fe333d1 100644 --- a/src/main/java/page/clab/api/domain/community/board/application/service/BoardDetailsRetrievalService.java +++ b/src/main/java/page/clab/api/domain/community/board/application/service/BoardDetailsRetrievalService.java @@ -4,9 +4,7 @@ import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import page.clab.api.domain.community.board.adapter.out.persistence.BoardHashtagJpaEntity; import page.clab.api.domain.community.board.application.dto.mapper.BoardDtoMapper; -import page.clab.api.domain.community.board.application.dto.mapper.BoardHashtagDtoMapper; 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; @@ -14,10 +12,7 @@ import page.clab.api.domain.community.board.application.port.out.RetrieveBoardEmojiPort; import page.clab.api.domain.community.board.application.port.out.RetrieveBoardPort; import page.clab.api.domain.community.board.domain.Board; -import page.clab.api.domain.community.board.domain.BoardHashtag; import page.clab.api.domain.memberManagement.member.application.dto.shared.MemberDetailedInfoDto; -import page.clab.api.external.community.board.application.service.ExternalBoardHashtagRetrieveService; -import page.clab.api.external.hashtag.application.port.ExternalRetrieveHashtagUseCase; import page.clab.api.external.memberManagement.member.application.port.ExternalRetrieveMemberUseCase; import java.util.List; @@ -30,7 +25,7 @@ public class BoardDetailsRetrievalService implements RetrieveBoardDetailsUseCase private final RetrieveBoardPort retrieveBoardPort; private final RetrieveBoardEmojiPort retrieveBoardEmojiPort; private final ExternalRetrieveMemberUseCase externalRetrieveMemberUseCase; - private final ExternalBoardHashtagRetrieveService externalBoardHashtagRetrieveService; + private final BoardHashtagRetrieveService boardHashtagRetrieveService; private final BoardDtoMapper boardDtoMapper; @Transactional @@ -41,7 +36,7 @@ public BoardDetailsResponseDto retrieveBoardDetails(Long boardId) { MemberDetailedInfoDto memberInfo = externalRetrieveMemberUseCase.getMemberDetailedInfoById(board.getMemberId()); boolean isOwner = board.isOwner(currentMemberInfo.getMemberId()); List emojiInfos = getBoardEmojiCountResponseDtoList(boardId, currentMemberInfo.getMemberId()); - List boardHashtagInfos = externalBoardHashtagRetrieveService.getBoardHashtagInfoByBoardId(boardId); + List boardHashtagInfos = boardHashtagRetrieveService.getBoardHashtagInfoByBoardId(boardId); return boardDtoMapper.toDto(board, memberInfo, isOwner, emojiInfos, boardHashtagInfos); } diff --git a/src/main/java/page/clab/api/external/community/board/application/service/ExternalBoardHashtagRegisterService.java b/src/main/java/page/clab/api/domain/community/board/application/service/BoardHashtagRegisterService.java similarity index 84% rename from src/main/java/page/clab/api/external/community/board/application/service/ExternalBoardHashtagRegisterService.java rename to src/main/java/page/clab/api/domain/community/board/application/service/BoardHashtagRegisterService.java index 354c1eacc..5ea65ef97 100644 --- a/src/main/java/page/clab/api/external/community/board/application/service/ExternalBoardHashtagRegisterService.java +++ b/src/main/java/page/clab/api/domain/community/board/application/service/BoardHashtagRegisterService.java @@ -1,11 +1,11 @@ -package page.clab.api.external.community.board.application.service; +package page.clab.api.domain.community.board.application.service; import jakarta.transaction.Transactional; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import page.clab.api.domain.community.board.application.dto.mapper.BoardHashtagDtoMapper; import page.clab.api.domain.community.board.application.dto.request.BoardHashtagRequestDto; -import page.clab.api.external.community.board.application.port.ExternalRegisterBoardHashtagUseCase; +import page.clab.api.domain.community.board.application.port.in.RegisterBoardHashtagUseCase; import page.clab.api.domain.community.board.application.port.out.RegisterBoardHashtagPort; import page.clab.api.domain.community.board.domain.BoardHashtag; import page.clab.api.external.hashtag.application.port.ExternalRetrieveHashtagUseCase; @@ -13,7 +13,7 @@ @Service @RequiredArgsConstructor -public class ExternalBoardHashtagRegisterService implements ExternalRegisterBoardHashtagUseCase { +public class BoardHashtagRegisterService implements RegisterBoardHashtagUseCase { private final RegisterBoardHashtagPort registerBoardHashtagPort; private final ExternalRetrieveHashtagUseCase externalRetrieveHashtagUseCase; diff --git a/src/main/java/page/clab/api/external/community/board/application/service/ExternalBoardHashtagRetrieveService.java b/src/main/java/page/clab/api/domain/community/board/application/service/BoardHashtagRetrieveService.java similarity index 86% rename from src/main/java/page/clab/api/external/community/board/application/service/ExternalBoardHashtagRetrieveService.java rename to src/main/java/page/clab/api/domain/community/board/application/service/BoardHashtagRetrieveService.java index 805c53580..df506f41f 100644 --- a/src/main/java/page/clab/api/external/community/board/application/service/ExternalBoardHashtagRetrieveService.java +++ b/src/main/java/page/clab/api/domain/community/board/application/service/BoardHashtagRetrieveService.java @@ -1,20 +1,19 @@ -package page.clab.api.external.community.board.application.service; +package page.clab.api.domain.community.board.application.service; import java.util.List; import java.util.stream.Collectors; import lombok.RequiredArgsConstructor; -import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import page.clab.api.domain.community.board.application.dto.mapper.BoardHashtagDtoMapper; import page.clab.api.domain.community.board.application.dto.response.BoardHashtagResponseDto; import page.clab.api.domain.community.board.application.port.out.RetrieveBoardHashtagPort; import page.clab.api.domain.community.board.domain.BoardHashtag; -import page.clab.api.external.community.board.application.port.ExternalRetrieveBoardHashtagUseCase; +import page.clab.api.domain.community.board.application.port.in.RetrieveBoardHashtagUseCase; import page.clab.api.external.hashtag.application.port.ExternalRetrieveHashtagUseCase; @Service @RequiredArgsConstructor -public class ExternalBoardHashtagRetrieveService implements ExternalRetrieveBoardHashtagUseCase { +public class BoardHashtagRetrieveService implements RetrieveBoardHashtagUseCase { private final RetrieveBoardHashtagPort retrieveBoardHashtagPort; private final ExternalRetrieveHashtagUseCase externalRetrieveHashtagUseCase; diff --git a/src/main/java/page/clab/api/domain/community/board/application/service/BoardRegisterService.java b/src/main/java/page/clab/api/domain/community/board/application/service/BoardRegisterService.java index 896a1d115..1719fdfa8 100644 --- a/src/main/java/page/clab/api/domain/community/board/application/service/BoardRegisterService.java +++ b/src/main/java/page/clab/api/domain/community/board/application/service/BoardRegisterService.java @@ -2,7 +2,6 @@ import java.util.List; import lombok.RequiredArgsConstructor; -import org.apache.coyote.BadRequestException; import org.springframework.context.ApplicationEventPublisher; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -14,7 +13,7 @@ import page.clab.api.domain.community.board.application.port.out.RegisterBoardPort; import page.clab.api.domain.community.board.domain.Board; import page.clab.api.domain.memberManagement.member.application.dto.shared.MemberDetailedInfoDto; -import page.clab.api.external.community.board.application.port.ExternalRegisterBoardHashtagUseCase; +import page.clab.api.domain.community.board.application.port.in.RegisterBoardHashtagUseCase; import page.clab.api.external.memberManagement.member.application.port.ExternalRetrieveMemberUseCase; import page.clab.api.external.memberManagement.notification.application.port.ExternalSendNotificationUseCase; import page.clab.api.global.common.file.application.UploadedFileService; @@ -31,7 +30,7 @@ public class BoardRegisterService implements RegisterBoardUseCase { private final RegisterBoardPort registerBoardPort; private final ExternalRetrieveMemberUseCase externalRetrieveMemberUseCase; private final ExternalSendNotificationUseCase externalSendNotificationUseCase; - private final ExternalRegisterBoardHashtagUseCase externalRegisterBoardHashtagUseCase; + private final RegisterBoardHashtagUseCase registerBoardHashtagUseCase; private final UploadedFileService uploadedFileService; private final ApplicationEventPublisher eventPublisher; private final BoardDtoMapper boardDtoMapper; @@ -71,7 +70,7 @@ public String registerBoard(BoardRequestDto requestDto) throws PermissionDeniedE throw new InvalidBoardCategoryHashtagException("개발질문 게시판에만 해시태그를 등록할 수 있습니다."); } if (savedBoard.isDevelopmentQna() && requestDto.getHashtagIdList() != null) { - externalRegisterBoardHashtagUseCase.registerBoardHashtag(boardHashtagDtoMapper.toDto(savedBoard.getId(), requestDto.getHashtagIdList())); + registerBoardHashtagUseCase.registerBoardHashtag(boardHashtagDtoMapper.toDto(savedBoard.getId(), requestDto.getHashtagIdList())); } return savedBoard.getCategory().getKey(); } diff --git a/src/main/java/page/clab/api/domain/community/board/application/service/BoardRetrievalService.java b/src/main/java/page/clab/api/domain/community/board/application/service/BoardRetrievalService.java index a373e73b6..15a198eb2 100644 --- a/src/main/java/page/clab/api/domain/community/board/application/service/BoardRetrievalService.java +++ b/src/main/java/page/clab/api/domain/community/board/application/service/BoardRetrievalService.java @@ -14,7 +14,7 @@ import page.clab.api.domain.community.board.application.port.out.RetrieveBoardPort; import page.clab.api.domain.community.board.domain.Board; import page.clab.api.domain.memberManagement.member.application.dto.shared.MemberDetailedInfoDto; -import page.clab.api.external.community.board.application.port.ExternalRetrieveBoardHashtagUseCase; +import page.clab.api.domain.community.board.application.port.in.RetrieveBoardHashtagUseCase; import page.clab.api.external.community.comment.application.port.ExternalRetrieveCommentUseCase; import page.clab.api.external.memberManagement.member.application.port.ExternalRetrieveMemberUseCase; import page.clab.api.global.common.dto.PagedResponseDto; @@ -26,7 +26,7 @@ public class BoardRetrievalService implements RetrieveBoardUseCase { private final RetrieveBoardPort retrieveBoardPort; private final ExternalRetrieveCommentUseCase externalRetrieveCommentUseCase; private final ExternalRetrieveMemberUseCase externalRetrieveMemberUseCase; - private final ExternalRetrieveBoardHashtagUseCase externalRetrieveBoardHashtagUseCase; + private final RetrieveBoardHashtagUseCase retrieveBoardHashtagUseCase; private final BoardDtoMapper mapper; @Transactional @@ -49,7 +49,7 @@ private MemberDetailedInfoDto getMemberDetailedInfoByBoard(Board board) { @NotNull private BoardListResponseDto mapToBoardListResponseDto(Board board, MemberDetailedInfoDto memberInfo) { Long commentCount = externalRetrieveCommentUseCase.countByBoardId(board.getId()); - List boardHashtagInfos = externalRetrieveBoardHashtagUseCase.getBoardHashtagInfoByBoardId(board.getId()); + List boardHashtagInfos = retrieveBoardHashtagUseCase.getBoardHashtagInfoByBoardId(board.getId()); return mapper.toListDto(board, memberInfo, commentCount, boardHashtagInfos); } } diff --git a/src/main/java/page/clab/api/domain/community/board/application/service/BoardUpdateService.java b/src/main/java/page/clab/api/domain/community/board/application/service/BoardUpdateService.java index 2255fcbb1..15c01e3b5 100644 --- a/src/main/java/page/clab/api/domain/community/board/application/service/BoardUpdateService.java +++ b/src/main/java/page/clab/api/domain/community/board/application/service/BoardUpdateService.java @@ -4,7 +4,6 @@ import java.util.Arrays; import java.util.List; import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; import org.springframework.context.ApplicationEventPublisher; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -19,8 +18,8 @@ import page.clab.api.domain.community.board.domain.Board; import page.clab.api.domain.community.board.domain.BoardHashtag; import page.clab.api.domain.memberManagement.member.application.dto.shared.MemberDetailedInfoDto; -import page.clab.api.external.community.board.application.port.ExternalRegisterBoardHashtagUseCase; -import page.clab.api.external.community.board.application.port.ExternalRetrieveBoardHashtagUseCase; +import page.clab.api.domain.community.board.application.port.in.RegisterBoardHashtagUseCase; +import page.clab.api.domain.community.board.application.port.in.RetrieveBoardHashtagUseCase; import page.clab.api.external.memberManagement.member.application.port.ExternalRetrieveMemberUseCase; import page.clab.api.global.exception.PermissionDeniedException; @@ -32,8 +31,8 @@ public class BoardUpdateService implements UpdateBoardUseCase { private final RegisterBoardPort registerBoardPort; private final RegisterBoardHashtagPort registerBoardHashtagPort; private final ExternalRetrieveMemberUseCase externalRetrieveMemberUseCase; - private final ExternalRetrieveBoardHashtagUseCase externalRetrieveBoardHashtagUseCase; - private final ExternalRegisterBoardHashtagUseCase externalRegisterBoardHashtagUseCase; + private final RetrieveBoardHashtagUseCase retrieveBoardHashtagUseCase; + private final RegisterBoardHashtagUseCase registerBoardHashtagUseCase; private final ApplicationEventPublisher eventPublisher; private final BoardHashtagDtoMapper boardHashtagDtoMapper; @@ -44,7 +43,7 @@ public String updateBoard(Long boardId, BoardUpdateRequestDto requestDto) throws Board board = retrieveBoardPort.getById(boardId); board.validateAccessPermission(currentMemberInfo); board.update(requestDto); - updateBoardHashtag(board, requestDto.getHashtagIdList(), externalRetrieveBoardHashtagUseCase.getAllIncludingDeletedByBoardId(boardId)); + updateBoardHashtag(board, requestDto.getHashtagIdList(), retrieveBoardHashtagUseCase.getAllIncludingDeletedByBoardId(boardId)); eventPublisher.publishEvent(new BoardUpdatedEvent(this, board.getId())); registerBoardPort.save(board); return board.getCategory().getKey(); @@ -56,7 +55,7 @@ public void updateBoardHashtag(Board board, List newHashtagIds, List currentHashtagIds = externalRetrieveBoardHashtagUseCase.extractAllHashtagId(currentBoardHashtags); + List currentHashtagIds = retrieveBoardHashtagUseCase.extractAllHashtagId(currentBoardHashtags); List hashtagsToRemove = currentHashtagIds.stream() .filter(id -> !newHashtagIds.contains(id)) .toList(); @@ -97,7 +96,7 @@ private void addHashtag(Long boardId, Long hashtagId, List current registerBoardHashtagPort.save(boardHashtag); }, () -> { - externalRegisterBoardHashtagUseCase.registerBoardHashtag( + registerBoardHashtagUseCase.registerBoardHashtag( boardHashtagDtoMapper.toDto(boardId, new ArrayList<>(Arrays.asList(hashtagId))) ); } diff --git a/src/main/java/page/clab/api/domain/community/board/application/service/BoardsByCategoryRetrievalService.java b/src/main/java/page/clab/api/domain/community/board/application/service/BoardsByCategoryRetrievalService.java index 2a79e8821..ce066bd0a 100644 --- a/src/main/java/page/clab/api/domain/community/board/application/service/BoardsByCategoryRetrievalService.java +++ b/src/main/java/page/clab/api/domain/community/board/application/service/BoardsByCategoryRetrievalService.java @@ -14,7 +14,7 @@ import page.clab.api.domain.community.board.domain.Board; import page.clab.api.domain.community.board.domain.BoardCategory; import page.clab.api.domain.memberManagement.member.application.dto.shared.MemberDetailedInfoDto; -import page.clab.api.external.community.board.application.port.ExternalRetrieveBoardHashtagUseCase; +import page.clab.api.domain.community.board.application.port.in.RetrieveBoardHashtagUseCase; import page.clab.api.external.community.comment.application.port.ExternalRetrieveCommentUseCase; import page.clab.api.external.memberManagement.member.application.port.ExternalRetrieveMemberUseCase; import page.clab.api.global.common.dto.PagedResponseDto; @@ -26,7 +26,7 @@ public class BoardsByCategoryRetrievalService implements RetrieveBoardsByCategor private final RetrieveBoardPort retrieveBoardPort; private final ExternalRetrieveMemberUseCase externalRetrieveMemberUseCase; private final ExternalRetrieveCommentUseCase externalRetrieveCommentUseCase; - private final ExternalRetrieveBoardHashtagUseCase externalRetrieveBoardHashtagUseCase; + private final RetrieveBoardHashtagUseCase retrieveBoardHashtagUseCase; private final BoardDtoMapper mapper; @Transactional @@ -35,7 +35,7 @@ public PagedResponseDto retrieveBoardsByCategory(Board Page boards = retrieveBoardPort.findAllByCategory(category, pageable); return new PagedResponseDto<>(boards.map(board -> { long commentCount = externalRetrieveCommentUseCase.countByBoardId(board.getId()); - List boardHashtagInfos = externalRetrieveBoardHashtagUseCase.getBoardHashtagInfoByBoardId(board.getId()); + List boardHashtagInfos = retrieveBoardHashtagUseCase.getBoardHashtagInfoByBoardId(board.getId()); return mapper.toCategoryDto(board, getMemberDetailedInfoByBoard(board), commentCount, boardHashtagInfos); })); } diff --git a/src/main/java/page/clab/api/domain/community/board/application/service/BoardsByHashtagRetrievalService.java b/src/main/java/page/clab/api/domain/community/board/application/service/BoardsByHashtagRetrievalService.java index 052e0b793..80b933567 100644 --- a/src/main/java/page/clab/api/domain/community/board/application/service/BoardsByHashtagRetrievalService.java +++ b/src/main/java/page/clab/api/domain/community/board/application/service/BoardsByHashtagRetrievalService.java @@ -3,8 +3,6 @@ import java.util.ArrayList; import java.util.List; import lombok.RequiredArgsConstructor; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import page.clab.api.domain.community.board.application.dto.mapper.BoardDtoMapper; @@ -13,7 +11,7 @@ import page.clab.api.domain.community.board.application.port.in.RetrieveBoardsByHashtagUseCase; import page.clab.api.domain.community.board.domain.Board; import page.clab.api.domain.memberManagement.member.application.dto.shared.MemberDetailedInfoDto; -import page.clab.api.external.community.board.application.port.ExternalRetrieveBoardHashtagUseCase; +import page.clab.api.domain.community.board.application.port.in.RetrieveBoardHashtagUseCase; import page.clab.api.external.community.board.application.port.ExternalRetrieveBoardUseCase; import page.clab.api.external.community.comment.application.port.ExternalRetrieveCommentUseCase; import page.clab.api.external.hashtag.application.port.ExternalRetrieveHashtagUseCase; @@ -28,7 +26,7 @@ public class BoardsByHashtagRetrievalService implements RetrieveBoardsByHashtagU private final ExternalRetrieveHashtagUseCase externalRetrieveHashtagUseCase; private final ExternalRetrieveCommentUseCase externalRetrieveCommentUseCase; private final ExternalRetrieveMemberUseCase externalRetrieveMemberUseCase; - private final ExternalRetrieveBoardHashtagUseCase externalRetrieveBoardHashtagUseCase; + private final RetrieveBoardHashtagUseCase retrieveBoardHashtagUseCase; private final ExternalRetrieveBoardUseCase externalRetrieveBoardUseCase; private final BoardDtoMapper mapper; @@ -39,7 +37,7 @@ public PagedResponseDto retrieveBoardsByHashtag(List boardIds = externalRetrieveBoardHashtagUseCase.getBoardIdsByHashTagId(hashtagIds); + List boardIds = retrieveBoardHashtagUseCase.getBoardIdsByHashTagId(hashtagIds); List boards = boardIds.stream() .map(externalRetrieveBoardUseCase::getById) @@ -48,7 +46,7 @@ public PagedResponseDto retrieveBoardsByHashtag(List boardOverviewResponseDtos = boards.stream().map(board -> { long commentCount = externalRetrieveCommentUseCase.countByBoardId(board.getId()); - List boardHashtagInfos = externalRetrieveBoardHashtagUseCase.getBoardHashtagInfoByBoardId(board.getId()); + List boardHashtagInfos = retrieveBoardHashtagUseCase.getBoardHashtagInfoByBoardId(board.getId()); return mapper.toCategoryDto(board, getMemberDetailedInfoByBoard(board), commentCount, boardHashtagInfos); }).toList(); diff --git a/src/main/java/page/clab/api/domain/community/board/application/service/DeletedBoardsRetrievalService.java b/src/main/java/page/clab/api/domain/community/board/application/service/DeletedBoardsRetrievalService.java index 58d1c556e..eeb960593 100644 --- a/src/main/java/page/clab/api/domain/community/board/application/service/DeletedBoardsRetrievalService.java +++ b/src/main/java/page/clab/api/domain/community/board/application/service/DeletedBoardsRetrievalService.java @@ -14,7 +14,6 @@ import page.clab.api.domain.community.board.application.port.out.RetrieveBoardPort; import page.clab.api.domain.community.board.domain.Board; import page.clab.api.domain.memberManagement.member.application.dto.shared.MemberDetailedInfoDto; -import page.clab.api.external.community.board.application.service.ExternalBoardHashtagRetrieveService; import page.clab.api.external.community.comment.application.port.ExternalRetrieveCommentUseCase; import page.clab.api.external.memberManagement.member.application.port.ExternalRetrieveMemberUseCase; import page.clab.api.global.common.dto.PagedResponseDto; @@ -26,7 +25,7 @@ public class DeletedBoardsRetrievalService implements RetrieveDeletedBoardsUseCa private final RetrieveBoardPort retrieveBoardPort; private final ExternalRetrieveCommentUseCase externalRetrieveCommentUseCase; private final ExternalRetrieveMemberUseCase externalRetrieveMemberUseCase; - private final ExternalBoardHashtagRetrieveService externalBoardHashtagRetrieveService; + private final BoardHashtagRetrieveService boardHashtagRetrieveService; private final BoardDtoMapper mapper; @Transactional(readOnly = true) @@ -44,7 +43,7 @@ private MemberDetailedInfoDto getMemberDetailedInfoByBoard(Board board) { @NotNull private BoardListResponseDto mapToBoardListResponseDto(Board board, MemberDetailedInfoDto memberInfo) { Long commentCount = externalRetrieveCommentUseCase.countByBoardId(board.getId()); - List boardHashtagInfos = externalBoardHashtagRetrieveService.getBoardHashtagInfoByBoardId(board.getId()); + List boardHashtagInfos = boardHashtagRetrieveService.getBoardHashtagInfoByBoardId(board.getId()); return mapper.toListDto(board, memberInfo, commentCount, boardHashtagInfos); } } diff --git a/src/main/java/page/clab/api/domain/community/board/application/service/MyBoardsRetrievalService.java b/src/main/java/page/clab/api/domain/community/board/application/service/MyBoardsRetrievalService.java index 61e97a291..1490d99be 100644 --- a/src/main/java/page/clab/api/domain/community/board/application/service/MyBoardsRetrievalService.java +++ b/src/main/java/page/clab/api/domain/community/board/application/service/MyBoardsRetrievalService.java @@ -12,9 +12,8 @@ import page.clab.api.domain.community.board.application.port.in.RetrieveMyBoardsUseCase; import page.clab.api.domain.community.board.application.port.out.RetrieveBoardPort; import page.clab.api.domain.community.board.domain.Board; -import page.clab.api.domain.community.board.domain.BoardHashtag; import page.clab.api.domain.memberManagement.member.application.dto.shared.MemberBasicInfoDto; -import page.clab.api.external.community.board.application.port.ExternalRetrieveBoardHashtagUseCase; +import page.clab.api.domain.community.board.application.port.in.RetrieveBoardHashtagUseCase; import page.clab.api.external.memberManagement.member.application.port.ExternalRetrieveMemberUseCase; import page.clab.api.global.common.dto.PagedResponseDto; @@ -24,7 +23,7 @@ public class MyBoardsRetrievalService implements RetrieveMyBoardsUseCase { private final RetrieveBoardPort retrieveBoardPort; private final ExternalRetrieveMemberUseCase externalRetrieveMemberUseCase; - private final ExternalRetrieveBoardHashtagUseCase externalRetrieveBoardHashtagUseCase; + private final RetrieveBoardHashtagUseCase retrieveBoardHashtagUseCase; private final BoardDtoMapper mapper; @Transactional @@ -33,7 +32,7 @@ public PagedResponseDto retrieveMyBoards(Pageable pageable) MemberBasicInfoDto currentMemberInfo = externalRetrieveMemberUseCase.getCurrentMemberBasicInfo(); Page boards = retrieveBoardPort.findAllByMemberId(currentMemberInfo.getMemberId(), pageable); return new PagedResponseDto<>(boards.map(board -> { - List boardHashtagInfos = externalRetrieveBoardHashtagUseCase.getBoardHashtagInfoByBoardId(board.getId()); + List boardHashtagInfos = retrieveBoardHashtagUseCase.getBoardHashtagInfoByBoardId(board.getId()); return mapper.toDto(board, currentMemberInfo, boardHashtagInfos); })); }