From fa7ba999531ad76d287f44e2f7117a0848cbb581 Mon Sep 17 00:00:00 2001 From: ayoung-dev Date: Wed, 27 Nov 2024 11:51:58 +0900 Subject: [PATCH 1/6] =?UTF-8?q?test(community):=20CommunityBoard=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20=EA=B8=B0=EB=8A=A5=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UpdateCommunityBoardServiceTest.java | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 src/test/java/com/somemore/community/service/command/UpdateCommunityBoardServiceTest.java diff --git a/src/test/java/com/somemore/community/service/command/UpdateCommunityBoardServiceTest.java b/src/test/java/com/somemore/community/service/command/UpdateCommunityBoardServiceTest.java new file mode 100644 index 000000000..f4f81dea7 --- /dev/null +++ b/src/test/java/com/somemore/community/service/command/UpdateCommunityBoardServiceTest.java @@ -0,0 +1,98 @@ +package com.somemore.community.service.command; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import com.somemore.IntegrationTestSupport; +import com.somemore.community.domain.CommunityBoard; +import com.somemore.community.dto.request.CommunityBoardCreateRequestDto; +import com.somemore.community.dto.request.CommunityBoardUpdateRequestDto; +import com.somemore.community.repository.CommunityBoardRepository; +import com.somemore.community.usecase.command.CreateCommunityBoardUseCase; +import com.somemore.global.exception.BadRequestException; +import com.somemore.global.exception.ExceptionMessage; +import org.assertj.core.api.ThrowableAssert; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.Optional; +import java.util.UUID; + +public class UpdateCommunityBoardServiceTest extends IntegrationTestSupport { + + @Autowired + private CreateCommunityBoardUseCase createCommunityBoardUseCase; + @Autowired + private CommunityBoardRepository communityBoardRepository; + @Autowired + private UpdateCommunityBoardService updateCommunityBoardService; + + private UUID writerId; + private Long communityId; + private String imgUrl; + + @BeforeEach + void setUp() { + CommunityBoardCreateRequestDto dto = CommunityBoardCreateRequestDto.builder() + .title("커뮤니티 테스트 제목") + .content("커뮤니티 테스트 내용") + .build(); + + writerId = UUID.randomUUID(); + imgUrl = "https://image.test.url/123"; + + communityId = createCommunityBoardUseCase.createCommunityBoard(dto, writerId, imgUrl); + } + + @AfterEach + void tearDown() { + communityBoardRepository.deleteAllInBatch(); + } + + @DisplayName("커뮤니티 게시글을 수정한다.") + @Test + void updateCommunityBoard() { + + //given + CommunityBoardUpdateRequestDto dto = CommunityBoardUpdateRequestDto.builder() + .title("수정된 커뮤니티 테스트 제목") + .content("수정된 커뮤니티 테스트 내용") + .build(); + + String newImgUrl = "https://image.test.url/567"; + + //when + updateCommunityBoardService.updateCommunityBoard(dto, communityId, writerId, newImgUrl); + + //then + Optional updatedCommunityBoard = communityBoardRepository.findById(communityId); + assertThat(updatedCommunityBoard).isNotNull(); + assertThat(updatedCommunityBoard.get().getId()).isEqualTo(communityId); + assertThat(updatedCommunityBoard.get().getWriterId()).isEqualTo(writerId); + assertThat(updatedCommunityBoard.get().getTitle()).isEqualTo("수정된 커뮤니티 테스트 제목"); + assertThat(updatedCommunityBoard.get().getContent()).isEqualTo("수정된 커뮤니티 테스트 내용"); + assertThat(updatedCommunityBoard.get().getImgUrl()).isEqualTo("https://image.test.url/567"); + } + + @DisplayName("작성자가 아닌 id로 커뮤니티 게시글을 수정하고자 할 때 예외를 던진다.") + @Test + void updateCommunityBoardNotWriterId() { + + //given + CommunityBoardUpdateRequestDto dto = CommunityBoardUpdateRequestDto.builder() + .title("수정된 커뮤니티 테스트 제목") + .content("수정된 커뮤니티 테스트 내용") + .build(); + + //when + ThrowableAssert.ThrowingCallable callable = () -> updateCommunityBoardService.updateCommunityBoard(dto, communityId, UUID.randomUUID(), null); + + //then + assertThatExceptionOfType(BadRequestException.class) + .isThrownBy(callable) + .withMessage(ExceptionMessage.UNAUTHORIZED_COMMUNITY_BOARD.getMessage()); + } +} From 5462f83929ceb06d88c4a3b7182547da0a748f40 Mon Sep 17 00:00:00 2001 From: ayoung-dev Date: Wed, 27 Nov 2024 12:05:38 +0900 Subject: [PATCH 2/6] =?UTF-8?q?feat(community):=20RequestDto=20=EB=B0=8F?= =?UTF-8?q?=20=EC=97=94=ED=8B=B0=ED=8B=B0=EC=97=90=20updateWith=20?= =?UTF-8?q?=EB=A9=94=EC=84=9C=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../community/domain/CommunityBoard.java | 7 +++++++ .../CommunityBoardUpdateRequestDto.java | 21 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 src/main/java/com/somemore/community/dto/request/CommunityBoardUpdateRequestDto.java diff --git a/src/main/java/com/somemore/community/domain/CommunityBoard.java b/src/main/java/com/somemore/community/domain/CommunityBoard.java index 16e667158..0fe1a540a 100644 --- a/src/main/java/com/somemore/community/domain/CommunityBoard.java +++ b/src/main/java/com/somemore/community/domain/CommunityBoard.java @@ -1,5 +1,6 @@ package com.somemore.community.domain; +import com.somemore.community.dto.request.CommunityBoardUpdateRequestDto; import com.somemore.global.common.BaseEntity; import static lombok.AccessLevel.PROTECTED; @@ -52,4 +53,10 @@ public CommunityBoard(UUID writerId, String title, String content, String imgUrl public boolean isWriter(UUID writerId) { return this.writerId.equals(writerId); } + + public void updateWith(CommunityBoardUpdateRequestDto dto, String imgUrl) { + this.title = dto.title(); + this.content = dto.content(); + this.imgUrl = imgUrl; + } } \ No newline at end of file diff --git a/src/main/java/com/somemore/community/dto/request/CommunityBoardUpdateRequestDto.java b/src/main/java/com/somemore/community/dto/request/CommunityBoardUpdateRequestDto.java new file mode 100644 index 000000000..02c2e2289 --- /dev/null +++ b/src/main/java/com/somemore/community/dto/request/CommunityBoardUpdateRequestDto.java @@ -0,0 +1,21 @@ +package com.somemore.community.dto.request; + +import com.fasterxml.jackson.databind.PropertyNamingStrategies; +import com.fasterxml.jackson.databind.annotation.JsonNaming; +import com.somemore.community.domain.CommunityBoard; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import lombok.Builder; + +import java.util.UUID; + +@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) +@Builder +public record CommunityBoardUpdateRequestDto( + @Schema(description = "커뮤니티 게시글 제목", example = "11/29 OO도서관 봉사 같이 갈 사람 모집합니다.") + @NotBlank(message = "게시글 제목은 필수 값입니다.") + String title, + @Schema(description = "커뮤니티 게시글 내용", example = "저 포함 5명이 같이 가면 좋을 거 같아요") + @NotBlank(message = "게시글 내용은 필수 값입니다.") + String content +) {} \ No newline at end of file From d23c3ec7e1cbb9a90f0944868188f63f54a3dd13 Mon Sep 17 00:00:00 2001 From: ayoung-dev Date: Wed, 27 Nov 2024 12:05:46 +0900 Subject: [PATCH 3/6] =?UTF-8?q?feat(community):=20Usecase=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20=EB=B0=8F=20Service=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../command/UpdateCommunityBoardService.java | 52 +++++++++++++++++++ .../command/UpdateCommunityBoardUseCase.java | 13 +++++ 2 files changed, 65 insertions(+) create mode 100644 src/main/java/com/somemore/community/service/command/UpdateCommunityBoardService.java create mode 100644 src/main/java/com/somemore/community/usecase/command/UpdateCommunityBoardUseCase.java diff --git a/src/main/java/com/somemore/community/service/command/UpdateCommunityBoardService.java b/src/main/java/com/somemore/community/service/command/UpdateCommunityBoardService.java new file mode 100644 index 000000000..38c6b10b9 --- /dev/null +++ b/src/main/java/com/somemore/community/service/command/UpdateCommunityBoardService.java @@ -0,0 +1,52 @@ +package com.somemore.community.service.command; + +import com.somemore.community.domain.CommunityBoard; +import com.somemore.community.dto.request.CommunityBoardUpdateRequestDto; +import com.somemore.community.repository.CommunityBoardRepository; +import com.somemore.community.usecase.command.UpdateCommunityBoardUseCase; +import com.somemore.global.exception.BadRequestException; +import com.somemore.location.usecase.command.UpdateLocationUseCase; +import com.somemore.recruitboard.domain.RecruitBoard; +import com.somemore.recruitboard.domain.RecruitStatus; +import com.somemore.recruitboard.dto.request.RecruitBoardLocationUpdateRequestDto; +import com.somemore.recruitboard.dto.request.RecruitBoardUpdateRequestDto; +import com.somemore.recruitboard.repository.RecruitBoardRepository; +import com.somemore.recruitboard.usecase.command.UpdateRecruitBoardUseCase; +import java.time.LocalDateTime; +import java.util.UUID; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import static com.somemore.global.exception.ExceptionMessage.*; + + +@RequiredArgsConstructor +@Transactional +@Service +public class UpdateCommunityBoardService implements UpdateCommunityBoardUseCase { + + private final CommunityBoardRepository communityBoardRepository; + + @Override + public void updateCommunityBoard(CommunityBoardUpdateRequestDto requestDto, Long communityBoardId, UUID writerId, String imgUrl) { + CommunityBoard communityBoard = getCommunityBoardById(communityBoardId); + validateWriter(communityBoard, writerId); + communityBoard.updateWith(requestDto, imgUrl); + + communityBoardRepository.save(communityBoard); + } + + private CommunityBoard getCommunityBoardById(Long id) { + return communityBoardRepository.findById(id) + .orElseThrow(() -> new BadRequestException(NOT_EXISTS_COMMUNITY_BOARD.getMessage())); + } + + private void validateWriter(CommunityBoard communityBoard, UUID writerId) { + if (communityBoard.isWriter(writerId)) { + return; + } + + throw new BadRequestException(UNAUTHORIZED_COMMUNITY_BOARD.getMessage()); + } +} diff --git a/src/main/java/com/somemore/community/usecase/command/UpdateCommunityBoardUseCase.java b/src/main/java/com/somemore/community/usecase/command/UpdateCommunityBoardUseCase.java new file mode 100644 index 000000000..dcec8f77b --- /dev/null +++ b/src/main/java/com/somemore/community/usecase/command/UpdateCommunityBoardUseCase.java @@ -0,0 +1,13 @@ +package com.somemore.community.usecase.command; + +import com.somemore.community.dto.request.CommunityBoardUpdateRequestDto; + +import java.util.UUID; + +public interface UpdateCommunityBoardUseCase { + void updateCommunityBoard( + CommunityBoardUpdateRequestDto requestDto, + Long communityBoardId, + UUID writerId, + String imgUrl); +} From 25ce00cee16c8e4139ce1c05835d90803ae09150 Mon Sep 17 00:00:00 2001 From: ayoung-dev Date: Wed, 27 Nov 2024 12:06:19 +0900 Subject: [PATCH 4/6] =?UTF-8?q?refactor(community):=20ExceptionMessage=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/somemore/global/exception/ExceptionMessage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/somemore/global/exception/ExceptionMessage.java b/src/main/java/com/somemore/global/exception/ExceptionMessage.java index 9f92eefcb..2c3b040c7 100644 --- a/src/main/java/com/somemore/global/exception/ExceptionMessage.java +++ b/src/main/java/com/somemore/global/exception/ExceptionMessage.java @@ -10,7 +10,7 @@ public enum ExceptionMessage { NOT_EXISTS_CENTER("존재하지 않는 기관 ID 입니다."), NOT_EXISTS_COMMUNITY_BOARD("존재하지 않는 게시글 입니다."), - UNAUTHORIZED_COMMUNITY_BOARD("게시글 삭제 권한이 없습니다."), + UNAUTHORIZED_COMMUNITY_BOARD("해당 게시글에 권한이 없습니다."), NOT_EXISTS_LOCATION("존재하지 않는 위치 ID 입니다."), NOT_EXISTS_RECRUIT_BOARD("존재하지 않는 봉사 모집글 ID 입니다."), UNAUTHORIZED_RECRUIT_BOARD("자신이 작성한 봉사 모집글이 아닙니다."), From 8cb12c72062502f695a2319d31e6bcf2a2adf3f8 Mon Sep 17 00:00:00 2001 From: ayoung-dev Date: Wed, 27 Nov 2024 12:20:23 +0900 Subject: [PATCH 5/6] =?UTF-8?q?refactor(community):=20=EB=B6=88=ED=95=84?= =?UTF-8?q?=EC=9A=94=ED=95=9C=20import,=20public=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../community/dto/request/CommunityBoardUpdateRequestDto.java | 3 --- .../service/command/UpdateCommunityBoardServiceTest.java | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/java/com/somemore/community/dto/request/CommunityBoardUpdateRequestDto.java b/src/main/java/com/somemore/community/dto/request/CommunityBoardUpdateRequestDto.java index 02c2e2289..83077f439 100644 --- a/src/main/java/com/somemore/community/dto/request/CommunityBoardUpdateRequestDto.java +++ b/src/main/java/com/somemore/community/dto/request/CommunityBoardUpdateRequestDto.java @@ -2,13 +2,10 @@ import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; -import com.somemore.community.domain.CommunityBoard; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import lombok.Builder; -import java.util.UUID; - @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) @Builder public record CommunityBoardUpdateRequestDto( diff --git a/src/test/java/com/somemore/community/service/command/UpdateCommunityBoardServiceTest.java b/src/test/java/com/somemore/community/service/command/UpdateCommunityBoardServiceTest.java index f4f81dea7..db8233367 100644 --- a/src/test/java/com/somemore/community/service/command/UpdateCommunityBoardServiceTest.java +++ b/src/test/java/com/somemore/community/service/command/UpdateCommunityBoardServiceTest.java @@ -21,7 +21,7 @@ import java.util.Optional; import java.util.UUID; -public class UpdateCommunityBoardServiceTest extends IntegrationTestSupport { +class UpdateCommunityBoardServiceTest extends IntegrationTestSupport { @Autowired private CreateCommunityBoardUseCase createCommunityBoardUseCase; From cb6251fe0a9e788a3f12486e81d9822e2797d7a4 Mon Sep 17 00:00:00 2001 From: ayoung-dev Date: Wed, 27 Nov 2024 12:35:46 +0900 Subject: [PATCH 6/6] =?UTF-8?q?refactor(community):=20=ED=8C=A8=ED=82=A4?= =?UTF-8?q?=EC=A7=80=20=EA=B5=AC=EC=A1=B0=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - command/query 패키지 삭제 --- .../{query => }/CommunityBoardQueryService.java | 4 ++-- .../{command => }/CreateCommunityBoardService.java | 4 ++-- .../{command => }/DeleteCommunityBoardService.java | 4 ++-- .../{command => }/UpdateCommunityBoardService.java | 13 +++---------- .../{query => }/CommunityBoardQueryUseCase.java | 2 +- .../{command => }/CreateCommunityBoardUseCase.java | 2 +- .../{command => }/DeleteCommunityBoardUseCase.java | 2 +- .../{command => }/UpdateCommunityBoardUseCase.java | 2 +- .../{query => }/CommunityBoardQueryServiceTest.java | 6 +++--- .../CreateCommunityBoardServiceTest.java | 2 +- .../DeleteCommunityBoardServiceTest.java | 6 +++--- .../UpdateCommunityBoardServiceTest.java | 4 ++-- 12 files changed, 22 insertions(+), 29 deletions(-) rename src/main/java/com/somemore/community/service/{query => }/CommunityBoardQueryService.java (96%) rename src/main/java/com/somemore/community/service/{command => }/CreateCommunityBoardService.java (88%) rename src/main/java/com/somemore/community/service/{command => }/DeleteCommunityBoardService.java (92%) rename src/main/java/com/somemore/community/service/{command => }/UpdateCommunityBoardService.java (71%) rename src/main/java/com/somemore/community/usecase/{query => }/CommunityBoardQueryUseCase.java (91%) rename src/main/java/com/somemore/community/usecase/{command => }/CreateCommunityBoardUseCase.java (85%) rename src/main/java/com/somemore/community/usecase/{command => }/DeleteCommunityBoardUseCase.java (72%) rename src/main/java/com/somemore/community/usecase/{command => }/UpdateCommunityBoardUseCase.java (87%) rename src/test/java/com/somemore/community/service/{query => }/CommunityBoardQueryServiceTest.java (97%) rename src/test/java/com/somemore/community/service/{command => }/CreateCommunityBoardServiceTest.java (98%) rename src/test/java/com/somemore/community/service/{command => }/DeleteCommunityBoardServiceTest.java (94%) rename src/test/java/com/somemore/community/service/{command => }/UpdateCommunityBoardServiceTest.java (96%) diff --git a/src/main/java/com/somemore/community/service/query/CommunityBoardQueryService.java b/src/main/java/com/somemore/community/service/CommunityBoardQueryService.java similarity index 96% rename from src/main/java/com/somemore/community/service/query/CommunityBoardQueryService.java rename to src/main/java/com/somemore/community/service/CommunityBoardQueryService.java index a1ce199f2..00aeb74b8 100644 --- a/src/main/java/com/somemore/community/service/query/CommunityBoardQueryService.java +++ b/src/main/java/com/somemore/community/service/CommunityBoardQueryService.java @@ -1,4 +1,4 @@ -package com.somemore.community.service.query; +package com.somemore.community.service; import com.somemore.center.usecase.query.CenterQueryUseCase; import com.somemore.community.domain.CommunityBoard; @@ -6,7 +6,7 @@ import com.somemore.community.dto.response.CommunityBoardGetResponseDto; import com.somemore.community.dto.response.WriterDetailDto; import com.somemore.community.repository.CommunityBoardRepository; -import com.somemore.community.usecase.query.CommunityBoardQueryUseCase; +import com.somemore.community.usecase.CommunityBoardQueryUseCase; import com.somemore.global.exception.BadRequestException; import com.somemore.volunteer.dto.response.VolunteerForCommunityResponseDto; import com.somemore.volunteer.usecase.query.FindVolunteerIdUseCase; diff --git a/src/main/java/com/somemore/community/service/command/CreateCommunityBoardService.java b/src/main/java/com/somemore/community/service/CreateCommunityBoardService.java similarity index 88% rename from src/main/java/com/somemore/community/service/command/CreateCommunityBoardService.java rename to src/main/java/com/somemore/community/service/CreateCommunityBoardService.java index e0734cd34..07ad1d456 100644 --- a/src/main/java/com/somemore/community/service/command/CreateCommunityBoardService.java +++ b/src/main/java/com/somemore/community/service/CreateCommunityBoardService.java @@ -1,9 +1,9 @@ -package com.somemore.community.service.command; +package com.somemore.community.service; import com.somemore.community.domain.CommunityBoard; import com.somemore.community.dto.request.CommunityBoardCreateRequestDto; import com.somemore.community.repository.CommunityBoardRepository; -import com.somemore.community.usecase.command.CreateCommunityBoardUseCase; +import com.somemore.community.usecase.CreateCommunityBoardUseCase; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; diff --git a/src/main/java/com/somemore/community/service/command/DeleteCommunityBoardService.java b/src/main/java/com/somemore/community/service/DeleteCommunityBoardService.java similarity index 92% rename from src/main/java/com/somemore/community/service/command/DeleteCommunityBoardService.java rename to src/main/java/com/somemore/community/service/DeleteCommunityBoardService.java index 0e0fe857a..79c735bf9 100644 --- a/src/main/java/com/somemore/community/service/command/DeleteCommunityBoardService.java +++ b/src/main/java/com/somemore/community/service/DeleteCommunityBoardService.java @@ -1,8 +1,8 @@ -package com.somemore.community.service.command; +package com.somemore.community.service; import com.somemore.community.domain.CommunityBoard; import com.somemore.community.repository.CommunityBoardRepository; -import com.somemore.community.usecase.command.DeleteCommunityBoardUseCase; +import com.somemore.community.usecase.DeleteCommunityBoardUseCase; import com.somemore.global.exception.BadRequestException; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; diff --git a/src/main/java/com/somemore/community/service/command/UpdateCommunityBoardService.java b/src/main/java/com/somemore/community/service/UpdateCommunityBoardService.java similarity index 71% rename from src/main/java/com/somemore/community/service/command/UpdateCommunityBoardService.java rename to src/main/java/com/somemore/community/service/UpdateCommunityBoardService.java index 38c6b10b9..ef3f96c36 100644 --- a/src/main/java/com/somemore/community/service/command/UpdateCommunityBoardService.java +++ b/src/main/java/com/somemore/community/service/UpdateCommunityBoardService.java @@ -1,18 +1,11 @@ -package com.somemore.community.service.command; +package com.somemore.community.service; import com.somemore.community.domain.CommunityBoard; import com.somemore.community.dto.request.CommunityBoardUpdateRequestDto; import com.somemore.community.repository.CommunityBoardRepository; -import com.somemore.community.usecase.command.UpdateCommunityBoardUseCase; +import com.somemore.community.usecase.UpdateCommunityBoardUseCase; import com.somemore.global.exception.BadRequestException; -import com.somemore.location.usecase.command.UpdateLocationUseCase; -import com.somemore.recruitboard.domain.RecruitBoard; -import com.somemore.recruitboard.domain.RecruitStatus; -import com.somemore.recruitboard.dto.request.RecruitBoardLocationUpdateRequestDto; -import com.somemore.recruitboard.dto.request.RecruitBoardUpdateRequestDto; -import com.somemore.recruitboard.repository.RecruitBoardRepository; -import com.somemore.recruitboard.usecase.command.UpdateRecruitBoardUseCase; -import java.time.LocalDateTime; + import java.util.UUID; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; diff --git a/src/main/java/com/somemore/community/usecase/query/CommunityBoardQueryUseCase.java b/src/main/java/com/somemore/community/usecase/CommunityBoardQueryUseCase.java similarity index 91% rename from src/main/java/com/somemore/community/usecase/query/CommunityBoardQueryUseCase.java rename to src/main/java/com/somemore/community/usecase/CommunityBoardQueryUseCase.java index a7c3818c3..2b4da6312 100644 --- a/src/main/java/com/somemore/community/usecase/query/CommunityBoardQueryUseCase.java +++ b/src/main/java/com/somemore/community/usecase/CommunityBoardQueryUseCase.java @@ -1,4 +1,4 @@ -package com.somemore.community.usecase.query; +package com.somemore.community.usecase; import com.somemore.community.dto.response.CommunityBoardGetDetailResponseDto; import com.somemore.community.dto.response.CommunityBoardGetResponseDto; diff --git a/src/main/java/com/somemore/community/usecase/command/CreateCommunityBoardUseCase.java b/src/main/java/com/somemore/community/usecase/CreateCommunityBoardUseCase.java similarity index 85% rename from src/main/java/com/somemore/community/usecase/command/CreateCommunityBoardUseCase.java rename to src/main/java/com/somemore/community/usecase/CreateCommunityBoardUseCase.java index d45a2dd12..2e0c3828f 100644 --- a/src/main/java/com/somemore/community/usecase/command/CreateCommunityBoardUseCase.java +++ b/src/main/java/com/somemore/community/usecase/CreateCommunityBoardUseCase.java @@ -1,4 +1,4 @@ -package com.somemore.community.usecase.command; +package com.somemore.community.usecase; import com.somemore.community.dto.request.CommunityBoardCreateRequestDto; diff --git a/src/main/java/com/somemore/community/usecase/command/DeleteCommunityBoardUseCase.java b/src/main/java/com/somemore/community/usecase/DeleteCommunityBoardUseCase.java similarity index 72% rename from src/main/java/com/somemore/community/usecase/command/DeleteCommunityBoardUseCase.java rename to src/main/java/com/somemore/community/usecase/DeleteCommunityBoardUseCase.java index 88bca4548..d2f26500e 100644 --- a/src/main/java/com/somemore/community/usecase/command/DeleteCommunityBoardUseCase.java +++ b/src/main/java/com/somemore/community/usecase/DeleteCommunityBoardUseCase.java @@ -1,4 +1,4 @@ -package com.somemore.community.usecase.command; +package com.somemore.community.usecase; import java.util.UUID; diff --git a/src/main/java/com/somemore/community/usecase/command/UpdateCommunityBoardUseCase.java b/src/main/java/com/somemore/community/usecase/UpdateCommunityBoardUseCase.java similarity index 87% rename from src/main/java/com/somemore/community/usecase/command/UpdateCommunityBoardUseCase.java rename to src/main/java/com/somemore/community/usecase/UpdateCommunityBoardUseCase.java index dcec8f77b..e8690b283 100644 --- a/src/main/java/com/somemore/community/usecase/command/UpdateCommunityBoardUseCase.java +++ b/src/main/java/com/somemore/community/usecase/UpdateCommunityBoardUseCase.java @@ -1,4 +1,4 @@ -package com.somemore.community.usecase.command; +package com.somemore.community.usecase; import com.somemore.community.dto.request.CommunityBoardUpdateRequestDto; diff --git a/src/test/java/com/somemore/community/service/query/CommunityBoardQueryServiceTest.java b/src/test/java/com/somemore/community/service/CommunityBoardQueryServiceTest.java similarity index 97% rename from src/test/java/com/somemore/community/service/query/CommunityBoardQueryServiceTest.java rename to src/test/java/com/somemore/community/service/CommunityBoardQueryServiceTest.java index 797edc4b8..0f3aaf55a 100644 --- a/src/test/java/com/somemore/community/service/query/CommunityBoardQueryServiceTest.java +++ b/src/test/java/com/somemore/community/service/CommunityBoardQueryServiceTest.java @@ -1,4 +1,4 @@ -package com.somemore.community.service.query; +package com.somemore.community.service; import com.somemore.IntegrationTestSupport; import com.somemore.auth.oauth.OAuthProvider; @@ -9,8 +9,8 @@ import com.somemore.community.dto.response.CommunityBoardGetDetailResponseDto; import com.somemore.community.dto.response.CommunityBoardGetResponseDto; import com.somemore.community.repository.CommunityBoardRepository; -import com.somemore.community.usecase.command.CreateCommunityBoardUseCase; -import com.somemore.community.usecase.command.DeleteCommunityBoardUseCase; +import com.somemore.community.usecase.CreateCommunityBoardUseCase; +import com.somemore.community.usecase.DeleteCommunityBoardUseCase; import com.somemore.global.exception.BadRequestException; import com.somemore.global.exception.ExceptionMessage; import com.somemore.volunteer.domain.Volunteer; diff --git a/src/test/java/com/somemore/community/service/command/CreateCommunityBoardServiceTest.java b/src/test/java/com/somemore/community/service/CreateCommunityBoardServiceTest.java similarity index 98% rename from src/test/java/com/somemore/community/service/command/CreateCommunityBoardServiceTest.java rename to src/test/java/com/somemore/community/service/CreateCommunityBoardServiceTest.java index d2cb672a7..d373da46a 100644 --- a/src/test/java/com/somemore/community/service/command/CreateCommunityBoardServiceTest.java +++ b/src/test/java/com/somemore/community/service/CreateCommunityBoardServiceTest.java @@ -1,4 +1,4 @@ -package com.somemore.community.service.command; +package com.somemore.community.service; import static org.assertj.core.api.Assertions.assertThat; diff --git a/src/test/java/com/somemore/community/service/command/DeleteCommunityBoardServiceTest.java b/src/test/java/com/somemore/community/service/DeleteCommunityBoardServiceTest.java similarity index 94% rename from src/test/java/com/somemore/community/service/command/DeleteCommunityBoardServiceTest.java rename to src/test/java/com/somemore/community/service/DeleteCommunityBoardServiceTest.java index 578bec665..e72667431 100644 --- a/src/test/java/com/somemore/community/service/command/DeleteCommunityBoardServiceTest.java +++ b/src/test/java/com/somemore/community/service/DeleteCommunityBoardServiceTest.java @@ -1,4 +1,4 @@ -package com.somemore.community.service.command; +package com.somemore.community.service; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; @@ -6,8 +6,8 @@ import com.somemore.IntegrationTestSupport; import com.somemore.community.dto.request.CommunityBoardCreateRequestDto; import com.somemore.community.repository.CommunityBoardRepository; -import com.somemore.community.usecase.command.CreateCommunityBoardUseCase; -import com.somemore.community.usecase.query.CommunityBoardQueryUseCase; +import com.somemore.community.usecase.CreateCommunityBoardUseCase; +import com.somemore.community.usecase.CommunityBoardQueryUseCase; import com.somemore.global.exception.BadRequestException; import com.somemore.global.exception.ExceptionMessage; import org.assertj.core.api.ThrowableAssert; diff --git a/src/test/java/com/somemore/community/service/command/UpdateCommunityBoardServiceTest.java b/src/test/java/com/somemore/community/service/UpdateCommunityBoardServiceTest.java similarity index 96% rename from src/test/java/com/somemore/community/service/command/UpdateCommunityBoardServiceTest.java rename to src/test/java/com/somemore/community/service/UpdateCommunityBoardServiceTest.java index db8233367..06bd1de86 100644 --- a/src/test/java/com/somemore/community/service/command/UpdateCommunityBoardServiceTest.java +++ b/src/test/java/com/somemore/community/service/UpdateCommunityBoardServiceTest.java @@ -1,4 +1,4 @@ -package com.somemore.community.service.command; +package com.somemore.community.service; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; @@ -8,7 +8,7 @@ import com.somemore.community.dto.request.CommunityBoardCreateRequestDto; import com.somemore.community.dto.request.CommunityBoardUpdateRequestDto; import com.somemore.community.repository.CommunityBoardRepository; -import com.somemore.community.usecase.command.CreateCommunityBoardUseCase; +import com.somemore.community.usecase.CreateCommunityBoardUseCase; import com.somemore.global.exception.BadRequestException; import com.somemore.global.exception.ExceptionMessage; import org.assertj.core.api.ThrowableAssert;