From 09a7764177ec4aa0406a69e4675a5f57d987b9b6 Mon Sep 17 00:00:00 2001 From: ChoiYoungHoon Date: Tue, 12 Dec 2023 17:00:35 +0900 Subject: [PATCH 1/6] =?UTF-8?q?feat:=20member,=20auth,=20common=20?= =?UTF-8?q?=ED=8C=A8=ED=82=A4=EC=A7=80=20=EC=83=9D=EC=84=B1=20=EB=B0=8F=20?= =?UTF-8?q?=EC=9D=98=EC=A1=B4=EC=84=B1=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{ => auth}/controller/AuthController.java | 16 +-- .../infra/NaverOauthNetworkService.java | 6 +- .../auth/interceptor/AuthInterceptorImpl.java | 48 +++++++++ .../persistence}/RefreshTokenRepository.java | 2 +- .../RefreshTokenRepositoryImpl.java | 2 +- .../MemberIdentifierArgumentResolverImpl.java | 48 +++++++++ .../auth => auth/service}/AuthService.java | 26 ++--- .../service}/JwtTokenProvider.java | 4 +- .../service}/NaverOauthService.java | 41 +++---- .../service/OauthNetworkService.java | 4 +- .../auth => auth/service}/TokenProvider.java | 2 +- .../kirikiri/auth/service/dto/LoginDto.java | 11 ++ .../service/dto}/NaverMemberProfileDto.java | 2 +- .../dto}/NaverMemberProfileResponseDto.java | 2 +- .../service/dto}/NaverOauthTokenDto.java | 2 +- .../service/dto}/OauthRedirectResponse.java | 2 +- .../service/dto}/request/LoginRequest.java | 2 +- .../dto}/request/ReissueTokenRequest.java | 2 +- .../dto}/response/AuthenticationResponse.java | 2 +- .../{ => auth}/service/mapper/AuthMapper.java | 12 +-- .../service/mapper/OauthMapper.java | 4 +- .../aop/ExceptionConvert.java | 2 +- .../aop/ExceptionConvertAop.java | 12 +-- .../co/kirikiri/common/config/WebConfig.java | 2 +- .../controller/GlobalExceptionHandler.java | 14 +-- .../entity}/BaseCreatedTimeEntity.java | 2 +- .../{domain => common/entity}/BaseEntity.java | 2 +- .../entity}/BaseUpdatedTimeEntity.java | 2 +- .../exception/AuthenticationException.java | 2 +- .../exception/BadRequestException.java | 2 +- .../exception/BusinessException.java | 2 +- .../exception/ConflictException.java | 2 +- .../exception/DomainException.java | 2 +- .../exception/ForbiddenException.java | 2 +- .../exception/ImageExtensionException.java | 2 +- .../exception/NotFoundException.java | 2 +- .../exception/ServerException.java | 2 +- .../exception/UnexpectedDomainException.java | 2 +- .../infra/AmazonS3FileService.java | 6 +- .../{ => common}/infra/CloudFrontService.java | 4 +- .../common/interceptor/AuthInterceptor.java | 43 +------- .../MemberIdentifierArgumentResolver.java | 43 +------- .../resolver/RoadmapSaveArgumentResolver.java | 2 +- .../service/CacheKeyGenerator.java | 2 +- .../service/FilePathGenerator.java | 4 +- .../{ => common}/service/FileService.java | 4 +- .../{ => common}/service/NumberGenerator.java | 2 +- .../type}/ImageContentType.java | 4 +- .../type}/ImageDirType.java | 2 +- .../controller/GoalRoomController.java | 4 +- .../domain/goalroom/BaseGoalRoomMember.java | 12 +-- .../kirikiri/domain/goalroom/CheckFeed.java | 4 +- .../co/kirikiri/domain/goalroom/GoalRoom.java | 5 +- .../domain/goalroom/GoalRoomMember.java | 2 +- .../domain/goalroom/GoalRoomMembers.java | 4 +- .../goalroom/GoalRoomPendingMember.java | 2 +- .../goalroom/GoalRoomPendingMembers.java | 4 +- .../domain/goalroom/GoalRoomRoadmapNode.java | 2 +- .../domain/goalroom/GoalRoomToDo.java | 2 +- .../domain/goalroom/GoalRoomToDoCheck.java | 2 +- .../goalroom/exception/GoalRoomException.java | 2 +- .../co/kirikiri/domain/roadmap/Roadmap.java | 4 +- .../domain/roadmap/RoadmapCategory.java | 2 +- .../domain/roadmap/RoadmapContent.java | 2 +- .../kirikiri/domain/roadmap/RoadmapNode.java | 2 +- .../domain/roadmap/RoadmapNodeImage.java | 4 +- .../domain/roadmap/RoadmapReview.java | 4 +- .../kirikiri/domain/roadmap/RoadmapTag.java | 2 +- .../roadmap/exception/RoadmapException.java | 2 +- .../controller/MemberController.java | 12 +-- .../domain}/EncryptedPassword.java | 6 +- .../member => member/domain}/Gender.java | 2 +- .../member => member/domain}/Member.java | 10 +- .../member => member/domain}/MemberImage.java | 6 +- .../domain}/MemberProfile.java | 4 +- .../domain}/exception/MemberException.java | 4 +- .../domain}/vo/Identifier.java | 4 +- .../member => member/domain}/vo/Nickname.java | 4 +- .../member => member/domain}/vo/Password.java | 4 +- .../persistence}/MemberQueryRepository.java | 4 +- .../MemberQueryRepositoryImpl.java | 10 +- .../persistence}/MemberRepository.java | 8 +- .../service}/MemberService.java | 73 +++++-------- .../service/dto}/MemberDto.java | 2 +- .../service/dto}/MemberInformationDto.java | 2 +- .../dto}/MemberInformationForPublicDto.java | 2 +- .../member/service/dto/MemberJoinDto.java | 16 +++ .../service/dto}/OauthMemberJoinDto.java | 4 +- .../service/dto}/request/GenderType.java | 6 +- .../dto}/request/MemberJoinRequest.java | 2 +- .../dto/response/MemberCheckFeedResponse.java | 11 ++ .../MemberGoalRoomForListResponse.java | 2 +- .../dto/response/MemberGoalRoomResponse.java | 20 ++++ .../MemberGoalRoomRoadmapNodeResponse.java | 12 +++ .../MemberGoalRoomRoadmapNodesResponse.java | 10 ++ .../MemberGoalRoomToDoCheckResponse.java | 6 ++ .../response/MemberGoalRoomTodoResponse.java | 12 +++ .../MemberInformationForPublicResponse.java | 2 +- .../response/MemberInformationResponse.java | 2 +- .../service/dto}/response/MemberResponse.java | 2 +- .../service/mapper/MemberMapper.java | 22 ++-- .../QuerydslRepositorySupporter.java | 2 +- .../persistence/dto/RoadmapSearchTagName.java | 2 +- .../persistence/dto/RoadmapSearchTitle.java | 2 +- .../CheckFeedQueryRepositoryImpl.java | 4 +- .../GoalRoomMemberQueryRepository.java | 2 +- .../GoalRoomMemberQueryRepositoryImpl.java | 6 +- .../goalroom/GoalRoomMemberRepository.java | 2 +- ...lRoomPendingMemberQueryRepositoryImpl.java | 4 +- .../GoalRoomPendingMemberRepository.java | 2 +- .../goalroom/GoalRoomQueryRepository.java | 2 +- .../goalroom/GoalRoomQueryRepositoryImpl.java | 2 +- .../goalroom/GoalRoomToDoCheckRepository.java | 2 +- .../roadmap/RoadmapQueryRepository.java | 2 +- .../roadmap/RoadmapQueryRepositoryImpl.java | 6 +- .../RoadmapReviewQueryRepositoryImpl.java | 2 +- .../roadmap/RoadmapReviewRepository.java | 2 +- .../service/RandomNumberGenerator.java | 3 +- .../service/UUIDFilePathGenerator.java | 4 +- .../dto/auth/AuthenticationTokenDto.java | 7 -- .../kirikiri/service/dto/auth/LoginDto.java | 11 -- .../dto/goalroom/GoalRoomCheckFeedDto.java | 2 +- .../goalroom/MemberGoalRoomForListDto.java | 2 +- .../dto/goalroom/RoadmapGoalRoomDto.java | 3 +- .../response/GoalRoomCheckFeedResponse.java | 2 +- .../service/dto/member/MemberJoinDto.java | 16 --- .../response/MemberGoalRoomResponse.java | 23 ---- .../service/dto/roadmap/RoadmapDto.java | 2 +- .../dto/roadmap/RoadmapForListDto.java | 2 +- .../service/dto/roadmap/RoadmapReviewDto.java | 2 +- .../dto/roadmap/RoadmapReviewReadDto.java | 2 +- .../response/RoadmapForListResponse.java | 2 +- .../response/RoadmapGoalRoomResponse.java | 2 +- .../dto/roadmap/response/RoadmapResponse.java | 2 +- .../response/RoadmapReviewResponse.java | 4 +- .../goalroom/GoalRoomCreateService.java | 20 ++-- .../service/goalroom/GoalRoomReadService.java | 23 ++-- .../service/mapper/GoalRoomMapper.java | 57 ++++++---- .../service/mapper/RoadmapMapper.java | 8 +- .../roadmap/RoadmapCreateEventListener.java | 14 +-- .../service/roadmap/RoadmapCreateService.java | 18 ++-- .../service/roadmap/RoadmapReadService.java | 14 +-- .../service/scheduler/GoalRoomScheduler.java | 4 +- .../service/scheduler/RoadmapScheduler.java | 2 +- .../controller/AuthCreateApiTest.java | 16 +-- .../interceptor/AuthInterceptorImplTest.java} | 10 +- .../RefreshTokenRepositoryTest.java | 16 +-- ...erIdentifierArgumentResolverImplTest.java} | 13 +-- .../{ => auth}/service/AuthServiceTest.java | 30 +++--- .../service/JwtTokenProviderTest.java | 6 +- .../NaverOauthNetworkServiceTest.java | 7 +- .../service/NaverOauthServiceTest.java | 36 ++++--- .../RoadmapSaveArgumentResolverTest.java | 4 +- .../service/CacheKeyGeneratorTest.java | 2 +- .../controller/GoalRoomCreateApiTest.java | 4 +- .../controller/GoalRoomReadApiTest.java | 36 ++++--- .../controller/MemberCreateApiTest.java | 11 +- .../controller/MemberReadApiTest.java | 11 +- .../controller/RoadmapCreateApiTest.java | 10 +- .../controller/RoadmapReadApiTest.java | 4 +- .../helper/ControllerTestHelper.java | 10 +- .../domain/goalroom/GoalRoomMemberTest.java | 10 +- .../domain/goalroom/GoalRoomMembersTest.java | 10 +- .../goalroom/GoalRoomPendingMemberTest.java | 14 +-- .../goalroom/GoalRoomPendingMembersTest.java | 12 +-- .../domain/goalroom/GoalRoomTest.java | 14 +-- .../domain/roadmap/RoadmapContentTest.java | 14 +-- .../domain/roadmap/RoadmapNodeImagesTest.java | 2 +- .../domain/roadmap/RoadmapReviewTest.java | 14 +-- .../kirikiri/domain/roadmap/RoadmapTest.java | 14 +-- .../infra/AmazonS3FileServiceTest.java | 4 +- .../kirikiri/infra/CloudFrontServiceTest.java | 3 +- .../AuthenticationIntegrationTest.java | 6 +- .../GoalRoomCreateIntegrationTest.java | 10 +- .../GoalRoomReadIntegrationTest.java | 24 ++--- .../GoalRoomSchedulerIntegrationTest.java | 8 +- .../MemberCreateIntegrationTest.java | 4 +- .../MemberReadIntegrationTest.java | 8 +- .../RoadmapCreateIntegrationTest.java | 12 +-- .../RoadmapReadOrderIntegrationTest.java | 2 +- .../RoadmapReviewCreateIntegrationTest.java | 13 ++- .../RoadmapReviewReadIntegrationTest.java | 14 +-- .../RoadmapSearchIntegrationTest.java | 4 +- .../fixture/AuthenticationAPIFixture.java | 6 +- .../fixture/GoalRoomAPIFixture.java | 8 +- .../integration/fixture/MemberAPIFixture.java | 6 +- .../integration/helper/TestConfig.java | 4 +- .../integration/helper/TestFileService.java | 4 +- .../helper/TestRefreshTokenRepository.java | 2 +- .../helper/TestTransactionService.java | 16 +-- .../domain}/vo/EncryptedPasswordTest.java | 4 +- .../domain}/vo/IdentifierTest.java | 4 +- .../domain}/vo/NicknameTest.java | 4 +- .../domain}/vo/PasswordTest.java | 4 +- .../persistence}/MemberRepositoryTest.java | 22 ++-- .../service/MemberServiceTest.java | 101 +++++++++--------- .../dto/RoadmapSearchTagNameTest.java | 2 +- .../dto/RoadmapSearchTitleTest.java | 2 +- .../goalroom/CheckFeedRepositoryTest.java | 20 ++-- .../GoalRoomMemberRepositoryTest.java | 20 ++-- .../GoalRoomPendingMemberRepositoryTest.java | 20 ++-- .../goalroom/GoalRoomRepositoryTest.java | 16 +-- .../GoalRoomToDoCheckRepositoryTest.java | 16 +-- .../roadmap/RoadmapContentRepositoryTest.java | 16 +-- .../roadmap/RoadmapRepositoryTest.java | 20 ++-- .../roadmap/RoadmapReviewRepositoryTest.java | 20 ++-- .../service/GoalRoomCreateServiceTest.java | 26 ++--- .../service/GoalRoomReadServiceTest.java | 69 ++++++------ .../service/GoalRoomSchedulerTest.java | 16 +-- .../RoadmapCreateEventListenerTest.java | 20 ++-- .../service/RoadmapCreateServiceTest.java | 26 ++--- .../service/RoadmapReadServiceTest.java | 25 ++--- .../service/RoadmapSchedulerTest.java | 14 +-- .../service/UUIDFilePathGeneratorTest.java | 4 +- .../dto/member/request/GenderTypeTest.java | 1 + 215 files changed, 1059 insertions(+), 981 deletions(-) rename backend/kirikiri/src/main/java/co/kirikiri/{ => auth}/controller/AuthController.java (84%) rename backend/kirikiri/src/main/java/co/kirikiri/{ => auth}/infra/NaverOauthNetworkService.java (96%) create mode 100644 backend/kirikiri/src/main/java/co/kirikiri/auth/interceptor/AuthInterceptorImpl.java rename backend/kirikiri/src/main/java/co/kirikiri/{persistence/auth => auth/persistence}/RefreshTokenRepository.java (85%) rename backend/kirikiri/src/main/java/co/kirikiri/{persistence/auth => auth/persistence}/RefreshTokenRepositoryImpl.java (97%) create mode 100644 backend/kirikiri/src/main/java/co/kirikiri/auth/resolver/MemberIdentifierArgumentResolverImpl.java rename backend/kirikiri/src/main/java/co/kirikiri/{service/auth => auth/service}/AuthService.java (83%) rename backend/kirikiri/src/main/java/co/kirikiri/{service/auth => auth/service}/JwtTokenProvider.java (97%) rename backend/kirikiri/src/main/java/co/kirikiri/{service/auth => auth/service}/NaverOauthService.java (72%) rename backend/kirikiri/src/main/java/co/kirikiri/{ => auth}/service/OauthNetworkService.java (90%) rename backend/kirikiri/src/main/java/co/kirikiri/{service/auth => auth/service}/TokenProvider.java (92%) create mode 100644 backend/kirikiri/src/main/java/co/kirikiri/auth/service/dto/LoginDto.java rename backend/kirikiri/src/main/java/co/kirikiri/{service/dto/auth => auth/service/dto}/NaverMemberProfileDto.java (89%) rename backend/kirikiri/src/main/java/co/kirikiri/{service/dto/auth => auth/service/dto}/NaverMemberProfileResponseDto.java (89%) rename backend/kirikiri/src/main/java/co/kirikiri/{service/dto/auth => auth/service/dto}/NaverOauthTokenDto.java (90%) rename backend/kirikiri/src/main/java/co/kirikiri/{service/dto/auth => auth/service/dto}/OauthRedirectResponse.java (69%) rename backend/kirikiri/src/main/java/co/kirikiri/{service/dto/auth => auth/service/dto}/request/LoginRequest.java (86%) rename backend/kirikiri/src/main/java/co/kirikiri/{service/dto/auth => auth/service/dto}/request/ReissueTokenRequest.java (81%) rename backend/kirikiri/src/main/java/co/kirikiri/{service/dto/auth => auth/service/dto}/response/AuthenticationResponse.java (68%) rename backend/kirikiri/src/main/java/co/kirikiri/{ => auth}/service/mapper/AuthMapper.java (66%) rename backend/kirikiri/src/main/java/co/kirikiri/{ => auth}/service/mapper/OauthMapper.java (66%) rename backend/kirikiri/src/main/java/co/kirikiri/{service => common}/aop/ExceptionConvert.java (89%) rename backend/kirikiri/src/main/java/co/kirikiri/{service => common}/aop/ExceptionConvertAop.java (59%) rename backend/kirikiri/src/main/java/co/kirikiri/{ => common}/controller/GlobalExceptionHandler.java (92%) rename backend/kirikiri/src/main/java/co/kirikiri/{domain => common/entity}/BaseCreatedTimeEntity.java (95%) rename backend/kirikiri/src/main/java/co/kirikiri/{domain => common/entity}/BaseEntity.java (95%) rename backend/kirikiri/src/main/java/co/kirikiri/{domain => common/entity}/BaseUpdatedTimeEntity.java (96%) rename backend/kirikiri/src/main/java/co/kirikiri/{service => common}/exception/AuthenticationException.java (80%) rename backend/kirikiri/src/main/java/co/kirikiri/{service => common}/exception/BadRequestException.java (79%) rename backend/kirikiri/src/main/java/co/kirikiri/{service => common}/exception/BusinessException.java (78%) rename backend/kirikiri/src/main/java/co/kirikiri/{service => common}/exception/ConflictException.java (78%) rename backend/kirikiri/src/main/java/co/kirikiri/{domain => common}/exception/DomainException.java (78%) rename backend/kirikiri/src/main/java/co/kirikiri/{service => common}/exception/ForbiddenException.java (79%) rename backend/kirikiri/src/main/java/co/kirikiri/{domain => common}/exception/ImageExtensionException.java (80%) rename backend/kirikiri/src/main/java/co/kirikiri/{service => common}/exception/NotFoundException.java (78%) rename backend/kirikiri/src/main/java/co/kirikiri/{service => common}/exception/ServerException.java (78%) rename backend/kirikiri/src/main/java/co/kirikiri/{domain => common}/exception/UnexpectedDomainException.java (80%) rename backend/kirikiri/src/main/java/co/kirikiri/{ => common}/infra/AmazonS3FileService.java (96%) rename backend/kirikiri/src/main/java/co/kirikiri/{ => common}/infra/CloudFrontService.java (93%) rename backend/kirikiri/src/main/java/co/kirikiri/{ => common}/service/CacheKeyGenerator.java (95%) rename backend/kirikiri/src/main/java/co/kirikiri/{ => common}/service/FilePathGenerator.java (59%) rename backend/kirikiri/src/main/java/co/kirikiri/{ => common}/service/FileService.java (89%) rename backend/kirikiri/src/main/java/co/kirikiri/{ => common}/service/NumberGenerator.java (62%) rename backend/kirikiri/src/main/java/co/kirikiri/{domain => common/type}/ImageContentType.java (86%) rename backend/kirikiri/src/main/java/co/kirikiri/{service => common/type}/ImageDirType.java (90%) rename backend/kirikiri/src/main/java/co/kirikiri/{ => member}/controller/MemberController.java (85%) rename backend/kirikiri/src/main/java/co/kirikiri/{domain/member => member/domain}/EncryptedPassword.java (93%) rename backend/kirikiri/src/main/java/co/kirikiri/{domain/member => member/domain}/Gender.java (63%) rename backend/kirikiri/src/main/java/co/kirikiri/{domain/member => member/domain}/Member.java (91%) rename backend/kirikiri/src/main/java/co/kirikiri/{domain/member => member/domain}/MemberImage.java (84%) rename backend/kirikiri/src/main/java/co/kirikiri/{domain/member => member/domain}/MemberProfile.java (89%) rename backend/kirikiri/src/main/java/co/kirikiri/{domain/member => member/domain}/exception/MemberException.java (58%) rename backend/kirikiri/src/main/java/co/kirikiri/{domain/member => member/domain}/vo/Identifier.java (92%) rename backend/kirikiri/src/main/java/co/kirikiri/{domain/member => member/domain}/vo/Nickname.java (92%) rename backend/kirikiri/src/main/java/co/kirikiri/{domain/member => member/domain}/vo/Password.java (90%) rename backend/kirikiri/src/main/java/co/kirikiri/{persistence/member => member/persistence}/MemberQueryRepository.java (74%) rename backend/kirikiri/src/main/java/co/kirikiri/{persistence/member => member/persistence}/MemberQueryRepositoryImpl.java (81%) rename backend/kirikiri/src/main/java/co/kirikiri/{persistence/member => member/persistence}/MemberRepository.java (68%) rename backend/kirikiri/src/main/java/co/kirikiri/{service/member => member/service}/MemberService.java (71%) rename backend/kirikiri/src/main/java/co/kirikiri/{service/dto/member => member/service/dto}/MemberDto.java (70%) rename backend/kirikiri/src/main/java/co/kirikiri/{service/dto/member => member/service/dto}/MemberInformationDto.java (82%) rename backend/kirikiri/src/main/java/co/kirikiri/{service/dto/member => member/service/dto}/MemberInformationForPublicDto.java (76%) create mode 100644 backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/MemberJoinDto.java rename backend/kirikiri/src/main/java/co/kirikiri/{service/dto/member => member/service/dto}/OauthMemberJoinDto.java (58%) rename backend/kirikiri/src/main/java/co/kirikiri/{service/dto/member => member/service/dto}/request/GenderType.java (68%) rename backend/kirikiri/src/main/java/co/kirikiri/{service/dto/member => member/service/dto}/request/MemberJoinRequest.java (94%) create mode 100644 backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberCheckFeedResponse.java rename backend/kirikiri/src/main/java/co/kirikiri/{service/dto/member => member/service/dto}/response/MemberGoalRoomForListResponse.java (88%) create mode 100644 backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomResponse.java create mode 100644 backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomRoadmapNodeResponse.java create mode 100644 backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomRoadmapNodesResponse.java create mode 100644 backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomToDoCheckResponse.java create mode 100644 backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomTodoResponse.java rename backend/kirikiri/src/main/java/co/kirikiri/{service/dto/member => member/service/dto}/response/MemberInformationForPublicResponse.java (73%) rename backend/kirikiri/src/main/java/co/kirikiri/{service/dto/member => member/service/dto}/response/MemberInformationResponse.java (79%) rename backend/kirikiri/src/main/java/co/kirikiri/{service/dto/member => member/service/dto}/response/MemberResponse.java (67%) rename backend/kirikiri/src/main/java/co/kirikiri/{ => member}/service/mapper/MemberMapper.java (71%) delete mode 100644 backend/kirikiri/src/main/java/co/kirikiri/service/dto/auth/AuthenticationTokenDto.java delete mode 100644 backend/kirikiri/src/main/java/co/kirikiri/service/dto/auth/LoginDto.java delete mode 100644 backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/MemberJoinDto.java delete mode 100644 backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/response/MemberGoalRoomResponse.java rename backend/kirikiri/src/test/java/co/kirikiri/{ => auth}/controller/AuthCreateApiTest.java (97%) rename backend/kirikiri/src/test/java/co/kirikiri/{common/interceptor/AuthInterceptorTest.java => auth/interceptor/AuthInterceptorImplTest.java} (93%) rename backend/kirikiri/src/test/java/co/kirikiri/{persistence/auth => auth/persistence}/RefreshTokenRepositoryTest.java (89%) rename backend/kirikiri/src/test/java/co/kirikiri/{common/resolver/MemberIdentifierArgumentResolverTest.java => auth/resolver/MemberIdentifierArgumentResolverImplTest.java} (93%) rename backend/kirikiri/src/test/java/co/kirikiri/{ => auth}/service/AuthServiceTest.java (88%) rename backend/kirikiri/src/test/java/co/kirikiri/{ => auth}/service/JwtTokenProviderTest.java (96%) rename backend/kirikiri/src/test/java/co/kirikiri/{infra => auth/service}/NaverOauthNetworkServiceTest.java (93%) rename backend/kirikiri/src/test/java/co/kirikiri/{ => auth}/service/NaverOauthServiceTest.java (83%) rename backend/kirikiri/src/test/java/co/kirikiri/{ => common}/service/CacheKeyGeneratorTest.java (96%) rename backend/kirikiri/src/test/java/co/kirikiri/{domain/member => member/domain}/vo/EncryptedPasswordTest.java (87%) rename backend/kirikiri/src/test/java/co/kirikiri/{domain/member => member/domain}/vo/IdentifierTest.java (90%) rename backend/kirikiri/src/test/java/co/kirikiri/{domain/member => member/domain}/vo/NicknameTest.java (90%) rename backend/kirikiri/src/test/java/co/kirikiri/{domain/member => member/domain}/vo/PasswordTest.java (96%) rename backend/kirikiri/src/test/java/co/kirikiri/{persistence/member => member/persistence}/MemberRepositoryTest.java (87%) rename backend/kirikiri/src/test/java/co/kirikiri/{ => member}/service/MemberServiceTest.java (77%) diff --git a/backend/kirikiri/src/main/java/co/kirikiri/controller/AuthController.java b/backend/kirikiri/src/main/java/co/kirikiri/auth/controller/AuthController.java similarity index 84% rename from backend/kirikiri/src/main/java/co/kirikiri/controller/AuthController.java rename to backend/kirikiri/src/main/java/co/kirikiri/auth/controller/AuthController.java index dfbdd8620..42e90f863 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/controller/AuthController.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/auth/controller/AuthController.java @@ -1,12 +1,13 @@ -package co.kirikiri.controller; +package co.kirikiri.auth.controller; -import co.kirikiri.service.auth.AuthService; -import co.kirikiri.service.auth.NaverOauthService; -import co.kirikiri.service.dto.auth.OauthRedirectResponse; -import co.kirikiri.service.dto.auth.request.LoginRequest; -import co.kirikiri.service.dto.auth.request.ReissueTokenRequest; -import co.kirikiri.service.dto.auth.response.AuthenticationResponse; +import co.kirikiri.auth.service.AuthService; +import co.kirikiri.auth.service.NaverOauthService; +import co.kirikiri.auth.service.dto.OauthRedirectResponse; +import co.kirikiri.auth.service.dto.request.LoginRequest; +import co.kirikiri.auth.service.dto.request.ReissueTokenRequest; +import co.kirikiri.auth.service.dto.response.AuthenticationResponse; import jakarta.validation.Valid; +import java.util.Map; import lombok.RequiredArgsConstructor; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; @@ -15,7 +16,6 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import java.util.Map; @RestController @RequestMapping("/auth") diff --git a/backend/kirikiri/src/main/java/co/kirikiri/infra/NaverOauthNetworkService.java b/backend/kirikiri/src/main/java/co/kirikiri/auth/infra/NaverOauthNetworkService.java similarity index 96% rename from backend/kirikiri/src/main/java/co/kirikiri/infra/NaverOauthNetworkService.java rename to backend/kirikiri/src/main/java/co/kirikiri/auth/infra/NaverOauthNetworkService.java index 6cd0e7cd1..c5e29670b 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/infra/NaverOauthNetworkService.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/auth/infra/NaverOauthNetworkService.java @@ -1,6 +1,7 @@ -package co.kirikiri.infra; +package co.kirikiri.auth.infra; -import co.kirikiri.service.OauthNetworkService; +import co.kirikiri.auth.service.OauthNetworkService; +import java.util.Map; import lombok.RequiredArgsConstructor; import org.springframework.core.env.Environment; import org.springframework.http.HttpEntity; @@ -9,7 +10,6 @@ import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; import org.springframework.web.client.RestTemplate; -import java.util.Map; @Service @RequiredArgsConstructor diff --git a/backend/kirikiri/src/main/java/co/kirikiri/auth/interceptor/AuthInterceptorImpl.java b/backend/kirikiri/src/main/java/co/kirikiri/auth/interceptor/AuthInterceptorImpl.java new file mode 100644 index 000000000..279b934e6 --- /dev/null +++ b/backend/kirikiri/src/main/java/co/kirikiri/auth/interceptor/AuthInterceptorImpl.java @@ -0,0 +1,48 @@ +package co.kirikiri.auth.interceptor; + +import co.kirikiri.auth.service.AuthService; +import co.kirikiri.common.exception.AuthenticationException; +import co.kirikiri.common.interceptor.AuthInterceptor; +import co.kirikiri.common.interceptor.Authenticated; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpHeaders; +import org.springframework.stereotype.Component; +import org.springframework.web.method.HandlerMethod; + +@Component +@RequiredArgsConstructor +public class AuthInterceptorImpl implements AuthInterceptor { + + private static final String BEARER = "Bearer "; + + private final AuthService authService; + + @Override + public boolean preHandle(final HttpServletRequest request, final HttpServletResponse response, + final Object handler) { + if (!(handler instanceof final HandlerMethod handlerMethod)) { + return true; + } + if (handlerMethod.hasMethodAnnotation(Authenticated.class)) { + final String authorizationHeader = request.getHeader(HttpHeaders.AUTHORIZATION); + checkHeader(authorizationHeader); + final String token = authorizationHeader.substring(BEARER.length()); + checkTokenCertify(token); + } + return true; + } + + private void checkHeader(final String authorizationHeader) { + if (authorizationHeader == null || !authorizationHeader.startsWith(BEARER)) { + throw new AuthenticationException("인증 헤더가 적절하지 않습니다."); + } + } + + private void checkTokenCertify(final String token) { + if (!authService.isCertified(token)) { + throw new AuthenticationException("토큰이 유효하지 않습니다."); + } + } +} diff --git a/backend/kirikiri/src/main/java/co/kirikiri/persistence/auth/RefreshTokenRepository.java b/backend/kirikiri/src/main/java/co/kirikiri/auth/persistence/RefreshTokenRepository.java similarity index 85% rename from backend/kirikiri/src/main/java/co/kirikiri/persistence/auth/RefreshTokenRepository.java rename to backend/kirikiri/src/main/java/co/kirikiri/auth/persistence/RefreshTokenRepository.java index 18e789945..de96a27fb 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/persistence/auth/RefreshTokenRepository.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/auth/persistence/RefreshTokenRepository.java @@ -1,4 +1,4 @@ -package co.kirikiri.persistence.auth; +package co.kirikiri.auth.persistence; import java.util.Optional; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/persistence/auth/RefreshTokenRepositoryImpl.java b/backend/kirikiri/src/main/java/co/kirikiri/auth/persistence/RefreshTokenRepositoryImpl.java similarity index 97% rename from backend/kirikiri/src/main/java/co/kirikiri/persistence/auth/RefreshTokenRepositoryImpl.java rename to backend/kirikiri/src/main/java/co/kirikiri/auth/persistence/RefreshTokenRepositoryImpl.java index 7ca0a5de2..f6985f6e2 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/persistence/auth/RefreshTokenRepositoryImpl.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/auth/persistence/RefreshTokenRepositoryImpl.java @@ -1,4 +1,4 @@ -package co.kirikiri.persistence.auth; +package co.kirikiri.auth.persistence; import java.util.Optional; import java.util.concurrent.TimeUnit; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/auth/resolver/MemberIdentifierArgumentResolverImpl.java b/backend/kirikiri/src/main/java/co/kirikiri/auth/resolver/MemberIdentifierArgumentResolverImpl.java new file mode 100644 index 000000000..9d9357ca3 --- /dev/null +++ b/backend/kirikiri/src/main/java/co/kirikiri/auth/resolver/MemberIdentifierArgumentResolverImpl.java @@ -0,0 +1,48 @@ +package co.kirikiri.auth.resolver; + +import co.kirikiri.auth.service.AuthService; +import co.kirikiri.common.exception.AuthenticationException; +import co.kirikiri.common.exception.ServerException; +import co.kirikiri.common.interceptor.Authenticated; +import co.kirikiri.common.resolver.MemberIdentifier; +import co.kirikiri.common.resolver.MemberIdentifierArgumentResolver; +import lombok.RequiredArgsConstructor; +import org.springframework.core.MethodParameter; +import org.springframework.http.HttpHeaders; +import org.springframework.stereotype.Component; +import org.springframework.web.bind.support.WebDataBinderFactory; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.method.support.ModelAndViewContainer; + +@Component +@RequiredArgsConstructor +public class MemberIdentifierArgumentResolverImpl implements MemberIdentifierArgumentResolver { + + private static final String BEARER = "Bearer "; + + private final AuthService authService; + + @Override + public boolean supportsParameter(final MethodParameter parameter) { + if (!parameter.hasMethodAnnotation(Authenticated.class)) { + throw new ServerException("MemberIdentifier는 인증된 사용자만 사용 가능합니다. (@Authenticated)"); + } + return parameter.getParameterType().equals(String.class) + && parameter.hasParameterAnnotation(MemberIdentifier.class); + } + + @Override + public String resolveArgument(final MethodParameter parameter, final ModelAndViewContainer mavContainer, + final NativeWebRequest webRequest, final WebDataBinderFactory binderFactory) { + final String authorizationHeader = webRequest.getHeader(HttpHeaders.AUTHORIZATION); + checkHeader(authorizationHeader); + final String token = authorizationHeader.substring(BEARER.length()); + return authService.findIdentifierByToken(token); + } + + private void checkHeader(final String authorizationHeader) { + if (authorizationHeader == null || !authorizationHeader.startsWith(BEARER)) { + throw new AuthenticationException("인증 헤더가 적절하지 않습니다."); + } + } +} diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/auth/AuthService.java b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/AuthService.java similarity index 83% rename from backend/kirikiri/src/main/java/co/kirikiri/service/auth/AuthService.java rename to backend/kirikiri/src/main/java/co/kirikiri/auth/service/AuthService.java index f8cc195f0..74c13ba6a 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/auth/AuthService.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/AuthService.java @@ -1,17 +1,17 @@ -package co.kirikiri.service.auth; +package co.kirikiri.auth.service; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Password; -import co.kirikiri.persistence.auth.RefreshTokenRepository; -import co.kirikiri.persistence.member.MemberRepository; -import co.kirikiri.service.aop.ExceptionConvert; -import co.kirikiri.service.dto.auth.LoginDto; -import co.kirikiri.service.dto.auth.request.LoginRequest; -import co.kirikiri.service.dto.auth.request.ReissueTokenRequest; -import co.kirikiri.service.dto.auth.response.AuthenticationResponse; -import co.kirikiri.service.exception.AuthenticationException; -import co.kirikiri.service.mapper.AuthMapper; +import co.kirikiri.auth.persistence.RefreshTokenRepository; +import co.kirikiri.auth.service.dto.LoginDto; +import co.kirikiri.auth.service.dto.request.LoginRequest; +import co.kirikiri.auth.service.dto.request.ReissueTokenRequest; +import co.kirikiri.auth.service.dto.response.AuthenticationResponse; +import co.kirikiri.auth.service.mapper.AuthMapper; +import co.kirikiri.common.aop.ExceptionConvert; +import co.kirikiri.common.exception.AuthenticationException; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Password; +import co.kirikiri.member.persistence.MemberRepository; import java.util.Map; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/auth/JwtTokenProvider.java b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/JwtTokenProvider.java similarity index 97% rename from backend/kirikiri/src/main/java/co/kirikiri/service/auth/JwtTokenProvider.java rename to backend/kirikiri/src/main/java/co/kirikiri/auth/service/JwtTokenProvider.java index 2b91cf904..77087e048 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/auth/JwtTokenProvider.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/JwtTokenProvider.java @@ -1,6 +1,6 @@ -package co.kirikiri.service.auth; +package co.kirikiri.auth.service; -import co.kirikiri.service.exception.AuthenticationException; +import co.kirikiri.common.exception.AuthenticationException; import io.jsonwebtoken.Claims; import io.jsonwebtoken.ExpiredJwtException; import io.jsonwebtoken.Jws; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/auth/NaverOauthService.java b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/NaverOauthService.java similarity index 72% rename from backend/kirikiri/src/main/java/co/kirikiri/service/auth/NaverOauthService.java rename to backend/kirikiri/src/main/java/co/kirikiri/auth/service/NaverOauthService.java index d0630697e..4c977af84 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/auth/NaverOauthService.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/NaverOauthService.java @@ -1,17 +1,16 @@ -package co.kirikiri.service.auth; +package co.kirikiri.auth.service; -import co.kirikiri.domain.member.Member; -import co.kirikiri.persistence.member.MemberRepository; -import co.kirikiri.service.OauthNetworkService; -import co.kirikiri.service.dto.auth.NaverMemberProfileDto; -import co.kirikiri.service.dto.auth.NaverMemberProfileResponseDto; -import co.kirikiri.service.dto.auth.NaverOauthTokenDto; -import co.kirikiri.service.dto.auth.OauthRedirectResponse; -import co.kirikiri.service.dto.auth.response.AuthenticationResponse; -import co.kirikiri.service.dto.member.OauthMemberJoinDto; -import co.kirikiri.service.dto.member.request.GenderType; -import co.kirikiri.service.mapper.OauthMapper; -import co.kirikiri.service.member.MemberService; +import co.kirikiri.auth.service.dto.NaverMemberProfileDto; +import co.kirikiri.auth.service.dto.NaverMemberProfileResponseDto; +import co.kirikiri.auth.service.dto.NaverOauthTokenDto; +import co.kirikiri.auth.service.dto.OauthRedirectResponse; +import co.kirikiri.auth.service.dto.response.AuthenticationResponse; +import co.kirikiri.auth.service.mapper.OauthMapper; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.persistence.MemberRepository; +import co.kirikiri.member.service.MemberService; +import co.kirikiri.member.service.dto.OauthMemberJoinDto; +import co.kirikiri.member.service.dto.request.GenderType; import java.math.BigInteger; import java.security.SecureRandom; import java.util.Map; @@ -58,17 +57,19 @@ private String getProperty(final String property) { @Transactional public AuthenticationResponse login(final Map queryParams) { - final NaverOauthTokenDto naverOauthTokenDto = oauthNetworkService.requestToken(NaverOauthTokenDto.class, - queryParams).getBody(); + final NaverOauthTokenDto naverOauthTokenDto = oauthNetworkService.requestToken(NaverOauthTokenDto.class, queryParams) + .getBody(); final NaverMemberProfileDto naverMemberProfileDto = getNaverMemberProfileDto(naverOauthTokenDto.accessToken()); final NaverMemberProfileResponseDto naverMemberProfileResponseDto = naverMemberProfileDto.response(); final Optional optionalMember = memberRepository.findByOauthId(naverMemberProfileResponseDto.id()); - if (optionalMember.isPresent()) { - final Member member = optionalMember.get(); - return authService.oauthLogin(member); - } + final Member savedMember = optionalMember.orElseGet(() -> saveMember(naverMemberProfileResponseDto)); + return authService.oauthLogin(savedMember); + } + + private Member saveMember(final NaverMemberProfileResponseDto naverMemberProfileResponseDto) { return memberService.oauthJoin( - new OauthMemberJoinDto(naverMemberProfileResponseDto.id(), naverMemberProfileResponseDto.email(), + new OauthMemberJoinDto(naverMemberProfileResponseDto.id(), + naverMemberProfileResponseDto.email(), naverMemberProfileResponseDto.nickname(), GenderType.findByOauthType(naverMemberProfileResponseDto.gender()))); } diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/OauthNetworkService.java b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/OauthNetworkService.java similarity index 90% rename from backend/kirikiri/src/main/java/co/kirikiri/service/OauthNetworkService.java rename to backend/kirikiri/src/main/java/co/kirikiri/auth/service/OauthNetworkService.java index ad5f67286..c02d8da92 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/OauthNetworkService.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/OauthNetworkService.java @@ -1,7 +1,7 @@ -package co.kirikiri.service; +package co.kirikiri.auth.service; -import org.springframework.http.ResponseEntity; import java.util.Map; +import org.springframework.http.ResponseEntity; public interface OauthNetworkService { diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/auth/TokenProvider.java b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/TokenProvider.java similarity index 92% rename from backend/kirikiri/src/main/java/co/kirikiri/service/auth/TokenProvider.java rename to backend/kirikiri/src/main/java/co/kirikiri/auth/service/TokenProvider.java index 3bed60faa..1d9ffd184 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/auth/TokenProvider.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/TokenProvider.java @@ -1,4 +1,4 @@ -package co.kirikiri.service.auth; +package co.kirikiri.auth.service; import java.time.LocalDateTime; import java.util.Map; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/auth/service/dto/LoginDto.java b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/dto/LoginDto.java new file mode 100644 index 000000000..48c9f3ec6 --- /dev/null +++ b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/dto/LoginDto.java @@ -0,0 +1,11 @@ +package co.kirikiri.auth.service.dto; + +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Password; + +public record LoginDto( + Identifier identifier, + Password password +) { + +} diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/auth/NaverMemberProfileDto.java b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/dto/NaverMemberProfileDto.java similarity index 89% rename from backend/kirikiri/src/main/java/co/kirikiri/service/dto/auth/NaverMemberProfileDto.java rename to backend/kirikiri/src/main/java/co/kirikiri/auth/service/dto/NaverMemberProfileDto.java index 66218b592..854c6e909 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/auth/NaverMemberProfileDto.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/dto/NaverMemberProfileDto.java @@ -1,4 +1,4 @@ -package co.kirikiri.service.dto.auth; +package co.kirikiri.auth.service.dto; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/auth/NaverMemberProfileResponseDto.java b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/dto/NaverMemberProfileResponseDto.java similarity index 89% rename from backend/kirikiri/src/main/java/co/kirikiri/service/dto/auth/NaverMemberProfileResponseDto.java rename to backend/kirikiri/src/main/java/co/kirikiri/auth/service/dto/NaverMemberProfileResponseDto.java index c2e073300..e588d720c 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/auth/NaverMemberProfileResponseDto.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/dto/NaverMemberProfileResponseDto.java @@ -1,4 +1,4 @@ -package co.kirikiri.service.dto.auth; +package co.kirikiri.auth.service.dto; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/auth/NaverOauthTokenDto.java b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/dto/NaverOauthTokenDto.java similarity index 90% rename from backend/kirikiri/src/main/java/co/kirikiri/service/dto/auth/NaverOauthTokenDto.java rename to backend/kirikiri/src/main/java/co/kirikiri/auth/service/dto/NaverOauthTokenDto.java index eb3b782ea..e51b0e055 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/auth/NaverOauthTokenDto.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/dto/NaverOauthTokenDto.java @@ -1,4 +1,4 @@ -package co.kirikiri.service.dto.auth; +package co.kirikiri.auth.service.dto; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/auth/OauthRedirectResponse.java b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/dto/OauthRedirectResponse.java similarity index 69% rename from backend/kirikiri/src/main/java/co/kirikiri/service/dto/auth/OauthRedirectResponse.java rename to backend/kirikiri/src/main/java/co/kirikiri/auth/service/dto/OauthRedirectResponse.java index 983d60487..516ff3c08 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/auth/OauthRedirectResponse.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/dto/OauthRedirectResponse.java @@ -1,4 +1,4 @@ -package co.kirikiri.service.dto.auth; +package co.kirikiri.auth.service.dto; public record OauthRedirectResponse( String url, diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/auth/request/LoginRequest.java b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/dto/request/LoginRequest.java similarity index 86% rename from backend/kirikiri/src/main/java/co/kirikiri/service/dto/auth/request/LoginRequest.java rename to backend/kirikiri/src/main/java/co/kirikiri/auth/service/dto/request/LoginRequest.java index cc901cbdf..19c30276f 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/auth/request/LoginRequest.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/dto/request/LoginRequest.java @@ -1,4 +1,4 @@ -package co.kirikiri.service.dto.auth.request; +package co.kirikiri.auth.service.dto.request; import jakarta.validation.constraints.NotBlank; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/auth/request/ReissueTokenRequest.java b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/dto/request/ReissueTokenRequest.java similarity index 81% rename from backend/kirikiri/src/main/java/co/kirikiri/service/dto/auth/request/ReissueTokenRequest.java rename to backend/kirikiri/src/main/java/co/kirikiri/auth/service/dto/request/ReissueTokenRequest.java index 68c220de0..16566c0c3 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/auth/request/ReissueTokenRequest.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/dto/request/ReissueTokenRequest.java @@ -1,4 +1,4 @@ -package co.kirikiri.service.dto.auth.request; +package co.kirikiri.auth.service.dto.request; import jakarta.validation.constraints.NotBlank; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/auth/response/AuthenticationResponse.java b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/dto/response/AuthenticationResponse.java similarity index 68% rename from backend/kirikiri/src/main/java/co/kirikiri/service/dto/auth/response/AuthenticationResponse.java rename to backend/kirikiri/src/main/java/co/kirikiri/auth/service/dto/response/AuthenticationResponse.java index 5c71cf9d1..d7c9971dc 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/auth/response/AuthenticationResponse.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/dto/response/AuthenticationResponse.java @@ -1,4 +1,4 @@ -package co.kirikiri.service.dto.auth.response; +package co.kirikiri.auth.service.dto.response; public record AuthenticationResponse( String refreshToken, diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/mapper/AuthMapper.java b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/mapper/AuthMapper.java similarity index 66% rename from backend/kirikiri/src/main/java/co/kirikiri/service/mapper/AuthMapper.java rename to backend/kirikiri/src/main/java/co/kirikiri/auth/service/mapper/AuthMapper.java index 4809ca258..a82e7b6cb 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/mapper/AuthMapper.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/mapper/AuthMapper.java @@ -1,10 +1,10 @@ -package co.kirikiri.service.mapper; +package co.kirikiri.auth.service.mapper; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Password; -import co.kirikiri.service.dto.auth.LoginDto; -import co.kirikiri.service.dto.auth.request.LoginRequest; -import co.kirikiri.service.dto.auth.response.AuthenticationResponse; +import co.kirikiri.auth.service.dto.LoginDto; +import co.kirikiri.auth.service.dto.request.LoginRequest; +import co.kirikiri.auth.service.dto.response.AuthenticationResponse; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Password; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/mapper/OauthMapper.java b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/mapper/OauthMapper.java similarity index 66% rename from backend/kirikiri/src/main/java/co/kirikiri/service/mapper/OauthMapper.java rename to backend/kirikiri/src/main/java/co/kirikiri/auth/service/mapper/OauthMapper.java index d302d2f00..56b08b676 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/mapper/OauthMapper.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/mapper/OauthMapper.java @@ -1,6 +1,6 @@ -package co.kirikiri.service.mapper; +package co.kirikiri.auth.service.mapper; -import co.kirikiri.service.dto.auth.OauthRedirectResponse; +import co.kirikiri.auth.service.dto.OauthRedirectResponse; public class OauthMapper { diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/aop/ExceptionConvert.java b/backend/kirikiri/src/main/java/co/kirikiri/common/aop/ExceptionConvert.java similarity index 89% rename from backend/kirikiri/src/main/java/co/kirikiri/service/aop/ExceptionConvert.java rename to backend/kirikiri/src/main/java/co/kirikiri/common/aop/ExceptionConvert.java index 1a2b42941..9308051f8 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/aop/ExceptionConvert.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/aop/ExceptionConvert.java @@ -1,4 +1,4 @@ -package co.kirikiri.service.aop; +package co.kirikiri.common.aop; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/aop/ExceptionConvertAop.java b/backend/kirikiri/src/main/java/co/kirikiri/common/aop/ExceptionConvertAop.java similarity index 59% rename from backend/kirikiri/src/main/java/co/kirikiri/service/aop/ExceptionConvertAop.java rename to backend/kirikiri/src/main/java/co/kirikiri/common/aop/ExceptionConvertAop.java index 4a9fb96ad..75a043acd 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/aop/ExceptionConvertAop.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/aop/ExceptionConvertAop.java @@ -1,9 +1,9 @@ -package co.kirikiri.service.aop; +package co.kirikiri.common.aop; -import co.kirikiri.domain.exception.DomainException; -import co.kirikiri.domain.exception.UnexpectedDomainException; -import co.kirikiri.service.exception.BadRequestException; -import co.kirikiri.service.exception.ServerException; +import co.kirikiri.common.exception.BadRequestException; +import co.kirikiri.common.exception.DomainException; +import co.kirikiri.common.exception.ServerException; +import co.kirikiri.common.exception.UnexpectedDomainException; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; import org.springframework.stereotype.Component; @@ -12,7 +12,7 @@ @Component public class ExceptionConvertAop { - @AfterThrowing(pointcut = "within(@co.kirikiri.service.aop.ExceptionConvert *)", throwing = "exception") + @AfterThrowing(pointcut = "within(@co.kirikiri.common.aop.ExceptionConvert *)", throwing = "exception") public void convertException(final Throwable exception) { if (exception instanceof UnexpectedDomainException) { throw new ServerException(exception.getMessage()); diff --git a/backend/kirikiri/src/main/java/co/kirikiri/common/config/WebConfig.java b/backend/kirikiri/src/main/java/co/kirikiri/common/config/WebConfig.java index 73fca7c9f..4b19bc9a9 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/common/config/WebConfig.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/config/WebConfig.java @@ -3,12 +3,12 @@ import co.kirikiri.common.interceptor.AuthInterceptor; import co.kirikiri.common.resolver.MemberIdentifierArgumentResolver; import co.kirikiri.common.resolver.RoadmapSaveArgumentResolver; +import java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.context.annotation.Configuration; import org.springframework.web.method.support.HandlerMethodArgumentResolver; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -import java.util.List; @Configuration @RequiredArgsConstructor diff --git a/backend/kirikiri/src/main/java/co/kirikiri/controller/GlobalExceptionHandler.java b/backend/kirikiri/src/main/java/co/kirikiri/common/controller/GlobalExceptionHandler.java similarity index 92% rename from backend/kirikiri/src/main/java/co/kirikiri/controller/GlobalExceptionHandler.java rename to backend/kirikiri/src/main/java/co/kirikiri/common/controller/GlobalExceptionHandler.java index 181ac9cb0..a6298e5b0 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/controller/GlobalExceptionHandler.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/controller/GlobalExceptionHandler.java @@ -1,12 +1,12 @@ -package co.kirikiri.controller; +package co.kirikiri.common.controller; +import co.kirikiri.common.exception.AuthenticationException; +import co.kirikiri.common.exception.BadRequestException; +import co.kirikiri.common.exception.ConflictException; +import co.kirikiri.common.exception.ForbiddenException; +import co.kirikiri.common.exception.NotFoundException; +import co.kirikiri.common.exception.ServerException; import co.kirikiri.service.dto.ErrorResponse; -import co.kirikiri.service.exception.AuthenticationException; -import co.kirikiri.service.exception.BadRequestException; -import co.kirikiri.service.exception.ConflictException; -import co.kirikiri.service.exception.ForbiddenException; -import co.kirikiri.service.exception.NotFoundException; -import co.kirikiri.service.exception.ServerException; import com.fasterxml.jackson.databind.exc.InvalidFormatException; import java.util.List; import org.slf4j.Logger; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/BaseCreatedTimeEntity.java b/backend/kirikiri/src/main/java/co/kirikiri/common/entity/BaseCreatedTimeEntity.java similarity index 95% rename from backend/kirikiri/src/main/java/co/kirikiri/domain/BaseCreatedTimeEntity.java rename to backend/kirikiri/src/main/java/co/kirikiri/common/entity/BaseCreatedTimeEntity.java index 383bd9634..48bf35b69 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/BaseCreatedTimeEntity.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/entity/BaseCreatedTimeEntity.java @@ -1,4 +1,4 @@ -package co.kirikiri.domain; +package co.kirikiri.common.entity; import jakarta.persistence.Column; import jakarta.persistence.MappedSuperclass; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/BaseEntity.java b/backend/kirikiri/src/main/java/co/kirikiri/common/entity/BaseEntity.java similarity index 95% rename from backend/kirikiri/src/main/java/co/kirikiri/domain/BaseEntity.java rename to backend/kirikiri/src/main/java/co/kirikiri/common/entity/BaseEntity.java index a66368c62..4e43ffc23 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/BaseEntity.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/entity/BaseEntity.java @@ -1,4 +1,4 @@ -package co.kirikiri.domain; +package co.kirikiri.common.entity; import jakarta.persistence.GeneratedValue; import jakarta.persistence.GenerationType; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/BaseUpdatedTimeEntity.java b/backend/kirikiri/src/main/java/co/kirikiri/common/entity/BaseUpdatedTimeEntity.java similarity index 96% rename from backend/kirikiri/src/main/java/co/kirikiri/domain/BaseUpdatedTimeEntity.java rename to backend/kirikiri/src/main/java/co/kirikiri/common/entity/BaseUpdatedTimeEntity.java index 7434bf778..c81171865 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/BaseUpdatedTimeEntity.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/entity/BaseUpdatedTimeEntity.java @@ -1,4 +1,4 @@ -package co.kirikiri.domain; +package co.kirikiri.common.entity; import jakarta.persistence.Column; import jakarta.persistence.MappedSuperclass; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/exception/AuthenticationException.java b/backend/kirikiri/src/main/java/co/kirikiri/common/exception/AuthenticationException.java similarity index 80% rename from backend/kirikiri/src/main/java/co/kirikiri/service/exception/AuthenticationException.java rename to backend/kirikiri/src/main/java/co/kirikiri/common/exception/AuthenticationException.java index 6e08c9c38..b0dc6ae73 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/exception/AuthenticationException.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/exception/AuthenticationException.java @@ -1,4 +1,4 @@ -package co.kirikiri.service.exception; +package co.kirikiri.common.exception; public class AuthenticationException extends BusinessException { diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/exception/BadRequestException.java b/backend/kirikiri/src/main/java/co/kirikiri/common/exception/BadRequestException.java similarity index 79% rename from backend/kirikiri/src/main/java/co/kirikiri/service/exception/BadRequestException.java rename to backend/kirikiri/src/main/java/co/kirikiri/common/exception/BadRequestException.java index a6000ad1a..a17573429 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/exception/BadRequestException.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/exception/BadRequestException.java @@ -1,4 +1,4 @@ -package co.kirikiri.service.exception; +package co.kirikiri.common.exception; public class BadRequestException extends BusinessException { diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/exception/BusinessException.java b/backend/kirikiri/src/main/java/co/kirikiri/common/exception/BusinessException.java similarity index 78% rename from backend/kirikiri/src/main/java/co/kirikiri/service/exception/BusinessException.java rename to backend/kirikiri/src/main/java/co/kirikiri/common/exception/BusinessException.java index 404a22614..64ff299a8 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/exception/BusinessException.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/exception/BusinessException.java @@ -1,4 +1,4 @@ -package co.kirikiri.service.exception; +package co.kirikiri.common.exception; public class BusinessException extends RuntimeException { diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/exception/ConflictException.java b/backend/kirikiri/src/main/java/co/kirikiri/common/exception/ConflictException.java similarity index 78% rename from backend/kirikiri/src/main/java/co/kirikiri/service/exception/ConflictException.java rename to backend/kirikiri/src/main/java/co/kirikiri/common/exception/ConflictException.java index dc0103c4a..5d45089e1 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/exception/ConflictException.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/exception/ConflictException.java @@ -1,4 +1,4 @@ -package co.kirikiri.service.exception; +package co.kirikiri.common.exception; public class ConflictException extends BusinessException { diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/exception/DomainException.java b/backend/kirikiri/src/main/java/co/kirikiri/common/exception/DomainException.java similarity index 78% rename from backend/kirikiri/src/main/java/co/kirikiri/domain/exception/DomainException.java rename to backend/kirikiri/src/main/java/co/kirikiri/common/exception/DomainException.java index bf1161db4..6d458a6c9 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/exception/DomainException.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/exception/DomainException.java @@ -1,4 +1,4 @@ -package co.kirikiri.domain.exception; +package co.kirikiri.common.exception; public class DomainException extends RuntimeException { diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/exception/ForbiddenException.java b/backend/kirikiri/src/main/java/co/kirikiri/common/exception/ForbiddenException.java similarity index 79% rename from backend/kirikiri/src/main/java/co/kirikiri/service/exception/ForbiddenException.java rename to backend/kirikiri/src/main/java/co/kirikiri/common/exception/ForbiddenException.java index e945efb65..2671761f2 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/exception/ForbiddenException.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/exception/ForbiddenException.java @@ -1,4 +1,4 @@ -package co.kirikiri.service.exception; +package co.kirikiri.common.exception; public class ForbiddenException extends RuntimeException { diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/exception/ImageExtensionException.java b/backend/kirikiri/src/main/java/co/kirikiri/common/exception/ImageExtensionException.java similarity index 80% rename from backend/kirikiri/src/main/java/co/kirikiri/domain/exception/ImageExtensionException.java rename to backend/kirikiri/src/main/java/co/kirikiri/common/exception/ImageExtensionException.java index 3a8e84f67..1643f0399 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/exception/ImageExtensionException.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/exception/ImageExtensionException.java @@ -1,4 +1,4 @@ -package co.kirikiri.domain.exception; +package co.kirikiri.common.exception; public class ImageExtensionException extends DomainException { diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/exception/NotFoundException.java b/backend/kirikiri/src/main/java/co/kirikiri/common/exception/NotFoundException.java similarity index 78% rename from backend/kirikiri/src/main/java/co/kirikiri/service/exception/NotFoundException.java rename to backend/kirikiri/src/main/java/co/kirikiri/common/exception/NotFoundException.java index 135762e67..f6aa07098 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/exception/NotFoundException.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/exception/NotFoundException.java @@ -1,4 +1,4 @@ -package co.kirikiri.service.exception; +package co.kirikiri.common.exception; public class NotFoundException extends BusinessException { diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/exception/ServerException.java b/backend/kirikiri/src/main/java/co/kirikiri/common/exception/ServerException.java similarity index 78% rename from backend/kirikiri/src/main/java/co/kirikiri/service/exception/ServerException.java rename to backend/kirikiri/src/main/java/co/kirikiri/common/exception/ServerException.java index 105a85b63..1fa9dcd9e 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/exception/ServerException.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/exception/ServerException.java @@ -1,4 +1,4 @@ -package co.kirikiri.service.exception; +package co.kirikiri.common.exception; public class ServerException extends RuntimeException { diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/exception/UnexpectedDomainException.java b/backend/kirikiri/src/main/java/co/kirikiri/common/exception/UnexpectedDomainException.java similarity index 80% rename from backend/kirikiri/src/main/java/co/kirikiri/domain/exception/UnexpectedDomainException.java rename to backend/kirikiri/src/main/java/co/kirikiri/common/exception/UnexpectedDomainException.java index 50735c79e..510f3c6bc 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/exception/UnexpectedDomainException.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/exception/UnexpectedDomainException.java @@ -1,4 +1,4 @@ -package co.kirikiri.domain.exception; +package co.kirikiri.common.exception; public class UnexpectedDomainException extends DomainException { diff --git a/backend/kirikiri/src/main/java/co/kirikiri/infra/AmazonS3FileService.java b/backend/kirikiri/src/main/java/co/kirikiri/common/infra/AmazonS3FileService.java similarity index 96% rename from backend/kirikiri/src/main/java/co/kirikiri/infra/AmazonS3FileService.java rename to backend/kirikiri/src/main/java/co/kirikiri/common/infra/AmazonS3FileService.java index 429359a26..729fca5a6 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/infra/AmazonS3FileService.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/infra/AmazonS3FileService.java @@ -1,8 +1,8 @@ -package co.kirikiri.infra; +package co.kirikiri.common.infra; -import co.kirikiri.service.FileService; +import co.kirikiri.common.exception.ServerException; +import co.kirikiri.common.service.FileService; import co.kirikiri.service.dto.FileInformation; -import co.kirikiri.service.exception.ServerException; import com.amazonaws.SdkClientException; import com.amazonaws.services.s3.AmazonS3; import com.amazonaws.services.s3.model.GeneratePresignedUrlRequest; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/infra/CloudFrontService.java b/backend/kirikiri/src/main/java/co/kirikiri/common/infra/CloudFrontService.java similarity index 93% rename from backend/kirikiri/src/main/java/co/kirikiri/infra/CloudFrontService.java rename to backend/kirikiri/src/main/java/co/kirikiri/common/infra/CloudFrontService.java index 2c95c30ff..fc0cea738 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/infra/CloudFrontService.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/infra/CloudFrontService.java @@ -1,6 +1,6 @@ -package co.kirikiri.infra; +package co.kirikiri.common.infra; -import co.kirikiri.service.exception.ServerException; +import co.kirikiri.common.exception.ServerException; import java.net.MalformedURLException; import java.net.URL; import lombok.RequiredArgsConstructor; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/common/interceptor/AuthInterceptor.java b/backend/kirikiri/src/main/java/co/kirikiri/common/interceptor/AuthInterceptor.java index d2298df5c..6c48d09bd 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/common/interceptor/AuthInterceptor.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/interceptor/AuthInterceptor.java @@ -1,47 +1,6 @@ package co.kirikiri.common.interceptor; -import co.kirikiri.service.auth.AuthService; -import co.kirikiri.service.exception.AuthenticationException; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; -import lombok.RequiredArgsConstructor; -import org.springframework.http.HttpHeaders; -import org.springframework.stereotype.Component; -import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.HandlerInterceptor; -@Component -@RequiredArgsConstructor -public class AuthInterceptor implements HandlerInterceptor { - - private static final String BEARER = "Bearer "; - - private final AuthService authService; - - @Override - public boolean preHandle(final HttpServletRequest request, final HttpServletResponse response, - final Object handler) { - if (!(handler instanceof final HandlerMethod handlerMethod)) { - return true; - } - if (handlerMethod.hasMethodAnnotation(Authenticated.class)) { - final String authorizationHeader = request.getHeader(HttpHeaders.AUTHORIZATION); - checkHeader(authorizationHeader); - final String token = authorizationHeader.substring(BEARER.length()); - checkTokenCertify(token); - } - return true; - } - - private void checkHeader(final String authorizationHeader) { - if (authorizationHeader == null || !authorizationHeader.startsWith(BEARER)) { - throw new AuthenticationException("인증 헤더가 적절하지 않습니다."); - } - } - - private void checkTokenCertify(final String token) { - if (!authService.isCertified(token)) { - throw new AuthenticationException("토큰이 유효하지 않습니다."); - } - } +public interface AuthInterceptor extends HandlerInterceptor { } diff --git a/backend/kirikiri/src/main/java/co/kirikiri/common/resolver/MemberIdentifierArgumentResolver.java b/backend/kirikiri/src/main/java/co/kirikiri/common/resolver/MemberIdentifierArgumentResolver.java index caf9b0e30..9e1d99241 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/common/resolver/MemberIdentifierArgumentResolver.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/resolver/MemberIdentifierArgumentResolver.java @@ -1,47 +1,6 @@ package co.kirikiri.common.resolver; -import co.kirikiri.common.interceptor.Authenticated; -import co.kirikiri.service.auth.AuthService; -import co.kirikiri.service.exception.AuthenticationException; -import co.kirikiri.service.exception.ServerException; -import lombok.RequiredArgsConstructor; -import org.springframework.core.MethodParameter; -import org.springframework.http.HttpHeaders; -import org.springframework.stereotype.Component; -import org.springframework.web.bind.support.WebDataBinderFactory; -import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.method.support.HandlerMethodArgumentResolver; -import org.springframework.web.method.support.ModelAndViewContainer; -@Component -@RequiredArgsConstructor -public class MemberIdentifierArgumentResolver implements HandlerMethodArgumentResolver { - - private static final String BEARER = "Bearer "; - - private final AuthService authService; - - @Override - public boolean supportsParameter(final MethodParameter parameter) { - if (!parameter.hasMethodAnnotation(Authenticated.class)) { - throw new ServerException("MemberIdentifier는 인증된 사용자만 사용 가능합니다. (@Authenticated)"); - } - return parameter.getParameterType().equals(String.class) - && parameter.hasParameterAnnotation(MemberIdentifier.class); - } - - @Override - public String resolveArgument(final MethodParameter parameter, final ModelAndViewContainer mavContainer, - final NativeWebRequest webRequest, final WebDataBinderFactory binderFactory) { - final String authorizationHeader = webRequest.getHeader(HttpHeaders.AUTHORIZATION); - checkHeader(authorizationHeader); - final String token = authorizationHeader.substring(BEARER.length()); - return authService.findIdentifierByToken(token); - } - - private void checkHeader(final String authorizationHeader) { - if (authorizationHeader == null || !authorizationHeader.startsWith(BEARER)) { - throw new AuthenticationException("인증 헤더가 적절하지 않습니다."); - } - } +public interface MemberIdentifierArgumentResolver extends HandlerMethodArgumentResolver { } diff --git a/backend/kirikiri/src/main/java/co/kirikiri/common/resolver/RoadmapSaveArgumentResolver.java b/backend/kirikiri/src/main/java/co/kirikiri/common/resolver/RoadmapSaveArgumentResolver.java index fb080e831..8c668086b 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/common/resolver/RoadmapSaveArgumentResolver.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/resolver/RoadmapSaveArgumentResolver.java @@ -1,8 +1,8 @@ package co.kirikiri.common.resolver; +import co.kirikiri.common.exception.BadRequestException; import co.kirikiri.service.dto.roadmap.request.RoadmapNodeSaveRequest; import co.kirikiri.service.dto.roadmap.request.RoadmapSaveRequest; -import co.kirikiri.service.exception.BadRequestException; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import jakarta.servlet.http.HttpServletRequest; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/CacheKeyGenerator.java b/backend/kirikiri/src/main/java/co/kirikiri/common/service/CacheKeyGenerator.java similarity index 95% rename from backend/kirikiri/src/main/java/co/kirikiri/service/CacheKeyGenerator.java rename to backend/kirikiri/src/main/java/co/kirikiri/common/service/CacheKeyGenerator.java index 2a11fcd5d..1915970c3 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/CacheKeyGenerator.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/service/CacheKeyGenerator.java @@ -1,4 +1,4 @@ -package co.kirikiri.service; +package co.kirikiri.common.service; import java.lang.reflect.Method; import java.util.Arrays; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/FilePathGenerator.java b/backend/kirikiri/src/main/java/co/kirikiri/common/service/FilePathGenerator.java similarity index 59% rename from backend/kirikiri/src/main/java/co/kirikiri/service/FilePathGenerator.java rename to backend/kirikiri/src/main/java/co/kirikiri/common/service/FilePathGenerator.java index 80bcb2120..3bec351fb 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/FilePathGenerator.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/service/FilePathGenerator.java @@ -1,4 +1,6 @@ -package co.kirikiri.service; +package co.kirikiri.common.service; + +import co.kirikiri.common.type.ImageDirType; public interface FilePathGenerator { diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/FileService.java b/backend/kirikiri/src/main/java/co/kirikiri/common/service/FileService.java similarity index 89% rename from backend/kirikiri/src/main/java/co/kirikiri/service/FileService.java rename to backend/kirikiri/src/main/java/co/kirikiri/common/service/FileService.java index 74aa91ac8..af231d532 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/FileService.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/service/FileService.java @@ -1,8 +1,8 @@ -package co.kirikiri.service; +package co.kirikiri.common.service; import co.kirikiri.service.dto.FileInformation; -import org.springframework.http.HttpMethod; import java.net.URL; +import org.springframework.http.HttpMethod; public interface FileService { diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/NumberGenerator.java b/backend/kirikiri/src/main/java/co/kirikiri/common/service/NumberGenerator.java similarity index 62% rename from backend/kirikiri/src/main/java/co/kirikiri/service/NumberGenerator.java rename to backend/kirikiri/src/main/java/co/kirikiri/common/service/NumberGenerator.java index 2c289f458..8c48cc5c4 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/NumberGenerator.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/service/NumberGenerator.java @@ -1,4 +1,4 @@ -package co.kirikiri.service; +package co.kirikiri.common.service; public interface NumberGenerator { diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/ImageContentType.java b/backend/kirikiri/src/main/java/co/kirikiri/common/type/ImageContentType.java similarity index 86% rename from backend/kirikiri/src/main/java/co/kirikiri/domain/ImageContentType.java rename to backend/kirikiri/src/main/java/co/kirikiri/common/type/ImageContentType.java index 9d8a4df07..faf34f204 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/ImageContentType.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/type/ImageContentType.java @@ -1,6 +1,6 @@ -package co.kirikiri.domain; +package co.kirikiri.common.type; -import co.kirikiri.domain.exception.ImageExtensionException; +import co.kirikiri.common.exception.ImageExtensionException; import java.util.Arrays; public enum ImageContentType { diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/ImageDirType.java b/backend/kirikiri/src/main/java/co/kirikiri/common/type/ImageDirType.java similarity index 90% rename from backend/kirikiri/src/main/java/co/kirikiri/service/ImageDirType.java rename to backend/kirikiri/src/main/java/co/kirikiri/common/type/ImageDirType.java index 87f99dfe2..c2f11c400 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/ImageDirType.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/type/ImageDirType.java @@ -1,4 +1,4 @@ -package co.kirikiri.service; +package co.kirikiri.common.type; public enum ImageDirType { CHECK_FEED("goalroom/checkfeed"), diff --git a/backend/kirikiri/src/main/java/co/kirikiri/controller/GoalRoomController.java b/backend/kirikiri/src/main/java/co/kirikiri/controller/GoalRoomController.java index 671c65dd8..d619a6009 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/controller/GoalRoomController.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/controller/GoalRoomController.java @@ -2,6 +2,8 @@ import co.kirikiri.common.interceptor.Authenticated; import co.kirikiri.common.resolver.MemberIdentifier; +import co.kirikiri.member.service.dto.response.MemberGoalRoomForListResponse; +import co.kirikiri.member.service.dto.response.MemberGoalRoomResponse; import co.kirikiri.service.dto.goalroom.GoalRoomMemberSortTypeDto; import co.kirikiri.service.dto.goalroom.request.CheckFeedRequest; import co.kirikiri.service.dto.goalroom.request.GoalRoomCreateRequest; @@ -14,8 +16,6 @@ import co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodeDetailResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomToDoCheckResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomTodoResponse; -import co.kirikiri.service.dto.member.response.MemberGoalRoomForListResponse; -import co.kirikiri.service.dto.member.response.MemberGoalRoomResponse; import co.kirikiri.service.goalroom.GoalRoomCreateService; import co.kirikiri.service.goalroom.GoalRoomReadService; import jakarta.validation.Valid; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/BaseGoalRoomMember.java b/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/BaseGoalRoomMember.java index e034bc6d6..deffacf45 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/BaseGoalRoomMember.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/BaseGoalRoomMember.java @@ -1,7 +1,7 @@ package co.kirikiri.domain.goalroom; -import co.kirikiri.domain.BaseEntity; -import co.kirikiri.domain.member.Member; +import co.kirikiri.common.entity.BaseEntity; +import co.kirikiri.member.domain.Member; import com.querydsl.core.annotations.QueryInit; import jakarta.persistence.EnumType; import jakarta.persistence.Enumerated; @@ -39,13 +39,13 @@ public abstract class BaseGoalRoomMember extends BaseEntity { @QueryInit(value = {"identifier"}) protected Member member; - public BaseGoalRoomMember(final GoalRoomRole role, final LocalDateTime joinedAt, - final GoalRoom goalRoom, final Member member) { + protected BaseGoalRoomMember(final GoalRoomRole role, final LocalDateTime joinedAt, + final GoalRoom goalRoom, final Member member) { this(null, role, joinedAt, goalRoom, member); } - public BaseGoalRoomMember(final Long id, final GoalRoomRole role, final LocalDateTime joinedAt, - final GoalRoom goalRoom, final Member member) { + protected BaseGoalRoomMember(final Long id, final GoalRoomRole role, final LocalDateTime joinedAt, + final GoalRoom goalRoom, final Member member) { this.id = id; this.role = role; this.joinedAt = joinedAt; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/CheckFeed.java b/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/CheckFeed.java index f77f8fe01..9c4a6b1e5 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/CheckFeed.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/CheckFeed.java @@ -1,7 +1,7 @@ package co.kirikiri.domain.goalroom; -import co.kirikiri.domain.BaseCreatedTimeEntity; -import co.kirikiri.domain.ImageContentType; +import co.kirikiri.common.entity.BaseCreatedTimeEntity; +import co.kirikiri.common.type.ImageContentType; import jakarta.persistence.CascadeType; import jakarta.persistence.Column; import jakarta.persistence.Entity; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoom.java b/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoom.java index e10f05f82..6b150b6b5 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoom.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoom.java @@ -1,11 +1,11 @@ package co.kirikiri.domain.goalroom; -import co.kirikiri.domain.BaseUpdatedTimeEntity; +import co.kirikiri.common.entity.BaseUpdatedTimeEntity; import co.kirikiri.domain.goalroom.exception.GoalRoomException; import co.kirikiri.domain.goalroom.vo.GoalRoomName; import co.kirikiri.domain.goalroom.vo.LimitedMemberCount; -import co.kirikiri.domain.member.Member; import co.kirikiri.domain.roadmap.RoadmapContent; +import co.kirikiri.member.domain.Member; import jakarta.persistence.Column; import jakarta.persistence.Embedded; import jakarta.persistence.Entity; @@ -184,7 +184,6 @@ public Integer getCurrentMemberCount() { return goalRoomMembers.size(); } - // FIXME 테스트용 메서드 public void addAllGoalRoomMembers(final List members) { this.goalRoomMembers.addAll(new ArrayList<>(members)); } diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomMember.java b/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomMember.java index d99074fcd..7c9d2c6e4 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomMember.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomMember.java @@ -1,6 +1,6 @@ package co.kirikiri.domain.goalroom; -import co.kirikiri.domain.member.Member; +import co.kirikiri.member.domain.Member; import jakarta.persistence.Column; import jakarta.persistence.Entity; import lombok.AccessLevel; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomMembers.java b/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomMembers.java index f05d9d369..90b92fcb1 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomMembers.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomMembers.java @@ -1,7 +1,7 @@ package co.kirikiri.domain.goalroom; -import co.kirikiri.domain.exception.UnexpectedDomainException; -import co.kirikiri.domain.member.Member; +import co.kirikiri.common.exception.UnexpectedDomainException; +import co.kirikiri.member.domain.Member; import jakarta.persistence.CascadeType; import jakarta.persistence.Embeddable; import jakarta.persistence.FetchType; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomPendingMember.java b/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomPendingMember.java index ab671fb74..0dec485f5 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomPendingMember.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomPendingMember.java @@ -1,6 +1,6 @@ package co.kirikiri.domain.goalroom; -import co.kirikiri.domain.member.Member; +import co.kirikiri.member.domain.Member; import jakarta.persistence.Entity; import java.time.LocalDateTime; import lombok.AccessLevel; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomPendingMembers.java b/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomPendingMembers.java index 6cd84a26c..72355b4be 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomPendingMembers.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomPendingMembers.java @@ -1,7 +1,7 @@ package co.kirikiri.domain.goalroom; -import co.kirikiri.domain.exception.UnexpectedDomainException; -import co.kirikiri.domain.member.Member; +import co.kirikiri.common.exception.UnexpectedDomainException; +import co.kirikiri.member.domain.Member; import jakarta.persistence.CascadeType; import jakarta.persistence.Embeddable; import jakarta.persistence.FetchType; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomRoadmapNode.java b/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomRoadmapNode.java index a8ec84112..d67d27d4d 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomRoadmapNode.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomRoadmapNode.java @@ -1,6 +1,6 @@ package co.kirikiri.domain.goalroom; -import co.kirikiri.domain.BaseEntity; +import co.kirikiri.common.entity.BaseEntity; import co.kirikiri.domain.goalroom.exception.GoalRoomException; import co.kirikiri.domain.goalroom.vo.Period; import co.kirikiri.domain.roadmap.RoadmapNode; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomToDo.java b/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomToDo.java index 3f84a708b..3cea621b9 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomToDo.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomToDo.java @@ -1,6 +1,6 @@ package co.kirikiri.domain.goalroom; -import co.kirikiri.domain.BaseUpdatedTimeEntity; +import co.kirikiri.common.entity.BaseUpdatedTimeEntity; import co.kirikiri.domain.goalroom.vo.GoalRoomTodoContent; import co.kirikiri.domain.goalroom.vo.Period; import jakarta.persistence.Embedded; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomToDoCheck.java b/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomToDoCheck.java index a52ee1812..6a4b11c7f 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomToDoCheck.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomToDoCheck.java @@ -1,6 +1,6 @@ package co.kirikiri.domain.goalroom; -import co.kirikiri.domain.BaseEntity; +import co.kirikiri.common.entity.BaseEntity; import jakarta.persistence.Entity; import jakarta.persistence.FetchType; import jakarta.persistence.JoinColumn; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/exception/GoalRoomException.java b/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/exception/GoalRoomException.java index 514495361..65f4f3a74 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/exception/GoalRoomException.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/exception/GoalRoomException.java @@ -1,6 +1,6 @@ package co.kirikiri.domain.goalroom.exception; -import co.kirikiri.domain.exception.DomainException; +import co.kirikiri.common.exception.DomainException; public class GoalRoomException extends DomainException { diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/Roadmap.java b/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/Roadmap.java index 6c509d470..e9dc770b2 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/Roadmap.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/Roadmap.java @@ -1,7 +1,7 @@ package co.kirikiri.domain.roadmap; -import co.kirikiri.domain.BaseCreatedTimeEntity; -import co.kirikiri.domain.member.Member; +import co.kirikiri.common.entity.BaseCreatedTimeEntity; +import co.kirikiri.member.domain.Member; import co.kirikiri.domain.roadmap.exception.RoadmapException; import jakarta.persistence.Column; import jakarta.persistence.Embedded; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/RoadmapCategory.java b/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/RoadmapCategory.java index 521839855..a71fcfb19 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/RoadmapCategory.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/RoadmapCategory.java @@ -1,6 +1,6 @@ package co.kirikiri.domain.roadmap; -import co.kirikiri.domain.BaseEntity; +import co.kirikiri.common.entity.BaseEntity; import co.kirikiri.domain.roadmap.exception.RoadmapException; import jakarta.persistence.Column; import jakarta.persistence.Entity; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/RoadmapContent.java b/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/RoadmapContent.java index e4d918267..e982cfdf9 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/RoadmapContent.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/RoadmapContent.java @@ -1,6 +1,6 @@ package co.kirikiri.domain.roadmap; -import co.kirikiri.domain.BaseUpdatedTimeEntity; +import co.kirikiri.common.entity.BaseUpdatedTimeEntity; import co.kirikiri.domain.roadmap.exception.RoadmapException; import jakarta.persistence.Column; import jakarta.persistence.Embedded; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/RoadmapNode.java b/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/RoadmapNode.java index dcf5bfbdf..0e82f470d 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/RoadmapNode.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/RoadmapNode.java @@ -1,6 +1,6 @@ package co.kirikiri.domain.roadmap; -import co.kirikiri.domain.BaseEntity; +import co.kirikiri.common.entity.BaseEntity; import co.kirikiri.domain.roadmap.exception.RoadmapException; import jakarta.persistence.Column; import jakarta.persistence.Embedded; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/RoadmapNodeImage.java b/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/RoadmapNodeImage.java index 47f3b1a1d..4713f04a2 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/RoadmapNodeImage.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/RoadmapNodeImage.java @@ -1,7 +1,7 @@ package co.kirikiri.domain.roadmap; -import co.kirikiri.domain.BaseEntity; -import co.kirikiri.domain.ImageContentType; +import co.kirikiri.common.entity.BaseEntity; +import co.kirikiri.common.type.ImageContentType; import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.EnumType; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/RoadmapReview.java b/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/RoadmapReview.java index 1b36d1f92..5a9af09ec 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/RoadmapReview.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/RoadmapReview.java @@ -1,7 +1,7 @@ package co.kirikiri.domain.roadmap; -import co.kirikiri.domain.BaseUpdatedTimeEntity; -import co.kirikiri.domain.member.Member; +import co.kirikiri.common.entity.BaseUpdatedTimeEntity; +import co.kirikiri.member.domain.Member; import co.kirikiri.domain.roadmap.exception.RoadmapException; import jakarta.persistence.Column; import jakarta.persistence.Entity; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/RoadmapTag.java b/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/RoadmapTag.java index 2dcd55fdc..6fb21f164 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/RoadmapTag.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/RoadmapTag.java @@ -1,6 +1,6 @@ package co.kirikiri.domain.roadmap; -import co.kirikiri.domain.BaseEntity; +import co.kirikiri.common.entity.BaseEntity; import co.kirikiri.domain.roadmap.vo.RoadmapTagName; import jakarta.persistence.Embedded; import jakarta.persistence.Entity; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/exception/RoadmapException.java b/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/exception/RoadmapException.java index 86610f60b..d178b24d2 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/exception/RoadmapException.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/exception/RoadmapException.java @@ -1,6 +1,6 @@ package co.kirikiri.domain.roadmap.exception; -import co.kirikiri.domain.exception.DomainException; +import co.kirikiri.common.exception.DomainException; public class RoadmapException extends DomainException { diff --git a/backend/kirikiri/src/main/java/co/kirikiri/controller/MemberController.java b/backend/kirikiri/src/main/java/co/kirikiri/member/controller/MemberController.java similarity index 85% rename from backend/kirikiri/src/main/java/co/kirikiri/controller/MemberController.java rename to backend/kirikiri/src/main/java/co/kirikiri/member/controller/MemberController.java index 84c47dead..7fecb051b 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/controller/MemberController.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/controller/MemberController.java @@ -1,12 +1,13 @@ -package co.kirikiri.controller; +package co.kirikiri.member.controller; import co.kirikiri.common.interceptor.Authenticated; import co.kirikiri.common.resolver.MemberIdentifier; -import co.kirikiri.service.member.MemberService; -import co.kirikiri.service.dto.member.request.MemberJoinRequest; -import co.kirikiri.service.dto.member.response.MemberInformationForPublicResponse; -import co.kirikiri.service.dto.member.response.MemberInformationResponse; +import co.kirikiri.member.service.MemberService; +import co.kirikiri.member.service.dto.request.MemberJoinRequest; +import co.kirikiri.member.service.dto.response.MemberInformationForPublicResponse; +import co.kirikiri.member.service.dto.response.MemberInformationResponse; import jakarta.validation.Valid; +import java.net.URI; import lombok.RequiredArgsConstructor; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; @@ -15,7 +16,6 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import java.net.URI; @RestController @RequestMapping("/members") diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/member/EncryptedPassword.java b/backend/kirikiri/src/main/java/co/kirikiri/member/domain/EncryptedPassword.java similarity index 93% rename from backend/kirikiri/src/main/java/co/kirikiri/domain/member/EncryptedPassword.java rename to backend/kirikiri/src/main/java/co/kirikiri/member/domain/EncryptedPassword.java index 3dfb27793..81347da7f 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/member/EncryptedPassword.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/domain/EncryptedPassword.java @@ -1,7 +1,7 @@ -package co.kirikiri.domain.member; +package co.kirikiri.member.domain; -import co.kirikiri.domain.exception.UnexpectedDomainException; -import co.kirikiri.domain.member.vo.Password; +import co.kirikiri.common.exception.UnexpectedDomainException; +import co.kirikiri.member.domain.vo.Password; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/member/Gender.java b/backend/kirikiri/src/main/java/co/kirikiri/member/domain/Gender.java similarity index 63% rename from backend/kirikiri/src/main/java/co/kirikiri/domain/member/Gender.java rename to backend/kirikiri/src/main/java/co/kirikiri/member/domain/Gender.java index 238cb7cd5..f864b4f6c 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/member/Gender.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/domain/Gender.java @@ -1,4 +1,4 @@ -package co.kirikiri.domain.member; +package co.kirikiri.member.domain; public enum Gender { diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/member/Member.java b/backend/kirikiri/src/main/java/co/kirikiri/member/domain/Member.java similarity index 91% rename from backend/kirikiri/src/main/java/co/kirikiri/domain/member/Member.java rename to backend/kirikiri/src/main/java/co/kirikiri/member/domain/Member.java index c5c1a8e7a..b9e242873 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/member/Member.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/domain/Member.java @@ -1,9 +1,9 @@ -package co.kirikiri.domain.member; +package co.kirikiri.member.domain; -import co.kirikiri.domain.BaseUpdatedTimeEntity; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; -import co.kirikiri.domain.member.vo.Password; +import co.kirikiri.common.entity.BaseUpdatedTimeEntity; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.domain.vo.Password; import jakarta.persistence.CascadeType; import jakarta.persistence.Embedded; import jakarta.persistence.Entity; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/member/MemberImage.java b/backend/kirikiri/src/main/java/co/kirikiri/member/domain/MemberImage.java similarity index 84% rename from backend/kirikiri/src/main/java/co/kirikiri/domain/member/MemberImage.java rename to backend/kirikiri/src/main/java/co/kirikiri/member/domain/MemberImage.java index 519ab7e5a..af59685b8 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/member/MemberImage.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/domain/MemberImage.java @@ -1,7 +1,7 @@ -package co.kirikiri.domain.member; +package co.kirikiri.member.domain; -import co.kirikiri.domain.BaseEntity; -import co.kirikiri.domain.ImageContentType; +import co.kirikiri.common.entity.BaseEntity; +import co.kirikiri.common.type.ImageContentType; import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.EnumType; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/member/MemberProfile.java b/backend/kirikiri/src/main/java/co/kirikiri/member/domain/MemberProfile.java similarity index 89% rename from backend/kirikiri/src/main/java/co/kirikiri/domain/member/MemberProfile.java rename to backend/kirikiri/src/main/java/co/kirikiri/member/domain/MemberProfile.java index 0014aa38c..c360d4f88 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/member/MemberProfile.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/domain/MemberProfile.java @@ -1,6 +1,6 @@ -package co.kirikiri.domain.member; +package co.kirikiri.member.domain; -import co.kirikiri.domain.BaseUpdatedTimeEntity; +import co.kirikiri.common.entity.BaseUpdatedTimeEntity; import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.EnumType; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/member/exception/MemberException.java b/backend/kirikiri/src/main/java/co/kirikiri/member/domain/exception/MemberException.java similarity index 58% rename from backend/kirikiri/src/main/java/co/kirikiri/domain/member/exception/MemberException.java rename to backend/kirikiri/src/main/java/co/kirikiri/member/domain/exception/MemberException.java index 44f6fa57b..6b7501b55 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/member/exception/MemberException.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/domain/exception/MemberException.java @@ -1,6 +1,6 @@ -package co.kirikiri.domain.member.exception; +package co.kirikiri.member.domain.exception; -import co.kirikiri.domain.exception.DomainException; +import co.kirikiri.common.exception.DomainException; public class MemberException extends DomainException { diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/member/vo/Identifier.java b/backend/kirikiri/src/main/java/co/kirikiri/member/domain/vo/Identifier.java similarity index 92% rename from backend/kirikiri/src/main/java/co/kirikiri/domain/member/vo/Identifier.java rename to backend/kirikiri/src/main/java/co/kirikiri/member/domain/vo/Identifier.java index f3ee6e3c1..01a29de9a 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/member/vo/Identifier.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/domain/vo/Identifier.java @@ -1,6 +1,6 @@ -package co.kirikiri.domain.member.vo; +package co.kirikiri.member.domain.vo; -import co.kirikiri.domain.member.exception.MemberException; +import co.kirikiri.member.domain.exception.MemberException; import jakarta.persistence.Column; import java.util.Objects; import lombok.AccessLevel; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/member/vo/Nickname.java b/backend/kirikiri/src/main/java/co/kirikiri/member/domain/vo/Nickname.java similarity index 92% rename from backend/kirikiri/src/main/java/co/kirikiri/domain/member/vo/Nickname.java rename to backend/kirikiri/src/main/java/co/kirikiri/member/domain/vo/Nickname.java index 3032a52a4..b8befd501 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/member/vo/Nickname.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/domain/vo/Nickname.java @@ -1,6 +1,6 @@ -package co.kirikiri.domain.member.vo; +package co.kirikiri.member.domain.vo; -import co.kirikiri.domain.member.exception.MemberException; +import co.kirikiri.member.domain.exception.MemberException; import jakarta.persistence.Column; import java.util.Objects; import lombok.NoArgsConstructor; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/member/vo/Password.java b/backend/kirikiri/src/main/java/co/kirikiri/member/domain/vo/Password.java similarity index 90% rename from backend/kirikiri/src/main/java/co/kirikiri/domain/member/vo/Password.java rename to backend/kirikiri/src/main/java/co/kirikiri/member/domain/vo/Password.java index 10db63859..f0002b74c 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/member/vo/Password.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/domain/vo/Password.java @@ -1,6 +1,6 @@ -package co.kirikiri.domain.member.vo; +package co.kirikiri.member.domain.vo; -import co.kirikiri.domain.member.exception.MemberException; +import co.kirikiri.member.domain.exception.MemberException; import lombok.Getter; @Getter diff --git a/backend/kirikiri/src/main/java/co/kirikiri/persistence/member/MemberQueryRepository.java b/backend/kirikiri/src/main/java/co/kirikiri/member/persistence/MemberQueryRepository.java similarity index 74% rename from backend/kirikiri/src/main/java/co/kirikiri/persistence/member/MemberQueryRepository.java rename to backend/kirikiri/src/main/java/co/kirikiri/member/persistence/MemberQueryRepository.java index 8a11d80b8..51129c9b0 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/persistence/member/MemberQueryRepository.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/persistence/MemberQueryRepository.java @@ -1,6 +1,6 @@ -package co.kirikiri.persistence.member; +package co.kirikiri.member.persistence; -import co.kirikiri.domain.member.Member; +import co.kirikiri.member.domain.Member; import java.util.Optional; public interface MemberQueryRepository { diff --git a/backend/kirikiri/src/main/java/co/kirikiri/persistence/member/MemberQueryRepositoryImpl.java b/backend/kirikiri/src/main/java/co/kirikiri/member/persistence/MemberQueryRepositoryImpl.java similarity index 81% rename from backend/kirikiri/src/main/java/co/kirikiri/persistence/member/MemberQueryRepositoryImpl.java rename to backend/kirikiri/src/main/java/co/kirikiri/member/persistence/MemberQueryRepositoryImpl.java index 9d725af72..2b2247f18 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/persistence/member/MemberQueryRepositoryImpl.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/persistence/MemberQueryRepositoryImpl.java @@ -1,10 +1,10 @@ -package co.kirikiri.persistence.member; +package co.kirikiri.member.persistence; -import static co.kirikiri.domain.member.QMember.member; -import static co.kirikiri.domain.member.QMemberImage.memberImage; -import static co.kirikiri.domain.member.QMemberProfile.memberProfile; +import static co.kirikiri.member.domain.QMember.member; +import static co.kirikiri.member.domain.QMemberImage.memberImage; +import static co.kirikiri.member.domain.QMemberProfile.memberProfile; -import co.kirikiri.domain.member.Member; +import co.kirikiri.member.domain.Member; import co.kirikiri.persistence.QuerydslRepositorySupporter; import java.util.Optional; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/persistence/member/MemberRepository.java b/backend/kirikiri/src/main/java/co/kirikiri/member/persistence/MemberRepository.java similarity index 68% rename from backend/kirikiri/src/main/java/co/kirikiri/persistence/member/MemberRepository.java rename to backend/kirikiri/src/main/java/co/kirikiri/member/persistence/MemberRepository.java index 4dd4e97ca..1f6b36390 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/persistence/member/MemberRepository.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/persistence/MemberRepository.java @@ -1,8 +1,8 @@ -package co.kirikiri.persistence.member; +package co.kirikiri.member.persistence; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; import org.springframework.data.jpa.repository.JpaRepository; import java.util.Optional; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/member/MemberService.java b/backend/kirikiri/src/main/java/co/kirikiri/member/service/MemberService.java similarity index 71% rename from backend/kirikiri/src/main/java/co/kirikiri/service/member/MemberService.java rename to backend/kirikiri/src/main/java/co/kirikiri/member/service/MemberService.java index 2fec1552c..3efdea09f 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/member/MemberService.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/service/MemberService.java @@ -1,33 +1,28 @@ -package co.kirikiri.service.member; - -import co.kirikiri.domain.ImageContentType; -import co.kirikiri.domain.member.EncryptedPassword; -import co.kirikiri.domain.member.Gender; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.MemberImage; -import co.kirikiri.domain.member.MemberProfile; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; -import co.kirikiri.persistence.auth.RefreshTokenRepository; -import co.kirikiri.persistence.member.MemberRepository; -import co.kirikiri.service.FileService; -import co.kirikiri.service.NumberGenerator; -import co.kirikiri.service.aop.ExceptionConvert; -import co.kirikiri.service.auth.TokenProvider; -import co.kirikiri.service.dto.auth.response.AuthenticationResponse; -import co.kirikiri.service.dto.member.MemberInformationDto; -import co.kirikiri.service.dto.member.MemberInformationForPublicDto; -import co.kirikiri.service.dto.member.MemberJoinDto; -import co.kirikiri.service.dto.member.OauthMemberJoinDto; -import co.kirikiri.service.dto.member.request.MemberJoinRequest; -import co.kirikiri.service.dto.member.response.MemberInformationForPublicResponse; -import co.kirikiri.service.dto.member.response.MemberInformationResponse; -import co.kirikiri.service.exception.ConflictException; -import co.kirikiri.service.exception.NotFoundException; -import co.kirikiri.service.mapper.AuthMapper; -import co.kirikiri.service.mapper.MemberMapper; +package co.kirikiri.member.service; + +import co.kirikiri.common.aop.ExceptionConvert; +import co.kirikiri.common.exception.ConflictException; +import co.kirikiri.common.exception.NotFoundException; +import co.kirikiri.common.service.FileService; +import co.kirikiri.common.service.NumberGenerator; +import co.kirikiri.common.type.ImageContentType; +import co.kirikiri.member.domain.EncryptedPassword; +import co.kirikiri.member.domain.Gender; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.MemberImage; +import co.kirikiri.member.domain.MemberProfile; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.persistence.MemberRepository; +import co.kirikiri.member.service.dto.MemberInformationDto; +import co.kirikiri.member.service.dto.MemberInformationForPublicDto; +import co.kirikiri.member.service.dto.MemberJoinDto; +import co.kirikiri.member.service.dto.OauthMemberJoinDto; +import co.kirikiri.member.service.dto.request.MemberJoinRequest; +import co.kirikiri.member.service.dto.response.MemberInformationForPublicResponse; +import co.kirikiri.member.service.dto.response.MemberInformationResponse; +import co.kirikiri.member.service.mapper.MemberMapper; import java.net.URL; -import java.util.Map; import java.util.UUID; import lombok.RequiredArgsConstructor; import org.springframework.core.env.Environment; @@ -50,9 +45,7 @@ public class MemberService { private final Environment environment; private final NumberGenerator numberGenerator; private final FileService fileService; - private final TokenProvider tokenProvider; private final MemberRepository memberRepository; - private final RefreshTokenRepository refreshTokenRepository; @Transactional public Long join(final MemberJoinRequest memberJoinRequest) { @@ -73,15 +66,14 @@ private void checkIdentifierDuplicate(final Identifier identifier) { } @Transactional - public AuthenticationResponse oauthJoin(final OauthMemberJoinDto oauthMemberJoinDto) { + public Member oauthJoin(final OauthMemberJoinDto oauthMemberJoinDto) { final MemberProfile memberProfile = new MemberProfile(Gender.valueOf(oauthMemberJoinDto.gender().name()), oauthMemberJoinDto.email()); final Identifier identifier = makeIdentifier(oauthMemberJoinDto); final Nickname nickname = new Nickname(oauthMemberJoinDto.nickname()); final Member member = new Member(identifier, oauthMemberJoinDto.oauthId(), nickname, findDefaultMemberImage(), memberProfile); - memberRepository.save(member); - return makeAuthenticationResponse(member); + return memberRepository.save(member); } private Identifier makeIdentifier(final OauthMemberJoinDto oauthMemberJoinDto) { @@ -95,17 +87,6 @@ private Identifier makeIdentifier(final OauthMemberJoinDto oauthMemberJoinDto) { return new Identifier(identifierWithUUID); } - private AuthenticationResponse makeAuthenticationResponse(final Member member) { - final String refreshToken = tokenProvider.createRefreshToken(member.getIdentifier().getValue(), Map.of()); - saveRefreshToken(refreshToken, member); - final String accessToken = tokenProvider.createAccessToken(member.getIdentifier().getValue(), Map.of()); - return AuthMapper.convertToAuthenticationResponse(refreshToken, accessToken); - } - - private void saveRefreshToken(final String refreshToken, final Member member) { - refreshTokenRepository.save(refreshToken, member.getIdentifier().getValue()); - } - private MemberImage findDefaultMemberImage() { final String defaultOriginalFileName = environment.getProperty(DEFAULT_ORIGINAL_FILE_NAME_PROPERTY); final String defaultServerFilePath = environment.getProperty(DEFAULT_SERVER_FILE_PATH_PROPERTY); @@ -123,7 +104,7 @@ public MemberInformationResponse findMemberInformation(final String identifier) return MemberMapper.convertToMemberInformationResponse(memberInformationDto); } - public MemberInformationDto makeMemberInformationDto(final Member member) { + private MemberInformationDto makeMemberInformationDto(final Member member) { final MemberImage memberImage = member.getImage(); final MemberProfile memberProfile = member.getMemberProfile(); final URL imageUrl = fileService.generateUrl(memberImage.getServerFilePath(), HttpMethod.GET); diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/MemberDto.java b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/MemberDto.java similarity index 70% rename from backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/MemberDto.java rename to backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/MemberDto.java index e687b3c6a..4a68d615d 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/MemberDto.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/MemberDto.java @@ -1,4 +1,4 @@ -package co.kirikiri.service.dto.member; +package co.kirikiri.member.service.dto; public record MemberDto( long id, diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/MemberInformationDto.java b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/MemberInformationDto.java similarity index 82% rename from backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/MemberInformationDto.java rename to backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/MemberInformationDto.java index c11785204..64022a8e9 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/MemberInformationDto.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/MemberInformationDto.java @@ -1,4 +1,4 @@ -package co.kirikiri.service.dto.member; +package co.kirikiri.member.service.dto; public record MemberInformationDto( Long id, diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/MemberInformationForPublicDto.java b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/MemberInformationForPublicDto.java similarity index 76% rename from backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/MemberInformationForPublicDto.java rename to backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/MemberInformationForPublicDto.java index d5438e4cb..9379c1f0b 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/MemberInformationForPublicDto.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/MemberInformationForPublicDto.java @@ -1,4 +1,4 @@ -package co.kirikiri.service.dto.member; +package co.kirikiri.member.service.dto; public record MemberInformationForPublicDto( String nickname, diff --git a/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/MemberJoinDto.java b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/MemberJoinDto.java new file mode 100644 index 000000000..62db68555 --- /dev/null +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/MemberJoinDto.java @@ -0,0 +1,16 @@ +package co.kirikiri.member.service.dto; + +import co.kirikiri.member.domain.Gender; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.domain.vo.Password; + +public record MemberJoinDto( + Identifier identifier, + Password password, + Nickname nickname, + Gender gender, + String email +) { + +} diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/OauthMemberJoinDto.java b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/OauthMemberJoinDto.java similarity index 58% rename from backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/OauthMemberJoinDto.java rename to backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/OauthMemberJoinDto.java index 713493688..03011e88d 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/OauthMemberJoinDto.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/OauthMemberJoinDto.java @@ -1,6 +1,6 @@ -package co.kirikiri.service.dto.member; +package co.kirikiri.member.service.dto; -import co.kirikiri.service.dto.member.request.GenderType; +import co.kirikiri.member.service.dto.request.GenderType; public record OauthMemberJoinDto( String oauthId, diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/request/GenderType.java b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/request/GenderType.java similarity index 68% rename from backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/request/GenderType.java rename to backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/request/GenderType.java index 164ebc537..6a5b6881a 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/request/GenderType.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/request/GenderType.java @@ -1,6 +1,6 @@ -package co.kirikiri.service.dto.member.request; +package co.kirikiri.member.service.dto.request; -import co.kirikiri.service.exception.BadRequestException; +import co.kirikiri.member.domain.exception.MemberException; import java.util.Arrays; public enum GenderType { @@ -19,6 +19,6 @@ public static GenderType findByOauthType(final String oauthGenderType) { return Arrays.stream(values()) .filter(it -> it.oauthGenderType.equals(oauthGenderType)) .findAny() - .orElseThrow(() -> new BadRequestException("존재하지 않는 성별 타입입니다.")); + .orElseThrow(() -> new MemberException("존재하지 않는 성별 타입입니다.")); } } diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/request/MemberJoinRequest.java b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/request/MemberJoinRequest.java similarity index 94% rename from backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/request/MemberJoinRequest.java rename to backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/request/MemberJoinRequest.java index 1aaf4f39b..99f145d71 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/request/MemberJoinRequest.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/request/MemberJoinRequest.java @@ -1,4 +1,4 @@ -package co.kirikiri.service.dto.member.request; +package co.kirikiri.member.service.dto.request; import jakarta.validation.constraints.Email; import jakarta.validation.constraints.NotBlank; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberCheckFeedResponse.java b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberCheckFeedResponse.java new file mode 100644 index 000000000..bb0edf435 --- /dev/null +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberCheckFeedResponse.java @@ -0,0 +1,11 @@ +package co.kirikiri.member.service.dto.response; + +import java.time.LocalDate; + +public record MemberCheckFeedResponse( + Long id, + String imageUrl, + String description, + LocalDate createdAt +) { +} diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/response/MemberGoalRoomForListResponse.java b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomForListResponse.java similarity index 88% rename from backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/response/MemberGoalRoomForListResponse.java rename to backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomForListResponse.java index dc30e5e21..555fd99c1 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/response/MemberGoalRoomForListResponse.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomForListResponse.java @@ -1,4 +1,4 @@ -package co.kirikiri.service.dto.member.response; +package co.kirikiri.member.service.dto.response; import java.time.LocalDate; import java.time.LocalDateTime; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomResponse.java b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomResponse.java new file mode 100644 index 000000000..8698e1152 --- /dev/null +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomResponse.java @@ -0,0 +1,20 @@ +package co.kirikiri.member.service.dto.response; + +import java.time.LocalDate; +import java.util.List; + +public record MemberGoalRoomResponse( + String name, + String status, + Long leaderId, + Integer currentMemberCount, + Integer limitedMemberCount, + LocalDate startDate, + LocalDate endDate, + Long roadmapContentId, + MemberGoalRoomRoadmapNodesResponse goalRoomRoadmapNodes, + List goalRoomTodos, + List checkFeeds +) { + +} diff --git a/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomRoadmapNodeResponse.java b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomRoadmapNodeResponse.java new file mode 100644 index 000000000..238b098cd --- /dev/null +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomRoadmapNodeResponse.java @@ -0,0 +1,12 @@ +package co.kirikiri.member.service.dto.response; + +import java.time.LocalDate; + +public record MemberGoalRoomRoadmapNodeResponse( + Long id, + String title, + LocalDate startDate, + LocalDate endDate, + Integer checkCount +) { +} diff --git a/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomRoadmapNodesResponse.java b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomRoadmapNodesResponse.java new file mode 100644 index 000000000..0282b7201 --- /dev/null +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomRoadmapNodesResponse.java @@ -0,0 +1,10 @@ +package co.kirikiri.member.service.dto.response; + +import java.util.List; + +public record MemberGoalRoomRoadmapNodesResponse( + boolean hasFrontNode, + boolean hasBackNode, + List nodes +) { +} diff --git a/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomToDoCheckResponse.java b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomToDoCheckResponse.java new file mode 100644 index 000000000..b358d58b7 --- /dev/null +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomToDoCheckResponse.java @@ -0,0 +1,6 @@ +package co.kirikiri.member.service.dto.response; + +public record MemberGoalRoomToDoCheckResponse( + boolean isChecked +) { +} diff --git a/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomTodoResponse.java b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomTodoResponse.java new file mode 100644 index 000000000..e67d60789 --- /dev/null +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomTodoResponse.java @@ -0,0 +1,12 @@ +package co.kirikiri.member.service.dto.response; + +import java.time.LocalDate; + +public record MemberGoalRoomTodoResponse( + Long id, + String content, + LocalDate startDate, + LocalDate endDate, + MemberGoalRoomToDoCheckResponse check +) { +} diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/response/MemberInformationForPublicResponse.java b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberInformationForPublicResponse.java similarity index 73% rename from backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/response/MemberInformationForPublicResponse.java rename to backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberInformationForPublicResponse.java index b533d7e73..80ff0d761 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/response/MemberInformationForPublicResponse.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberInformationForPublicResponse.java @@ -1,4 +1,4 @@ -package co.kirikiri.service.dto.member.response; +package co.kirikiri.member.service.dto.response; public record MemberInformationForPublicResponse( String nickname, diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/response/MemberInformationResponse.java b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberInformationResponse.java similarity index 79% rename from backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/response/MemberInformationResponse.java rename to backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberInformationResponse.java index 1be4e1933..9c9fc69f3 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/response/MemberInformationResponse.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberInformationResponse.java @@ -1,4 +1,4 @@ -package co.kirikiri.service.dto.member.response; +package co.kirikiri.member.service.dto.response; public record MemberInformationResponse( Long id, diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/response/MemberResponse.java b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberResponse.java similarity index 67% rename from backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/response/MemberResponse.java rename to backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberResponse.java index 26b1e7b23..c90f24be6 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/response/MemberResponse.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberResponse.java @@ -1,4 +1,4 @@ -package co.kirikiri.service.dto.member.response; +package co.kirikiri.member.service.dto.response; public record MemberResponse( long id, diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/mapper/MemberMapper.java b/backend/kirikiri/src/main/java/co/kirikiri/member/service/mapper/MemberMapper.java similarity index 71% rename from backend/kirikiri/src/main/java/co/kirikiri/service/mapper/MemberMapper.java rename to backend/kirikiri/src/main/java/co/kirikiri/member/service/mapper/MemberMapper.java index 409e662ee..495755911 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/mapper/MemberMapper.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/service/mapper/MemberMapper.java @@ -1,15 +1,15 @@ -package co.kirikiri.service.mapper; +package co.kirikiri.member.service.mapper; -import co.kirikiri.domain.member.Gender; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; -import co.kirikiri.domain.member.vo.Password; -import co.kirikiri.service.dto.member.MemberInformationDto; -import co.kirikiri.service.dto.member.MemberInformationForPublicDto; -import co.kirikiri.service.dto.member.MemberJoinDto; -import co.kirikiri.service.dto.member.request.MemberJoinRequest; -import co.kirikiri.service.dto.member.response.MemberInformationForPublicResponse; -import co.kirikiri.service.dto.member.response.MemberInformationResponse; +import co.kirikiri.member.domain.Gender; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.domain.vo.Password; +import co.kirikiri.member.service.dto.MemberInformationDto; +import co.kirikiri.member.service.dto.MemberInformationForPublicDto; +import co.kirikiri.member.service.dto.MemberJoinDto; +import co.kirikiri.member.service.dto.request.MemberJoinRequest; +import co.kirikiri.member.service.dto.response.MemberInformationForPublicResponse; +import co.kirikiri.member.service.dto.response.MemberInformationResponse; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/persistence/QuerydslRepositorySupporter.java b/backend/kirikiri/src/main/java/co/kirikiri/persistence/QuerydslRepositorySupporter.java index 685533ef7..e8c37e766 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/persistence/QuerydslRepositorySupporter.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/persistence/QuerydslRepositorySupporter.java @@ -1,6 +1,6 @@ package co.kirikiri.persistence; -import co.kirikiri.service.exception.ServerException; +import co.kirikiri.common.exception.ServerException; import com.querydsl.core.types.EntityPath; import com.querydsl.core.types.Expression; import com.querydsl.core.types.dsl.PathBuilder; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/persistence/dto/RoadmapSearchTagName.java b/backend/kirikiri/src/main/java/co/kirikiri/persistence/dto/RoadmapSearchTagName.java index c090385c1..3ed402e18 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/persistence/dto/RoadmapSearchTagName.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/persistence/dto/RoadmapSearchTagName.java @@ -1,6 +1,6 @@ package co.kirikiri.persistence.dto; -import co.kirikiri.service.exception.BadRequestException; +import co.kirikiri.common.exception.BadRequestException; public record RoadmapSearchTagName( String value diff --git a/backend/kirikiri/src/main/java/co/kirikiri/persistence/dto/RoadmapSearchTitle.java b/backend/kirikiri/src/main/java/co/kirikiri/persistence/dto/RoadmapSearchTitle.java index 8469ce5d7..743e78444 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/persistence/dto/RoadmapSearchTitle.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/persistence/dto/RoadmapSearchTitle.java @@ -1,6 +1,6 @@ package co.kirikiri.persistence.dto; -import co.kirikiri.service.exception.BadRequestException; +import co.kirikiri.common.exception.BadRequestException; public record RoadmapSearchTitle( String value diff --git a/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/CheckFeedQueryRepositoryImpl.java b/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/CheckFeedQueryRepositoryImpl.java index be35407bd..71adf913f 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/CheckFeedQueryRepositoryImpl.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/CheckFeedQueryRepositoryImpl.java @@ -2,8 +2,8 @@ import static co.kirikiri.domain.goalroom.QCheckFeed.checkFeed; import static co.kirikiri.domain.goalroom.QGoalRoomMember.goalRoomMember; -import static co.kirikiri.domain.member.QMember.member; -import static co.kirikiri.domain.member.QMemberImage.memberImage; +import static co.kirikiri.member.domain.QMember.member; +import static co.kirikiri.member.domain.QMemberImage.memberImage; import co.kirikiri.domain.goalroom.CheckFeed; import co.kirikiri.domain.goalroom.GoalRoom; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/GoalRoomMemberQueryRepository.java b/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/GoalRoomMemberQueryRepository.java index 0087e6a93..5bbae175f 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/GoalRoomMemberQueryRepository.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/GoalRoomMemberQueryRepository.java @@ -2,7 +2,7 @@ import co.kirikiri.domain.goalroom.GoalRoomMember; import co.kirikiri.domain.goalroom.GoalRoomStatus; -import co.kirikiri.domain.member.vo.Identifier; +import co.kirikiri.member.domain.vo.Identifier; import co.kirikiri.persistence.goalroom.dto.GoalRoomMemberSortType; import org.springframework.data.repository.query.Param; import java.util.List; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/GoalRoomMemberQueryRepositoryImpl.java b/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/GoalRoomMemberQueryRepositoryImpl.java index 5f83611bb..c16f46d06 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/GoalRoomMemberQueryRepositoryImpl.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/GoalRoomMemberQueryRepositoryImpl.java @@ -2,15 +2,15 @@ import static co.kirikiri.domain.goalroom.QGoalRoom.goalRoom; import static co.kirikiri.domain.goalroom.QGoalRoomMember.goalRoomMember; -import static co.kirikiri.domain.member.QMember.member; -import static co.kirikiri.domain.member.QMemberImage.memberImage; import static co.kirikiri.domain.roadmap.QRoadmapContent.roadmapContent; +import static co.kirikiri.member.domain.QMember.member; +import static co.kirikiri.member.domain.QMemberImage.memberImage; import static co.kirikiri.persistence.goalroom.dto.GoalRoomMemberSortType.ACCOMPLISHMENT_RATE; import static co.kirikiri.persistence.goalroom.dto.GoalRoomMemberSortType.JOINED_ASC; import co.kirikiri.domain.goalroom.GoalRoomMember; import co.kirikiri.domain.goalroom.GoalRoomStatus; -import co.kirikiri.domain.member.vo.Identifier; +import co.kirikiri.member.domain.vo.Identifier; import co.kirikiri.persistence.QuerydslRepositorySupporter; import co.kirikiri.persistence.goalroom.dto.GoalRoomMemberSortType; import com.querydsl.core.types.OrderSpecifier; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/GoalRoomMemberRepository.java b/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/GoalRoomMemberRepository.java index aa1f912c8..8a28b8bc5 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/GoalRoomMemberRepository.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/GoalRoomMemberRepository.java @@ -2,7 +2,7 @@ import co.kirikiri.domain.goalroom.GoalRoom; import co.kirikiri.domain.goalroom.GoalRoomMember; -import co.kirikiri.domain.member.vo.Identifier; +import co.kirikiri.member.domain.vo.Identifier; import java.util.List; import java.util.Optional; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/GoalRoomPendingMemberQueryRepositoryImpl.java b/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/GoalRoomPendingMemberQueryRepositoryImpl.java index 036c074d8..f9a52c6f0 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/GoalRoomPendingMemberQueryRepositoryImpl.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/GoalRoomPendingMemberQueryRepositoryImpl.java @@ -1,8 +1,8 @@ package co.kirikiri.persistence.goalroom; import static co.kirikiri.domain.goalroom.QGoalRoomPendingMember.goalRoomPendingMember; -import static co.kirikiri.domain.member.QMember.member; -import static co.kirikiri.domain.member.QMemberImage.memberImage; +import static co.kirikiri.member.domain.QMember.member; +import static co.kirikiri.member.domain.QMemberImage.memberImage; import static co.kirikiri.persistence.goalroom.dto.GoalRoomMemberSortType.JOINED_DESC; import co.kirikiri.domain.goalroom.GoalRoomPendingMember; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/GoalRoomPendingMemberRepository.java b/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/GoalRoomPendingMemberRepository.java index cdd2d45db..74a8f943b 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/GoalRoomPendingMemberRepository.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/GoalRoomPendingMemberRepository.java @@ -2,7 +2,7 @@ import co.kirikiri.domain.goalroom.GoalRoom; import co.kirikiri.domain.goalroom.GoalRoomPendingMember; -import co.kirikiri.domain.member.vo.Identifier; +import co.kirikiri.member.domain.vo.Identifier; import java.util.List; import java.util.Optional; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/GoalRoomQueryRepository.java b/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/GoalRoomQueryRepository.java index 5a18b19d9..0c51687fd 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/GoalRoomQueryRepository.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/GoalRoomQueryRepository.java @@ -2,7 +2,7 @@ import co.kirikiri.domain.goalroom.GoalRoom; import co.kirikiri.domain.goalroom.GoalRoomStatus; -import co.kirikiri.domain.member.Member; +import co.kirikiri.member.domain.Member; import co.kirikiri.domain.roadmap.Roadmap; import co.kirikiri.persistence.goalroom.dto.RoadmapGoalRoomsOrderType; import java.time.LocalDate; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/GoalRoomQueryRepositoryImpl.java b/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/GoalRoomQueryRepositoryImpl.java index dad601666..a98c2968e 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/GoalRoomQueryRepositoryImpl.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/GoalRoomQueryRepositoryImpl.java @@ -9,7 +9,7 @@ import co.kirikiri.domain.goalroom.GoalRoom; import co.kirikiri.domain.goalroom.GoalRoomStatus; -import co.kirikiri.domain.member.Member; +import co.kirikiri.member.domain.Member; import co.kirikiri.domain.roadmap.Roadmap; import co.kirikiri.persistence.QuerydslRepositorySupporter; import co.kirikiri.persistence.goalroom.dto.RoadmapGoalRoomsOrderType; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/GoalRoomToDoCheckRepository.java b/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/GoalRoomToDoCheckRepository.java index bc5609216..0fc94aa76 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/GoalRoomToDoCheckRepository.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/persistence/goalroom/GoalRoomToDoCheckRepository.java @@ -3,7 +3,7 @@ import co.kirikiri.domain.goalroom.GoalRoomMember; import co.kirikiri.domain.goalroom.GoalRoomToDo; import co.kirikiri.domain.goalroom.GoalRoomToDoCheck; -import co.kirikiri.domain.member.vo.Identifier; +import co.kirikiri.member.domain.vo.Identifier; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/persistence/roadmap/RoadmapQueryRepository.java b/backend/kirikiri/src/main/java/co/kirikiri/persistence/roadmap/RoadmapQueryRepository.java index 05a9d838e..a88016dc5 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/persistence/roadmap/RoadmapQueryRepository.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/persistence/roadmap/RoadmapQueryRepository.java @@ -1,6 +1,6 @@ package co.kirikiri.persistence.roadmap; -import co.kirikiri.domain.member.Member; +import co.kirikiri.member.domain.Member; import co.kirikiri.domain.roadmap.Roadmap; import co.kirikiri.domain.roadmap.RoadmapCategory; import co.kirikiri.domain.roadmap.RoadmapStatus; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/persistence/roadmap/RoadmapQueryRepositoryImpl.java b/backend/kirikiri/src/main/java/co/kirikiri/persistence/roadmap/RoadmapQueryRepositoryImpl.java index 95680b8aa..998dcd62f 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/persistence/roadmap/RoadmapQueryRepositoryImpl.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/persistence/roadmap/RoadmapQueryRepositoryImpl.java @@ -2,18 +2,18 @@ import static co.kirikiri.domain.goalroom.QGoalRoom.goalRoom; import static co.kirikiri.domain.goalroom.QGoalRoomMember.goalRoomMember; -import static co.kirikiri.domain.member.QMember.member; import static co.kirikiri.domain.roadmap.QRoadmap.roadmap; import static co.kirikiri.domain.roadmap.QRoadmapCategory.roadmapCategory; import static co.kirikiri.domain.roadmap.QRoadmapContent.roadmapContent; import static co.kirikiri.domain.roadmap.QRoadmapReview.roadmapReview; import static co.kirikiri.domain.roadmap.QRoadmapTag.roadmapTag; +import static co.kirikiri.member.domain.QMember.member; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.vo.Identifier; import co.kirikiri.domain.roadmap.Roadmap; import co.kirikiri.domain.roadmap.RoadmapCategory; import co.kirikiri.domain.roadmap.RoadmapStatus; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.vo.Identifier; import co.kirikiri.persistence.QuerydslRepositorySupporter; import co.kirikiri.persistence.dto.RoadmapOrderType; import co.kirikiri.persistence.dto.RoadmapSearchCreatorNickname; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/persistence/roadmap/RoadmapReviewQueryRepositoryImpl.java b/backend/kirikiri/src/main/java/co/kirikiri/persistence/roadmap/RoadmapReviewQueryRepositoryImpl.java index a0dc47a56..5673eef40 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/persistence/roadmap/RoadmapReviewQueryRepositoryImpl.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/persistence/roadmap/RoadmapReviewQueryRepositoryImpl.java @@ -1,7 +1,7 @@ package co.kirikiri.persistence.roadmap; -import static co.kirikiri.domain.member.QMember.member; import static co.kirikiri.domain.roadmap.QRoadmapReview.roadmapReview; +import static co.kirikiri.member.domain.QMember.member; import co.kirikiri.domain.roadmap.Roadmap; import co.kirikiri.domain.roadmap.RoadmapReview; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/persistence/roadmap/RoadmapReviewRepository.java b/backend/kirikiri/src/main/java/co/kirikiri/persistence/roadmap/RoadmapReviewRepository.java index b83bb24f2..6eeafc446 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/persistence/roadmap/RoadmapReviewRepository.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/persistence/roadmap/RoadmapReviewRepository.java @@ -1,6 +1,6 @@ package co.kirikiri.persistence.roadmap; -import co.kirikiri.domain.member.Member; +import co.kirikiri.member.domain.Member; import co.kirikiri.domain.roadmap.Roadmap; import co.kirikiri.domain.roadmap.RoadmapReview; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/RandomNumberGenerator.java b/backend/kirikiri/src/main/java/co/kirikiri/service/RandomNumberGenerator.java index edc031a4b..30a337e1f 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/RandomNumberGenerator.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/service/RandomNumberGenerator.java @@ -1,7 +1,8 @@ package co.kirikiri.service; -import org.springframework.stereotype.Component; +import co.kirikiri.common.service.NumberGenerator; import java.util.Random; +import org.springframework.stereotype.Component; @Component public class RandomNumberGenerator implements NumberGenerator { diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/UUIDFilePathGenerator.java b/backend/kirikiri/src/main/java/co/kirikiri/service/UUIDFilePathGenerator.java index 6d6450e2c..ebdf8ca81 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/UUIDFilePathGenerator.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/service/UUIDFilePathGenerator.java @@ -1,6 +1,8 @@ package co.kirikiri.service; -import co.kirikiri.service.exception.BadRequestException; +import co.kirikiri.common.exception.BadRequestException; +import co.kirikiri.common.service.FilePathGenerator; +import co.kirikiri.common.type.ImageDirType; import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.UUID; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/auth/AuthenticationTokenDto.java b/backend/kirikiri/src/main/java/co/kirikiri/service/dto/auth/AuthenticationTokenDto.java deleted file mode 100644 index 8e56708f4..000000000 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/auth/AuthenticationTokenDto.java +++ /dev/null @@ -1,7 +0,0 @@ -package co.kirikiri.service.dto.auth; - -public record AuthenticationTokenDto( - String accessToken, - String refreshToken -) { -} diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/auth/LoginDto.java b/backend/kirikiri/src/main/java/co/kirikiri/service/dto/auth/LoginDto.java deleted file mode 100644 index 1224c1d5c..000000000 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/auth/LoginDto.java +++ /dev/null @@ -1,11 +0,0 @@ -package co.kirikiri.service.dto.auth; - -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Password; - -public record LoginDto( - Identifier identifier, - Password password -) { - -} diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/goalroom/GoalRoomCheckFeedDto.java b/backend/kirikiri/src/main/java/co/kirikiri/service/dto/goalroom/GoalRoomCheckFeedDto.java index 06e0d4323..12db3e0bc 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/goalroom/GoalRoomCheckFeedDto.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/service/dto/goalroom/GoalRoomCheckFeedDto.java @@ -1,6 +1,6 @@ package co.kirikiri.service.dto.goalroom; -import co.kirikiri.service.dto.member.MemberDto; +import co.kirikiri.member.service.dto.MemberDto; public record GoalRoomCheckFeedDto( MemberDto memberDto, diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/goalroom/MemberGoalRoomForListDto.java b/backend/kirikiri/src/main/java/co/kirikiri/service/dto/goalroom/MemberGoalRoomForListDto.java index 6ee615c46..0e4ce4e81 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/goalroom/MemberGoalRoomForListDto.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/service/dto/goalroom/MemberGoalRoomForListDto.java @@ -1,6 +1,6 @@ package co.kirikiri.service.dto.goalroom; -import co.kirikiri.service.dto.member.MemberDto; +import co.kirikiri.member.service.dto.MemberDto; import java.time.LocalDate; import java.time.LocalDateTime; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/goalroom/RoadmapGoalRoomDto.java b/backend/kirikiri/src/main/java/co/kirikiri/service/dto/goalroom/RoadmapGoalRoomDto.java index 618204f0c..969d5fc6a 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/goalroom/RoadmapGoalRoomDto.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/service/dto/goalroom/RoadmapGoalRoomDto.java @@ -1,8 +1,7 @@ package co.kirikiri.service.dto.goalroom; import co.kirikiri.domain.goalroom.GoalRoomStatus; -import co.kirikiri.service.dto.member.MemberDto; - +import co.kirikiri.member.service.dto.MemberDto; import java.time.LocalDate; import java.time.LocalDateTime; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/goalroom/response/GoalRoomCheckFeedResponse.java b/backend/kirikiri/src/main/java/co/kirikiri/service/dto/goalroom/response/GoalRoomCheckFeedResponse.java index 011b2d38d..73c50c3bc 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/goalroom/response/GoalRoomCheckFeedResponse.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/service/dto/goalroom/response/GoalRoomCheckFeedResponse.java @@ -1,6 +1,6 @@ package co.kirikiri.service.dto.goalroom.response; -import co.kirikiri.service.dto.member.response.MemberResponse; +import co.kirikiri.member.service.dto.response.MemberResponse; public record GoalRoomCheckFeedResponse( MemberResponse member, diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/MemberJoinDto.java b/backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/MemberJoinDto.java deleted file mode 100644 index fadfda7b1..000000000 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/MemberJoinDto.java +++ /dev/null @@ -1,16 +0,0 @@ -package co.kirikiri.service.dto.member; - -import co.kirikiri.domain.member.Gender; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; -import co.kirikiri.domain.member.vo.Password; - -public record MemberJoinDto( - Identifier identifier, - Password password, - Nickname nickname, - Gender gender, - String email -) { - -} diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/response/MemberGoalRoomResponse.java b/backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/response/MemberGoalRoomResponse.java deleted file mode 100644 index 1204d182c..000000000 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/member/response/MemberGoalRoomResponse.java +++ /dev/null @@ -1,23 +0,0 @@ -package co.kirikiri.service.dto.member.response; - -import co.kirikiri.service.dto.goalroom.response.CheckFeedResponse; -import co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodesResponse; -import co.kirikiri.service.dto.goalroom.response.GoalRoomTodoResponse; -import java.time.LocalDate; -import java.util.List; - -public record MemberGoalRoomResponse( - String name, - String status, - Long leaderId, - Integer currentMemberCount, - Integer limitedMemberCount, - LocalDate startDate, - LocalDate endDate, - Long roadmapContentId, - GoalRoomRoadmapNodesResponse goalRoomRoadmapNodes, - List goalRoomTodos, - List checkFeeds -) { - -} diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/roadmap/RoadmapDto.java b/backend/kirikiri/src/main/java/co/kirikiri/service/dto/roadmap/RoadmapDto.java index a85cd7915..51b4c22ab 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/roadmap/RoadmapDto.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/service/dto/roadmap/RoadmapDto.java @@ -1,6 +1,6 @@ package co.kirikiri.service.dto.roadmap; -import co.kirikiri.service.dto.member.MemberDto; +import co.kirikiri.member.service.dto.MemberDto; import java.time.LocalDateTime; import java.util.List; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/roadmap/RoadmapForListDto.java b/backend/kirikiri/src/main/java/co/kirikiri/service/dto/roadmap/RoadmapForListDto.java index 1b05ab352..3d5280620 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/roadmap/RoadmapForListDto.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/service/dto/roadmap/RoadmapForListDto.java @@ -1,6 +1,6 @@ package co.kirikiri.service.dto.roadmap; -import co.kirikiri.service.dto.member.MemberDto; +import co.kirikiri.member.service.dto.MemberDto; import java.time.LocalDateTime; import java.util.List; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/roadmap/RoadmapReviewDto.java b/backend/kirikiri/src/main/java/co/kirikiri/service/dto/roadmap/RoadmapReviewDto.java index 89ef43983..02bcb7306 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/roadmap/RoadmapReviewDto.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/service/dto/roadmap/RoadmapReviewDto.java @@ -1,6 +1,6 @@ package co.kirikiri.service.dto.roadmap; -import co.kirikiri.domain.member.Member; +import co.kirikiri.member.domain.Member; public record RoadmapReviewDto( String content, diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/roadmap/RoadmapReviewReadDto.java b/backend/kirikiri/src/main/java/co/kirikiri/service/dto/roadmap/RoadmapReviewReadDto.java index 40ac375eb..918906afa 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/roadmap/RoadmapReviewReadDto.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/service/dto/roadmap/RoadmapReviewReadDto.java @@ -1,6 +1,6 @@ package co.kirikiri.service.dto.roadmap; -import co.kirikiri.service.dto.member.MemberDto; +import co.kirikiri.member.service.dto.MemberDto; import java.time.LocalDateTime; public record RoadmapReviewReadDto( diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/roadmap/response/RoadmapForListResponse.java b/backend/kirikiri/src/main/java/co/kirikiri/service/dto/roadmap/response/RoadmapForListResponse.java index b0ad3d37e..50d2e6981 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/roadmap/response/RoadmapForListResponse.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/service/dto/roadmap/response/RoadmapForListResponse.java @@ -1,6 +1,6 @@ package co.kirikiri.service.dto.roadmap.response; -import co.kirikiri.service.dto.member.response.MemberResponse; +import co.kirikiri.member.service.dto.response.MemberResponse; import java.time.LocalDateTime; import java.util.List; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/roadmap/response/RoadmapGoalRoomResponse.java b/backend/kirikiri/src/main/java/co/kirikiri/service/dto/roadmap/response/RoadmapGoalRoomResponse.java index 2d63964e5..ac83b3232 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/roadmap/response/RoadmapGoalRoomResponse.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/service/dto/roadmap/response/RoadmapGoalRoomResponse.java @@ -1,7 +1,7 @@ package co.kirikiri.service.dto.roadmap.response; import co.kirikiri.domain.goalroom.GoalRoomStatus; -import co.kirikiri.service.dto.member.response.MemberResponse; +import co.kirikiri.member.service.dto.response.MemberResponse; import java.time.LocalDate; import java.time.LocalDateTime; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/roadmap/response/RoadmapResponse.java b/backend/kirikiri/src/main/java/co/kirikiri/service/dto/roadmap/response/RoadmapResponse.java index 3286b0df2..065ad5a28 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/roadmap/response/RoadmapResponse.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/service/dto/roadmap/response/RoadmapResponse.java @@ -1,6 +1,6 @@ package co.kirikiri.service.dto.roadmap.response; -import co.kirikiri.service.dto.member.response.MemberResponse; +import co.kirikiri.member.service.dto.response.MemberResponse; import java.time.LocalDateTime; import java.util.List; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/roadmap/response/RoadmapReviewResponse.java b/backend/kirikiri/src/main/java/co/kirikiri/service/dto/roadmap/response/RoadmapReviewResponse.java index 956143b7c..667999237 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/dto/roadmap/response/RoadmapReviewResponse.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/service/dto/roadmap/response/RoadmapReviewResponse.java @@ -1,6 +1,6 @@ package co.kirikiri.service.dto.roadmap.response; -import co.kirikiri.service.dto.member.response.MemberResponse; +import co.kirikiri.member.service.dto.response.MemberResponse; import java.time.LocalDateTime; public record RoadmapReviewResponse( @@ -11,4 +11,4 @@ public record RoadmapReviewResponse( Double rate ) { -} \ No newline at end of file +} diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/goalroom/GoalRoomCreateService.java b/backend/kirikiri/src/main/java/co/kirikiri/service/goalroom/GoalRoomCreateService.java index 7e34b03ea..6ebc192c1 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/goalroom/GoalRoomCreateService.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/service/goalroom/GoalRoomCreateService.java @@ -1,6 +1,12 @@ package co.kirikiri.service.goalroom; -import co.kirikiri.domain.ImageContentType; +import co.kirikiri.common.aop.ExceptionConvert; +import co.kirikiri.common.exception.BadRequestException; +import co.kirikiri.common.exception.NotFoundException; +import co.kirikiri.common.service.FilePathGenerator; +import co.kirikiri.common.service.FileService; +import co.kirikiri.common.type.ImageContentType; +import co.kirikiri.common.type.ImageDirType; import co.kirikiri.domain.goalroom.CheckFeed; import co.kirikiri.domain.goalroom.GoalRoom; import co.kirikiri.domain.goalroom.GoalRoomMember; @@ -10,21 +16,17 @@ import co.kirikiri.domain.goalroom.GoalRoomToDo; import co.kirikiri.domain.goalroom.GoalRoomToDoCheck; import co.kirikiri.domain.goalroom.vo.Period; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.vo.Identifier; import co.kirikiri.domain.roadmap.Roadmap; import co.kirikiri.domain.roadmap.RoadmapContent; import co.kirikiri.domain.roadmap.RoadmapNode; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.persistence.MemberRepository; import co.kirikiri.persistence.goalroom.CheckFeedRepository; import co.kirikiri.persistence.goalroom.GoalRoomMemberRepository; import co.kirikiri.persistence.goalroom.GoalRoomRepository; import co.kirikiri.persistence.goalroom.GoalRoomToDoCheckRepository; -import co.kirikiri.persistence.member.MemberRepository; import co.kirikiri.persistence.roadmap.RoadmapContentRepository; -import co.kirikiri.service.FilePathGenerator; -import co.kirikiri.service.FileService; -import co.kirikiri.service.ImageDirType; -import co.kirikiri.service.aop.ExceptionConvert; import co.kirikiri.service.dto.FileInformation; import co.kirikiri.service.dto.goalroom.GoalRoomCreateDto; import co.kirikiri.service.dto.goalroom.GoalRoomRoadmapNodeDto; @@ -32,8 +34,6 @@ import co.kirikiri.service.dto.goalroom.request.GoalRoomCreateRequest; import co.kirikiri.service.dto.goalroom.request.GoalRoomTodoRequest; import co.kirikiri.service.dto.goalroom.response.GoalRoomToDoCheckResponse; -import co.kirikiri.service.exception.BadRequestException; -import co.kirikiri.service.exception.NotFoundException; import co.kirikiri.service.mapper.GoalRoomMapper; import java.time.LocalDate; import java.time.LocalDateTime; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/goalroom/GoalRoomReadService.java b/backend/kirikiri/src/main/java/co/kirikiri/service/goalroom/GoalRoomReadService.java index 09480bbef..dfac27398 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/goalroom/GoalRoomReadService.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/service/goalroom/GoalRoomReadService.java @@ -1,5 +1,9 @@ package co.kirikiri.service.goalroom; +import co.kirikiri.common.aop.ExceptionConvert; +import co.kirikiri.common.exception.ForbiddenException; +import co.kirikiri.common.exception.NotFoundException; +import co.kirikiri.common.service.FileService; import co.kirikiri.domain.goalroom.CheckFeed; import co.kirikiri.domain.goalroom.GoalRoom; import co.kirikiri.domain.goalroom.GoalRoomMember; @@ -9,18 +13,19 @@ import co.kirikiri.domain.goalroom.GoalRoomStatus; import co.kirikiri.domain.goalroom.GoalRoomToDoCheck; import co.kirikiri.domain.goalroom.GoalRoomToDos; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.vo.Identifier; import co.kirikiri.domain.roadmap.RoadmapNode; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.persistence.MemberRepository; +import co.kirikiri.member.service.dto.MemberDto; +import co.kirikiri.member.service.dto.response.MemberGoalRoomForListResponse; +import co.kirikiri.member.service.dto.response.MemberGoalRoomResponse; import co.kirikiri.persistence.goalroom.CheckFeedRepository; import co.kirikiri.persistence.goalroom.GoalRoomMemberRepository; import co.kirikiri.persistence.goalroom.GoalRoomPendingMemberRepository; import co.kirikiri.persistence.goalroom.GoalRoomRepository; import co.kirikiri.persistence.goalroom.GoalRoomToDoCheckRepository; import co.kirikiri.persistence.goalroom.dto.GoalRoomMemberSortType; -import co.kirikiri.persistence.member.MemberRepository; -import co.kirikiri.service.FileService; -import co.kirikiri.service.aop.ExceptionConvert; import co.kirikiri.service.dto.goalroom.CheckFeedDto; import co.kirikiri.service.dto.goalroom.GoalRoomCheckFeedDto; import co.kirikiri.service.dto.goalroom.GoalRoomMemberDto; @@ -34,18 +39,12 @@ import co.kirikiri.service.dto.goalroom.response.GoalRoomResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodeDetailResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomTodoResponse; -import co.kirikiri.service.dto.member.MemberDto; -import co.kirikiri.service.dto.member.response.MemberGoalRoomForListResponse; -import co.kirikiri.service.dto.member.response.MemberGoalRoomResponse; -import co.kirikiri.service.exception.ForbiddenException; -import co.kirikiri.service.exception.NotFoundException; import co.kirikiri.service.mapper.GoalRoomMapper; import java.net.URL; import java.time.LocalDate; import java.util.Collections; import java.util.List; import java.util.Optional; -import java.util.stream.Collectors; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpMethod; import org.springframework.stereotype.Service; @@ -178,7 +177,7 @@ public MemberGoalRoomResponse findMemberGoalRoom(final String identifier, final private List makeCheckFeedDtos(final List checkFeeds) { return checkFeeds.stream() .map(this::makeCheckFeedDto) - .collect(Collectors.toList()); + .toList(); } private CheckFeedDto makeCheckFeedDto(final CheckFeed checkFeed) { diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/mapper/GoalRoomMapper.java b/backend/kirikiri/src/main/java/co/kirikiri/service/mapper/GoalRoomMapper.java index a7a7fdef6..3e6c05b1e 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/mapper/GoalRoomMapper.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/service/mapper/GoalRoomMapper.java @@ -1,5 +1,6 @@ package co.kirikiri.service.mapper; +import co.kirikiri.common.exception.ServerException; import co.kirikiri.domain.goalroom.GoalRoom; import co.kirikiri.domain.goalroom.GoalRoomRoadmapNode; import co.kirikiri.domain.goalroom.GoalRoomRoadmapNodes; @@ -11,6 +12,15 @@ import co.kirikiri.domain.goalroom.vo.GoalRoomTodoContent; import co.kirikiri.domain.goalroom.vo.LimitedMemberCount; import co.kirikiri.domain.goalroom.vo.Period; +import co.kirikiri.member.service.dto.MemberDto; +import co.kirikiri.member.service.dto.response.MemberCheckFeedResponse; +import co.kirikiri.member.service.dto.response.MemberGoalRoomForListResponse; +import co.kirikiri.member.service.dto.response.MemberGoalRoomResponse; +import co.kirikiri.member.service.dto.response.MemberGoalRoomRoadmapNodeResponse; +import co.kirikiri.member.service.dto.response.MemberGoalRoomRoadmapNodesResponse; +import co.kirikiri.member.service.dto.response.MemberGoalRoomToDoCheckResponse; +import co.kirikiri.member.service.dto.response.MemberGoalRoomTodoResponse; +import co.kirikiri.member.service.dto.response.MemberResponse; import co.kirikiri.persistence.goalroom.dto.GoalRoomMemberSortType; import co.kirikiri.persistence.goalroom.dto.RoadmapGoalRoomsOrderType; import co.kirikiri.service.dto.FileInformation; @@ -35,18 +45,12 @@ import co.kirikiri.service.dto.goalroom.response.GoalRoomResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodeDetailResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodeResponse; -import co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodesResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomToDoCheckResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomTodoResponse; -import co.kirikiri.service.dto.member.MemberDto; -import co.kirikiri.service.dto.member.response.MemberGoalRoomForListResponse; -import co.kirikiri.service.dto.member.response.MemberGoalRoomResponse; -import co.kirikiri.service.dto.member.response.MemberResponse; import co.kirikiri.service.dto.roadmap.RoadmapGoalRoomNumberDto; import co.kirikiri.service.dto.roadmap.RoadmapGoalRoomsOrderTypeDto; import co.kirikiri.service.dto.roadmap.response.RoadmapGoalRoomResponse; import co.kirikiri.service.dto.roadmap.response.RoadmapGoalRoomResponses; -import co.kirikiri.service.exception.ServerException; import java.io.IOException; import java.time.LocalDate; import java.util.Collections; @@ -208,11 +212,11 @@ private static boolean isCheckedTodo(final Long targetTodoId, final List checkFeedDtos, final List checkedTodos) { - final GoalRoomRoadmapNodesResponse nodeResponses = convertToGoalRoomRoadmapNodesResponse( + final MemberGoalRoomRoadmapNodesResponse nodeResponses = convertToMemberGoalRoomRoadmapNodesResponse( goalRoom.getGoalRoomRoadmapNodes()); - final List todoResponses = convertGoalRoomTodoResponsesLimit(goalRoom.getGoalRoomToDos(), + final List todoResponses = convertMemberGoalRoomTodoResponsesLimit(goalRoom.getGoalRoomToDos(), checkedTodos); - final List checkFeedResponses = convertToCheckFeedResponses(checkFeedDtos); + final List checkFeedResponses = convertToMemberCheckFeedResponses(checkFeedDtos); return new MemberGoalRoomResponse(goalRoom.getName().getValue(), goalRoom.getStatus().name(), goalRoom.findGoalRoomLeader().getId(), goalRoom.getCurrentMemberCount(), @@ -220,36 +224,51 @@ public static MemberGoalRoomResponse convertToMemberGoalRoomResponse(final GoalR goalRoom.getRoadmapContent().getId(), nodeResponses, todoResponses, checkFeedResponses); } - private static GoalRoomRoadmapNodesResponse convertToGoalRoomRoadmapNodesResponse( + private static MemberGoalRoomRoadmapNodesResponse convertToMemberGoalRoomRoadmapNodesResponse( final GoalRoomRoadmapNodes nodes) { final GoalRoomRoadmapNode currentNode = nodes.getNodeByDate(LocalDate.now()) .orElse(nodes.getNodeByDate(nodes.getGoalRoomStartDate()).get()); if (!nodes.hasBackNode(currentNode)) { - return new GoalRoomRoadmapNodesResponse( + return new MemberGoalRoomRoadmapNodesResponse( nodes.hasFrontNode(currentNode), nodes.hasBackNode(currentNode), - List.of(convertGoalRoomNodeResponse(currentNode)) + List.of(convertMemberGoalRoomNodeResponse(currentNode)) ); } final GoalRoomRoadmapNode nextNode = nodes.nextNode(currentNode).get(); - return new GoalRoomRoadmapNodesResponse(nodes.hasFrontNode(currentNode), nodes.hasBackNode(nextNode), - List.of(convertGoalRoomNodeResponse(currentNode), convertGoalRoomNodeResponse(nextNode))); + return new MemberGoalRoomRoadmapNodesResponse(nodes.hasFrontNode(currentNode), nodes.hasBackNode(nextNode), + List.of(convertMemberGoalRoomNodeResponse(currentNode), convertMemberGoalRoomNodeResponse(nextNode))); } - private static List convertGoalRoomTodoResponsesLimit(final GoalRoomToDos goalRoomToDos, - final List checkedTodos) { + private static MemberGoalRoomRoadmapNodeResponse convertMemberGoalRoomNodeResponse(final GoalRoomRoadmapNode node) { + return new MemberGoalRoomRoadmapNodeResponse(node.getId(), node.getRoadmapNode().getTitle(), node.getStartDate(), + node.getEndDate(), node.getCheckCount()); + } + + private static List convertMemberGoalRoomTodoResponsesLimit(final GoalRoomToDos goalRoomToDos, + final List checkedTodos) { return goalRoomToDos.getValues() .stream() - .map(goalRoomToDo -> convertGoalRoomTodoResponse(checkedTodos, goalRoomToDo)) + .map(goalRoomToDo -> convertMemberGoalRoomTodoResponse(checkedTodos, goalRoomToDo)) .limit(MAX_MEMBER_GOAL_ROOM_TODO_NUMBER) .toList(); } - private static List convertToCheckFeedResponses(final List checkFeedDtos) { + private static MemberGoalRoomTodoResponse convertMemberGoalRoomTodoResponse(final List checkedTodos, + final GoalRoomToDo goalRoomToDo) { + final MemberGoalRoomToDoCheckResponse checkResponse = new MemberGoalRoomToDoCheckResponse( + isCheckedTodo(goalRoomToDo.getId(), checkedTodos)); + return new MemberGoalRoomTodoResponse(goalRoomToDo.getId(), + goalRoomToDo.getContent(), + goalRoomToDo.getStartDate(), goalRoomToDo.getEndDate(), + checkResponse); + } + + private static List convertToMemberCheckFeedResponses(final List checkFeedDtos) { return checkFeedDtos.stream() - .map(checkFeed -> new CheckFeedResponse(checkFeed.id(), checkFeed.imageUrl(), + .map(checkFeed -> new MemberCheckFeedResponse(checkFeed.id(), checkFeed.imageUrl(), checkFeed.description(), checkFeed.createdAt().toLocalDate())) .limit(MAX_MEMBER_GOAL_ROOM_CHECK_FEED_NUMBER) .toList(); diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/mapper/RoadmapMapper.java b/backend/kirikiri/src/main/java/co/kirikiri/service/mapper/RoadmapMapper.java index a5efc4376..89fc04513 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/mapper/RoadmapMapper.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/service/mapper/RoadmapMapper.java @@ -1,12 +1,13 @@ package co.kirikiri.service.mapper; -import co.kirikiri.domain.member.Member; +import co.kirikiri.common.exception.ServerException; import co.kirikiri.domain.roadmap.Roadmap; import co.kirikiri.domain.roadmap.RoadmapCategory; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.service.dto.MemberDto; +import co.kirikiri.member.service.dto.response.MemberResponse; import co.kirikiri.persistence.dto.RoadmapOrderType; import co.kirikiri.service.dto.FileInformation; -import co.kirikiri.service.dto.member.MemberDto; -import co.kirikiri.service.dto.member.response.MemberResponse; import co.kirikiri.service.dto.roadmap.RoadmapCategoryDto; import co.kirikiri.service.dto.roadmap.RoadmapContentDto; import co.kirikiri.service.dto.roadmap.RoadmapDto; @@ -36,7 +37,6 @@ import co.kirikiri.service.dto.roadmap.response.RoadmapResponse; import co.kirikiri.service.dto.roadmap.response.RoadmapReviewResponse; import co.kirikiri.service.dto.roadmap.response.RoadmapTagResponse; -import co.kirikiri.service.exception.ServerException; import java.io.IOException; import java.util.Collections; import java.util.List; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/roadmap/RoadmapCreateEventListener.java b/backend/kirikiri/src/main/java/co/kirikiri/service/roadmap/RoadmapCreateEventListener.java index 833c59de6..748e5473c 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/roadmap/RoadmapCreateEventListener.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/service/roadmap/RoadmapCreateEventListener.java @@ -1,21 +1,21 @@ package co.kirikiri.service.roadmap; -import co.kirikiri.domain.ImageContentType; +import co.kirikiri.common.aop.ExceptionConvert; +import co.kirikiri.common.exception.BadRequestException; +import co.kirikiri.common.exception.ServerException; +import co.kirikiri.common.service.FilePathGenerator; +import co.kirikiri.common.service.FileService; +import co.kirikiri.common.type.ImageContentType; +import co.kirikiri.common.type.ImageDirType; import co.kirikiri.domain.roadmap.Roadmap; import co.kirikiri.domain.roadmap.RoadmapContent; import co.kirikiri.domain.roadmap.RoadmapNode; import co.kirikiri.domain.roadmap.RoadmapNodeImage; import co.kirikiri.domain.roadmap.RoadmapNodeImages; import co.kirikiri.persistence.roadmap.RoadmapContentRepository; -import co.kirikiri.service.FilePathGenerator; -import co.kirikiri.service.FileService; -import co.kirikiri.service.ImageDirType; -import co.kirikiri.service.aop.ExceptionConvert; import co.kirikiri.service.dto.FileInformation; import co.kirikiri.service.dto.roadmap.RoadmapNodeSaveDto; import co.kirikiri.service.event.RoadmapCreateEvent; -import co.kirikiri.service.exception.BadRequestException; -import co.kirikiri.service.exception.ServerException; import java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.scheduling.annotation.Async; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/roadmap/RoadmapCreateService.java b/backend/kirikiri/src/main/java/co/kirikiri/service/roadmap/RoadmapCreateService.java index 77bce647b..4b4b58578 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/roadmap/RoadmapCreateService.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/service/roadmap/RoadmapCreateService.java @@ -1,10 +1,14 @@ package co.kirikiri.service.roadmap; +import co.kirikiri.common.aop.ExceptionConvert; +import co.kirikiri.common.exception.AuthenticationException; +import co.kirikiri.common.exception.BadRequestException; +import co.kirikiri.common.exception.ConflictException; +import co.kirikiri.common.exception.ForbiddenException; +import co.kirikiri.common.exception.NotFoundException; import co.kirikiri.domain.goalroom.GoalRoom; import co.kirikiri.domain.goalroom.GoalRoomMember; import co.kirikiri.domain.goalroom.GoalRoomStatus; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.vo.Identifier; import co.kirikiri.domain.roadmap.Roadmap; import co.kirikiri.domain.roadmap.RoadmapCategory; import co.kirikiri.domain.roadmap.RoadmapContent; @@ -15,13 +19,14 @@ import co.kirikiri.domain.roadmap.RoadmapTag; import co.kirikiri.domain.roadmap.RoadmapTags; import co.kirikiri.domain.roadmap.vo.RoadmapTagName; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.persistence.MemberRepository; import co.kirikiri.persistence.goalroom.GoalRoomMemberRepository; import co.kirikiri.persistence.goalroom.GoalRoomRepository; -import co.kirikiri.persistence.member.MemberRepository; import co.kirikiri.persistence.roadmap.RoadmapCategoryRepository; import co.kirikiri.persistence.roadmap.RoadmapRepository; import co.kirikiri.persistence.roadmap.RoadmapReviewRepository; -import co.kirikiri.service.aop.ExceptionConvert; import co.kirikiri.service.dto.roadmap.RoadmapNodeSaveDto; import co.kirikiri.service.dto.roadmap.RoadmapReviewDto; import co.kirikiri.service.dto.roadmap.RoadmapSaveDto; @@ -30,11 +35,6 @@ import co.kirikiri.service.dto.roadmap.request.RoadmapReviewSaveRequest; import co.kirikiri.service.dto.roadmap.request.RoadmapSaveRequest; import co.kirikiri.service.event.RoadmapCreateEvent; -import co.kirikiri.service.exception.AuthenticationException; -import co.kirikiri.service.exception.BadRequestException; -import co.kirikiri.service.exception.ConflictException; -import co.kirikiri.service.exception.ForbiddenException; -import co.kirikiri.service.exception.NotFoundException; import co.kirikiri.service.mapper.RoadmapMapper; import java.util.List; import lombok.RequiredArgsConstructor; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/roadmap/RoadmapReadService.java b/backend/kirikiri/src/main/java/co/kirikiri/service/roadmap/RoadmapReadService.java index 7afa4fce1..35af34aba 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/roadmap/RoadmapReadService.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/service/roadmap/RoadmapReadService.java @@ -1,8 +1,9 @@ package co.kirikiri.service.roadmap; +import co.kirikiri.common.aop.ExceptionConvert; +import co.kirikiri.common.exception.NotFoundException; +import co.kirikiri.common.service.FileService; import co.kirikiri.domain.goalroom.GoalRoom; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.vo.Identifier; import co.kirikiri.domain.roadmap.Roadmap; import co.kirikiri.domain.roadmap.RoadmapCategory; import co.kirikiri.domain.roadmap.RoadmapContent; @@ -10,21 +11,21 @@ import co.kirikiri.domain.roadmap.RoadmapNodes; import co.kirikiri.domain.roadmap.RoadmapReview; import co.kirikiri.domain.roadmap.RoadmapTags; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.persistence.MemberRepository; +import co.kirikiri.member.service.dto.MemberDto; import co.kirikiri.persistence.dto.RoadmapOrderType; import co.kirikiri.persistence.dto.RoadmapSearchDto; import co.kirikiri.persistence.goalroom.GoalRoomRepository; import co.kirikiri.persistence.goalroom.dto.RoadmapGoalRoomsOrderType; -import co.kirikiri.persistence.member.MemberRepository; import co.kirikiri.persistence.roadmap.RoadmapCategoryRepository; import co.kirikiri.persistence.roadmap.RoadmapContentRepository; import co.kirikiri.persistence.roadmap.RoadmapRepository; import co.kirikiri.persistence.roadmap.RoadmapReviewRepository; -import co.kirikiri.service.FileService; -import co.kirikiri.service.aop.ExceptionConvert; import co.kirikiri.service.dto.CustomScrollRequest; import co.kirikiri.service.dto.goalroom.RoadmapGoalRoomDto; import co.kirikiri.service.dto.goalroom.RoadmapGoalRoomScrollDto; -import co.kirikiri.service.dto.member.MemberDto; import co.kirikiri.service.dto.roadmap.RoadmapCategoryDto; import co.kirikiri.service.dto.roadmap.RoadmapContentDto; import co.kirikiri.service.dto.roadmap.RoadmapDto; @@ -43,7 +44,6 @@ import co.kirikiri.service.dto.roadmap.response.RoadmapGoalRoomResponses; import co.kirikiri.service.dto.roadmap.response.RoadmapResponse; import co.kirikiri.service.dto.roadmap.response.RoadmapReviewResponse; -import co.kirikiri.service.exception.NotFoundException; import co.kirikiri.service.mapper.GoalRoomMapper; import co.kirikiri.service.mapper.RoadmapMapper; import co.kirikiri.service.mapper.ScrollResponseMapper; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/scheduler/GoalRoomScheduler.java b/backend/kirikiri/src/main/java/co/kirikiri/service/scheduler/GoalRoomScheduler.java index 71792ac6b..cc75c29d6 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/scheduler/GoalRoomScheduler.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/service/scheduler/GoalRoomScheduler.java @@ -1,13 +1,13 @@ package co.kirikiri.service.scheduler; -import co.kirikiri.domain.BaseEntity; +import co.kirikiri.common.aop.ExceptionConvert; +import co.kirikiri.common.entity.BaseEntity; import co.kirikiri.domain.goalroom.GoalRoom; import co.kirikiri.domain.goalroom.GoalRoomMember; import co.kirikiri.domain.goalroom.GoalRoomPendingMember; import co.kirikiri.persistence.goalroom.GoalRoomMemberRepository; import co.kirikiri.persistence.goalroom.GoalRoomPendingMemberRepository; import co.kirikiri.persistence.goalroom.GoalRoomRepository; -import co.kirikiri.service.aop.ExceptionConvert; import java.time.LocalDate; import java.util.List; import lombok.RequiredArgsConstructor; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/scheduler/RoadmapScheduler.java b/backend/kirikiri/src/main/java/co/kirikiri/service/scheduler/RoadmapScheduler.java index 92af456a9..fc5518a54 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/scheduler/RoadmapScheduler.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/service/scheduler/RoadmapScheduler.java @@ -1,11 +1,11 @@ package co.kirikiri.service.scheduler; +import co.kirikiri.common.aop.ExceptionConvert; import co.kirikiri.domain.goalroom.GoalRoom; import co.kirikiri.domain.roadmap.Roadmap; import co.kirikiri.domain.roadmap.RoadmapStatus; import co.kirikiri.persistence.goalroom.GoalRoomRepository; import co.kirikiri.persistence.roadmap.RoadmapRepository; -import co.kirikiri.service.aop.ExceptionConvert; import java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.scheduling.annotation.Scheduled; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/controller/AuthCreateApiTest.java b/backend/kirikiri/src/test/java/co/kirikiri/auth/controller/AuthCreateApiTest.java similarity index 97% rename from backend/kirikiri/src/test/java/co/kirikiri/controller/AuthCreateApiTest.java rename to backend/kirikiri/src/test/java/co/kirikiri/auth/controller/AuthCreateApiTest.java index 8b1741f4c..420f9b57f 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/controller/AuthCreateApiTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/auth/controller/AuthCreateApiTest.java @@ -1,4 +1,4 @@ -package co.kirikiri.controller; +package co.kirikiri.auth.controller; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; @@ -12,16 +12,16 @@ import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; +import co.kirikiri.auth.service.AuthService; +import co.kirikiri.auth.service.NaverOauthService; +import co.kirikiri.auth.service.dto.OauthRedirectResponse; +import co.kirikiri.auth.service.dto.request.LoginRequest; +import co.kirikiri.auth.service.dto.request.ReissueTokenRequest; +import co.kirikiri.auth.service.dto.response.AuthenticationResponse; +import co.kirikiri.common.exception.AuthenticationException; import co.kirikiri.controller.helper.ControllerTestHelper; import co.kirikiri.controller.helper.FieldDescriptionHelper.FieldDescription; -import co.kirikiri.service.auth.AuthService; -import co.kirikiri.service.auth.NaverOauthService; import co.kirikiri.service.dto.ErrorResponse; -import co.kirikiri.service.dto.auth.OauthRedirectResponse; -import co.kirikiri.service.dto.auth.request.LoginRequest; -import co.kirikiri.service.dto.auth.request.ReissueTokenRequest; -import co.kirikiri.service.dto.auth.response.AuthenticationResponse; -import co.kirikiri.service.exception.AuthenticationException; import com.fasterxml.jackson.core.type.TypeReference; import java.util.List; import org.junit.jupiter.api.Test; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/common/interceptor/AuthInterceptorTest.java b/backend/kirikiri/src/test/java/co/kirikiri/auth/interceptor/AuthInterceptorImplTest.java similarity index 93% rename from backend/kirikiri/src/test/java/co/kirikiri/common/interceptor/AuthInterceptorTest.java rename to backend/kirikiri/src/test/java/co/kirikiri/auth/interceptor/AuthInterceptorImplTest.java index 606505846..4d085dc17 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/common/interceptor/AuthInterceptorTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/auth/interceptor/AuthInterceptorImplTest.java @@ -1,4 +1,4 @@ -package co.kirikiri.common.interceptor; +package co.kirikiri.auth.interceptor; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; @@ -6,8 +6,8 @@ import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.when; -import co.kirikiri.service.auth.AuthService; -import co.kirikiri.service.exception.AuthenticationException; +import co.kirikiri.auth.service.AuthService; +import co.kirikiri.common.exception.AuthenticationException; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -20,7 +20,7 @@ import org.springframework.web.method.HandlerMethod; @ExtendWith(MockitoExtension.class) -class AuthInterceptorTest { +class AuthInterceptorImplTest { private MockHttpServletRequest request; private MockHttpServletResponse response; @@ -32,7 +32,7 @@ class AuthInterceptorTest { private HandlerMethod handlerMethod; @InjectMocks - private AuthInterceptor authInterceptor; + private AuthInterceptorImpl authInterceptor; @BeforeEach void setUp() { diff --git a/backend/kirikiri/src/test/java/co/kirikiri/persistence/auth/RefreshTokenRepositoryTest.java b/backend/kirikiri/src/test/java/co/kirikiri/auth/persistence/RefreshTokenRepositoryTest.java similarity index 89% rename from backend/kirikiri/src/test/java/co/kirikiri/persistence/auth/RefreshTokenRepositoryTest.java rename to backend/kirikiri/src/test/java/co/kirikiri/auth/persistence/RefreshTokenRepositoryTest.java index d31e6d075..7b1520f1d 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/persistence/auth/RefreshTokenRepositoryTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/auth/persistence/RefreshTokenRepositoryTest.java @@ -1,16 +1,16 @@ -package co.kirikiri.persistence.auth; +package co.kirikiri.auth.persistence; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.mockito.Mockito.when; -import co.kirikiri.domain.member.EncryptedPassword; -import co.kirikiri.domain.member.Gender; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.MemberProfile; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; -import co.kirikiri.domain.member.vo.Password; +import co.kirikiri.member.domain.EncryptedPassword; +import co.kirikiri.member.domain.Gender; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.MemberProfile; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.domain.vo.Password; import java.util.Optional; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/common/resolver/MemberIdentifierArgumentResolverTest.java b/backend/kirikiri/src/test/java/co/kirikiri/auth/resolver/MemberIdentifierArgumentResolverImplTest.java similarity index 93% rename from backend/kirikiri/src/test/java/co/kirikiri/common/resolver/MemberIdentifierArgumentResolverTest.java rename to backend/kirikiri/src/test/java/co/kirikiri/auth/resolver/MemberIdentifierArgumentResolverImplTest.java index c9843407f..5e625e778 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/common/resolver/MemberIdentifierArgumentResolverTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/auth/resolver/MemberIdentifierArgumentResolverImplTest.java @@ -1,14 +1,15 @@ -package co.kirikiri.common.resolver; +package co.kirikiri.auth.resolver; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.when; +import co.kirikiri.auth.service.AuthService; +import co.kirikiri.common.exception.AuthenticationException; +import co.kirikiri.common.exception.ServerException; import co.kirikiri.common.interceptor.Authenticated; -import co.kirikiri.service.auth.AuthService; -import co.kirikiri.service.exception.AuthenticationException; -import co.kirikiri.service.exception.ServerException; +import co.kirikiri.common.resolver.MemberIdentifier; import java.util.List; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -23,7 +24,7 @@ import org.springframework.web.method.support.ModelAndViewContainer; @ExtendWith(MockitoExtension.class) -class MemberIdentifierArgumentResolverTest { +class MemberIdentifierArgumentResolverImplTest { private static final String BEARER = "Bearer "; @@ -43,7 +44,7 @@ class MemberIdentifierArgumentResolverTest { private WebDataBinderFactory binderFactory; @InjectMocks - private MemberIdentifierArgumentResolver memberIdentifierArgumentResolver; + private MemberIdentifierArgumentResolverImpl memberIdentifierArgumentResolver; @Test void 정상적으로_String_타입이고_MemberIdentifier이_붙은_인자인_경우() { diff --git a/backend/kirikiri/src/test/java/co/kirikiri/service/AuthServiceTest.java b/backend/kirikiri/src/test/java/co/kirikiri/auth/service/AuthServiceTest.java similarity index 88% rename from backend/kirikiri/src/test/java/co/kirikiri/service/AuthServiceTest.java rename to backend/kirikiri/src/test/java/co/kirikiri/auth/service/AuthServiceTest.java index ddf3ec88a..d15e0c3e6 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/service/AuthServiceTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/auth/service/AuthServiceTest.java @@ -1,25 +1,23 @@ -package co.kirikiri.service; +package co.kirikiri.auth.service; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.mockito.ArgumentMatchers.any; import static org.mockito.BDDMockito.given; -import co.kirikiri.domain.member.EncryptedPassword; -import co.kirikiri.domain.member.Gender; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.MemberProfile; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; -import co.kirikiri.domain.member.vo.Password; -import co.kirikiri.persistence.auth.RefreshTokenRepository; -import co.kirikiri.persistence.member.MemberRepository; -import co.kirikiri.service.auth.AuthService; -import co.kirikiri.service.auth.TokenProvider; -import co.kirikiri.service.dto.auth.request.LoginRequest; -import co.kirikiri.service.dto.auth.request.ReissueTokenRequest; -import co.kirikiri.service.dto.auth.response.AuthenticationResponse; -import co.kirikiri.service.exception.AuthenticationException; +import co.kirikiri.auth.persistence.RefreshTokenRepository; +import co.kirikiri.auth.service.dto.request.LoginRequest; +import co.kirikiri.auth.service.dto.request.ReissueTokenRequest; +import co.kirikiri.auth.service.dto.response.AuthenticationResponse; +import co.kirikiri.common.exception.AuthenticationException; +import co.kirikiri.member.domain.EncryptedPassword; +import co.kirikiri.member.domain.Gender; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.MemberProfile; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.domain.vo.Password; +import co.kirikiri.member.persistence.MemberRepository; import java.util.Optional; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/service/JwtTokenProviderTest.java b/backend/kirikiri/src/test/java/co/kirikiri/auth/service/JwtTokenProviderTest.java similarity index 96% rename from backend/kirikiri/src/test/java/co/kirikiri/service/JwtTokenProviderTest.java rename to backend/kirikiri/src/test/java/co/kirikiri/auth/service/JwtTokenProviderTest.java index ec35509ae..5a5504635 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/service/JwtTokenProviderTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/auth/service/JwtTokenProviderTest.java @@ -1,12 +1,10 @@ -package co.kirikiri.service; +package co.kirikiri.auth.service; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; -import co.kirikiri.service.auth.JwtTokenProvider; -import co.kirikiri.service.auth.TokenProvider; -import co.kirikiri.service.exception.AuthenticationException; +import co.kirikiri.common.exception.AuthenticationException; import io.jsonwebtoken.Claims; import io.jsonwebtoken.Jwts; import io.jsonwebtoken.security.Keys; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/infra/NaverOauthNetworkServiceTest.java b/backend/kirikiri/src/test/java/co/kirikiri/auth/service/NaverOauthNetworkServiceTest.java similarity index 93% rename from backend/kirikiri/src/test/java/co/kirikiri/infra/NaverOauthNetworkServiceTest.java rename to backend/kirikiri/src/test/java/co/kirikiri/auth/service/NaverOauthNetworkServiceTest.java index bdcfe98c2..3b0138ce3 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/infra/NaverOauthNetworkServiceTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/auth/service/NaverOauthNetworkServiceTest.java @@ -1,4 +1,4 @@ -package co.kirikiri.infra; +package co.kirikiri.auth.service; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; @@ -6,8 +6,9 @@ import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.when; -import co.kirikiri.service.dto.auth.NaverOauthTokenDto; -import co.kirikiri.service.dto.auth.response.AuthenticationResponse; +import co.kirikiri.auth.infra.NaverOauthNetworkService; +import co.kirikiri.auth.service.dto.NaverOauthTokenDto; +import co.kirikiri.auth.service.dto.response.AuthenticationResponse; import java.util.Map; import java.util.Optional; import org.junit.jupiter.api.Test; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/service/NaverOauthServiceTest.java b/backend/kirikiri/src/test/java/co/kirikiri/auth/service/NaverOauthServiceTest.java similarity index 83% rename from backend/kirikiri/src/test/java/co/kirikiri/service/NaverOauthServiceTest.java rename to backend/kirikiri/src/test/java/co/kirikiri/auth/service/NaverOauthServiceTest.java index 2b0a06491..d10ec04f6 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/service/NaverOauthServiceTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/auth/service/NaverOauthServiceTest.java @@ -1,20 +1,24 @@ -package co.kirikiri.service; +package co.kirikiri.auth.service; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.when; -import co.kirikiri.domain.member.Member; -import co.kirikiri.persistence.member.MemberRepository; -import co.kirikiri.service.auth.AuthService; -import co.kirikiri.service.auth.NaverOauthService; -import co.kirikiri.service.dto.auth.NaverMemberProfileDto; -import co.kirikiri.service.dto.auth.NaverMemberProfileResponseDto; -import co.kirikiri.service.dto.auth.NaverOauthTokenDto; -import co.kirikiri.service.dto.auth.OauthRedirectResponse; -import co.kirikiri.service.dto.auth.response.AuthenticationResponse; -import co.kirikiri.service.member.MemberService; +import co.kirikiri.auth.service.dto.NaverMemberProfileDto; +import co.kirikiri.auth.service.dto.NaverMemberProfileResponseDto; +import co.kirikiri.auth.service.dto.NaverOauthTokenDto; +import co.kirikiri.auth.service.dto.OauthRedirectResponse; +import co.kirikiri.auth.service.dto.response.AuthenticationResponse; +import co.kirikiri.member.domain.Gender; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.MemberProfile; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.persistence.MemberRepository; +import co.kirikiri.member.service.MemberService; +import java.util.Map; +import java.util.Optional; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; @@ -23,8 +27,6 @@ import org.springframework.core.env.Environment; import org.springframework.http.HttpHeaders; import org.springframework.http.ResponseEntity; -import java.util.Map; -import java.util.Optional; @ExtendWith(MockitoExtension.class) class NaverOauthServiceTest { @@ -112,8 +114,14 @@ class NaverOauthServiceTest { when(memberRepository.findByOauthId(anyString())) .thenReturn(Optional.empty()); - final AuthenticationResponse authenticationResponse = new AuthenticationResponse("refreshToken", "accessToken"); + final MemberProfile memberProfile = new MemberProfile(Gender.MALE, naverMemberProfileResponseDto.email()); + final Member member = new Member(new Identifier("identifier"), naverMemberProfileResponseDto.id(), + new Nickname(naverMemberProfileResponseDto.nickname()), null, memberProfile); when(memberService.oauthJoin(any())) + .thenReturn(member); + + final AuthenticationResponse authenticationResponse = new AuthenticationResponse("refreshToken", "accessToken"); + when(authService.oauthLogin(member)) .thenReturn(authenticationResponse); //when diff --git a/backend/kirikiri/src/test/java/co/kirikiri/common/resolver/RoadmapSaveArgumentResolverTest.java b/backend/kirikiri/src/test/java/co/kirikiri/common/resolver/RoadmapSaveArgumentResolverTest.java index 80973fc0f..e4db7865c 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/common/resolver/RoadmapSaveArgumentResolverTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/common/resolver/RoadmapSaveArgumentResolverTest.java @@ -4,9 +4,9 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.mockito.Mockito.when; -import co.kirikiri.service.dto.member.request.MemberJoinRequest; +import co.kirikiri.common.exception.BadRequestException; +import co.kirikiri.member.service.dto.request.MemberJoinRequest; import co.kirikiri.service.dto.roadmap.request.RoadmapSaveRequest; -import co.kirikiri.service.exception.BadRequestException; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import javax.xml.validation.Validator; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/service/CacheKeyGeneratorTest.java b/backend/kirikiri/src/test/java/co/kirikiri/common/service/CacheKeyGeneratorTest.java similarity index 96% rename from backend/kirikiri/src/test/java/co/kirikiri/service/CacheKeyGeneratorTest.java rename to backend/kirikiri/src/test/java/co/kirikiri/common/service/CacheKeyGeneratorTest.java index 08fea3baf..33aa12c51 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/service/CacheKeyGeneratorTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/common/service/CacheKeyGeneratorTest.java @@ -1,4 +1,4 @@ -package co.kirikiri.service; +package co.kirikiri.common.service; import static org.assertj.core.api.Assertions.assertThat; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/controller/GoalRoomCreateApiTest.java b/backend/kirikiri/src/test/java/co/kirikiri/controller/GoalRoomCreateApiTest.java index 01b22f4ee..a859ec2cb 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/controller/GoalRoomCreateApiTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/controller/GoalRoomCreateApiTest.java @@ -24,6 +24,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; +import co.kirikiri.common.exception.BadRequestException; +import co.kirikiri.common.exception.NotFoundException; import co.kirikiri.controller.helper.ControllerTestHelper; import co.kirikiri.controller.helper.FieldDescriptionHelper.FieldDescription; import co.kirikiri.service.dto.ErrorResponse; @@ -31,8 +33,6 @@ import co.kirikiri.service.dto.goalroom.request.GoalRoomRoadmapNodeRequest; import co.kirikiri.service.dto.goalroom.request.GoalRoomTodoRequest; import co.kirikiri.service.dto.goalroom.response.GoalRoomToDoCheckResponse; -import co.kirikiri.service.exception.BadRequestException; -import co.kirikiri.service.exception.NotFoundException; import co.kirikiri.service.goalroom.GoalRoomCreateService; import co.kirikiri.service.goalroom.GoalRoomReadService; import com.fasterxml.jackson.core.type.TypeReference; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/controller/GoalRoomReadApiTest.java b/backend/kirikiri/src/test/java/co/kirikiri/controller/GoalRoomReadApiTest.java index 1ad346fbb..cfd31b50b 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/controller/GoalRoomReadApiTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/controller/GoalRoomReadApiTest.java @@ -18,8 +18,19 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; +import co.kirikiri.common.exception.BadRequestException; +import co.kirikiri.common.exception.ForbiddenException; +import co.kirikiri.common.exception.NotFoundException; import co.kirikiri.controller.helper.ControllerTestHelper; import co.kirikiri.domain.goalroom.GoalRoomStatus; +import co.kirikiri.member.service.dto.response.MemberCheckFeedResponse; +import co.kirikiri.member.service.dto.response.MemberGoalRoomForListResponse; +import co.kirikiri.member.service.dto.response.MemberGoalRoomResponse; +import co.kirikiri.member.service.dto.response.MemberGoalRoomRoadmapNodeResponse; +import co.kirikiri.member.service.dto.response.MemberGoalRoomRoadmapNodesResponse; +import co.kirikiri.member.service.dto.response.MemberGoalRoomToDoCheckResponse; +import co.kirikiri.member.service.dto.response.MemberGoalRoomTodoResponse; +import co.kirikiri.member.service.dto.response.MemberResponse; import co.kirikiri.service.dto.ErrorResponse; import co.kirikiri.service.dto.goalroom.request.GoalRoomStatusTypeRequest; import co.kirikiri.service.dto.goalroom.response.CheckFeedResponse; @@ -29,15 +40,8 @@ import co.kirikiri.service.dto.goalroom.response.GoalRoomResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodeDetailResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodeResponse; -import co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodesResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomToDoCheckResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomTodoResponse; -import co.kirikiri.service.dto.member.response.MemberGoalRoomForListResponse; -import co.kirikiri.service.dto.member.response.MemberGoalRoomResponse; -import co.kirikiri.service.dto.member.response.MemberResponse; -import co.kirikiri.service.exception.BadRequestException; -import co.kirikiri.service.exception.ForbiddenException; -import co.kirikiri.service.exception.NotFoundException; import co.kirikiri.service.goalroom.GoalRoomCreateService; import co.kirikiri.service.goalroom.GoalRoomReadService; import com.fasterxml.jackson.core.type.TypeReference; @@ -766,18 +770,18 @@ class GoalRoomReadApiTest extends ControllerTestHelper { return new MemberGoalRoomResponse("골룸 이름", "RUNNING", 1L, 15, 20, LocalDate.of(2023, 1, 1), LocalDate.of(2023, 12, 31), 1L, - new GoalRoomRoadmapNodesResponse(false, true, List.of( - new GoalRoomRoadmapNodeResponse(1L, "첫번째 골룸 노드 제목", LocalDate.of(2023, 1, 1), + new MemberGoalRoomRoadmapNodesResponse(false, true, List.of( + new MemberGoalRoomRoadmapNodeResponse(1L, "첫번째 골룸 노드 제목", LocalDate.of(2023, 1, 1), LocalDate.of(2023, 1, 31), 15), - new GoalRoomRoadmapNodeResponse(2L, "두번째 골룸 노드 제목", LocalDate.of(2023, 2, 1), + new MemberGoalRoomRoadmapNodeResponse(2L, "두번째 골룸 노드 제목", LocalDate.of(2023, 2, 1), LocalDate.of(2023, 2, 28), 14))), - List.of(new GoalRoomTodoResponse(1L, "첫 번째 할일", + List.of(new MemberGoalRoomTodoResponse(1L, "첫 번째 할일", LocalDate.of(2023, 1, 15), LocalDate.of(2023, 1, 31), - new GoalRoomToDoCheckResponse(false))), - List.of(new CheckFeedResponse(1L, "imageUrl1", "인증 피드 설명 1", LocalDate.now()), - new CheckFeedResponse(2L, "imageUrl2", "인증 피드 설명 2", LocalDate.now()), - new CheckFeedResponse(3L, "imageUrl3", "인증 피드 설명 3", LocalDate.now()), - new CheckFeedResponse(4L, "imageUrl4", "인증 피드 설명 4", LocalDate.now()))); + new MemberGoalRoomToDoCheckResponse(false))), + List.of(new MemberCheckFeedResponse(1L, "imageUrl1", "인증 피드 설명 1", LocalDate.now()), + new MemberCheckFeedResponse(2L, "imageUrl2", "인증 피드 설명 2", LocalDate.now()), + new MemberCheckFeedResponse(3L, "imageUrl3", "인증 피드 설명 3", LocalDate.now()), + new MemberCheckFeedResponse(4L, "imageUrl4", "인증 피드 설명 4", LocalDate.now()))); } diff --git a/backend/kirikiri/src/test/java/co/kirikiri/controller/MemberCreateApiTest.java b/backend/kirikiri/src/test/java/co/kirikiri/controller/MemberCreateApiTest.java index 0764ac644..b1fdda593 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/controller/MemberCreateApiTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/controller/MemberCreateApiTest.java @@ -11,14 +11,15 @@ import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; +import co.kirikiri.common.exception.BadRequestException; +import co.kirikiri.common.exception.ConflictException; import co.kirikiri.controller.helper.ControllerTestHelper; import co.kirikiri.controller.helper.FieldDescriptionHelper.FieldDescription; +import co.kirikiri.member.controller.MemberController; +import co.kirikiri.member.service.MemberService; +import co.kirikiri.member.service.dto.request.GenderType; +import co.kirikiri.member.service.dto.request.MemberJoinRequest; import co.kirikiri.service.dto.ErrorResponse; -import co.kirikiri.service.dto.member.request.GenderType; -import co.kirikiri.service.dto.member.request.MemberJoinRequest; -import co.kirikiri.service.exception.BadRequestException; -import co.kirikiri.service.exception.ConflictException; -import co.kirikiri.service.member.MemberService; import com.fasterxml.jackson.core.type.TypeReference; import java.util.List; import org.junit.jupiter.api.Test; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/controller/MemberReadApiTest.java b/backend/kirikiri/src/test/java/co/kirikiri/controller/MemberReadApiTest.java index cfb492596..341d99994 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/controller/MemberReadApiTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/controller/MemberReadApiTest.java @@ -12,13 +12,14 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; +import co.kirikiri.common.exception.NotFoundException; import co.kirikiri.controller.helper.ControllerTestHelper; -import co.kirikiri.domain.member.Gender; +import co.kirikiri.member.controller.MemberController; +import co.kirikiri.member.domain.Gender; +import co.kirikiri.member.service.MemberService; +import co.kirikiri.member.service.dto.response.MemberInformationForPublicResponse; +import co.kirikiri.member.service.dto.response.MemberInformationResponse; import co.kirikiri.service.dto.ErrorResponse; -import co.kirikiri.service.dto.member.response.MemberInformationForPublicResponse; -import co.kirikiri.service.dto.member.response.MemberInformationResponse; -import co.kirikiri.service.exception.NotFoundException; -import co.kirikiri.service.member.MemberService; import com.fasterxml.jackson.core.type.TypeReference; import org.junit.jupiter.api.Test; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/controller/RoadmapCreateApiTest.java b/backend/kirikiri/src/test/java/co/kirikiri/controller/RoadmapCreateApiTest.java index 04f4a8d19..72b9bda67 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/controller/RoadmapCreateApiTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/controller/RoadmapCreateApiTest.java @@ -24,6 +24,11 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; +import co.kirikiri.common.exception.AuthenticationException; +import co.kirikiri.common.exception.BadRequestException; +import co.kirikiri.common.exception.ConflictException; +import co.kirikiri.common.exception.ForbiddenException; +import co.kirikiri.common.exception.NotFoundException; import co.kirikiri.controller.helper.ControllerTestHelper; import co.kirikiri.service.dto.ErrorResponse; import co.kirikiri.service.dto.roadmap.request.RoadmapCategorySaveRequest; @@ -32,11 +37,6 @@ import co.kirikiri.service.dto.roadmap.request.RoadmapReviewSaveRequest; import co.kirikiri.service.dto.roadmap.request.RoadmapSaveRequest; import co.kirikiri.service.dto.roadmap.request.RoadmapTagSaveRequest; -import co.kirikiri.service.exception.AuthenticationException; -import co.kirikiri.service.exception.BadRequestException; -import co.kirikiri.service.exception.ConflictException; -import co.kirikiri.service.exception.ForbiddenException; -import co.kirikiri.service.exception.NotFoundException; import co.kirikiri.service.roadmap.RoadmapCreateService; import co.kirikiri.service.roadmap.RoadmapReadService; import com.fasterxml.jackson.core.type.TypeReference; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/controller/RoadmapReadApiTest.java b/backend/kirikiri/src/test/java/co/kirikiri/controller/RoadmapReadApiTest.java index ceda742a1..fa34e9c88 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/controller/RoadmapReadApiTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/controller/RoadmapReadApiTest.java @@ -16,12 +16,13 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; +import co.kirikiri.common.exception.NotFoundException; import co.kirikiri.controller.helper.ControllerTestHelper; import co.kirikiri.domain.goalroom.GoalRoomStatus; import co.kirikiri.domain.roadmap.RoadmapDifficulty; +import co.kirikiri.member.service.dto.response.MemberResponse; import co.kirikiri.service.dto.CustomScrollRequest; import co.kirikiri.service.dto.ErrorResponse; -import co.kirikiri.service.dto.member.response.MemberResponse; import co.kirikiri.service.dto.roadmap.request.RoadmapOrderTypeRequest; import co.kirikiri.service.dto.roadmap.response.MemberRoadmapResponse; import co.kirikiri.service.dto.roadmap.response.MemberRoadmapResponses; @@ -35,7 +36,6 @@ import co.kirikiri.service.dto.roadmap.response.RoadmapResponse; import co.kirikiri.service.dto.roadmap.response.RoadmapReviewResponse; import co.kirikiri.service.dto.roadmap.response.RoadmapTagResponse; -import co.kirikiri.service.exception.NotFoundException; import co.kirikiri.service.roadmap.RoadmapCreateService; import co.kirikiri.service.roadmap.RoadmapReadService; import com.fasterxml.jackson.core.type.TypeReference; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/controller/helper/ControllerTestHelper.java b/backend/kirikiri/src/test/java/co/kirikiri/controller/helper/ControllerTestHelper.java index 7fcf69214..99144d662 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/controller/helper/ControllerTestHelper.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/controller/helper/ControllerTestHelper.java @@ -3,12 +3,12 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.when; -import co.kirikiri.common.interceptor.AuthInterceptor; -import co.kirikiri.common.resolver.MemberIdentifierArgumentResolver; +import co.kirikiri.auth.interceptor.AuthInterceptorImpl; +import co.kirikiri.auth.resolver.MemberIdentifierArgumentResolverImpl; +import java.util.List; import org.junit.jupiter.api.BeforeEach; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.restdocs.payload.FieldDescriptor; -import java.util.List; public class ControllerTestHelper extends RestDocsHelper { @@ -16,10 +16,10 @@ public class ControllerTestHelper extends RestDocsHelper { protected final String BEARER_TOKEN_FORMAT = "Bearer %s"; @MockBean - protected AuthInterceptor authInterceptor; + protected AuthInterceptorImpl authInterceptor; @MockBean - private MemberIdentifierArgumentResolver memberIdentifierArgumentResolver; + private MemberIdentifierArgumentResolverImpl memberIdentifierArgumentResolver; @BeforeEach void setUp() { diff --git a/backend/kirikiri/src/test/java/co/kirikiri/domain/goalroom/GoalRoomMemberTest.java b/backend/kirikiri/src/test/java/co/kirikiri/domain/goalroom/GoalRoomMemberTest.java index ba9af7109..816bbfb86 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/domain/goalroom/GoalRoomMemberTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/domain/goalroom/GoalRoomMemberTest.java @@ -2,11 +2,11 @@ import static org.assertj.core.api.Assertions.assertThat; -import co.kirikiri.domain.member.EncryptedPassword; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; -import co.kirikiri.domain.member.vo.Password; +import co.kirikiri.member.domain.EncryptedPassword; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.domain.vo.Password; import org.junit.jupiter.api.Test; import java.time.LocalDateTime; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/domain/goalroom/GoalRoomMembersTest.java b/backend/kirikiri/src/test/java/co/kirikiri/domain/goalroom/GoalRoomMembersTest.java index eb9dbc68f..db95bf5ce 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/domain/goalroom/GoalRoomMembersTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/domain/goalroom/GoalRoomMembersTest.java @@ -2,11 +2,11 @@ import static org.assertj.core.api.Assertions.assertThat; -import co.kirikiri.domain.member.EncryptedPassword; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; -import co.kirikiri.domain.member.vo.Password; +import co.kirikiri.member.domain.EncryptedPassword; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.domain.vo.Password; import org.junit.jupiter.api.Test; import java.time.LocalDateTime; import java.util.List; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/domain/goalroom/GoalRoomPendingMemberTest.java b/backend/kirikiri/src/test/java/co/kirikiri/domain/goalroom/GoalRoomPendingMemberTest.java index 78a675c65..cf482aada 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/domain/goalroom/GoalRoomPendingMemberTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/domain/goalroom/GoalRoomPendingMemberTest.java @@ -4,13 +4,13 @@ import co.kirikiri.domain.goalroom.vo.GoalRoomName; import co.kirikiri.domain.goalroom.vo.LimitedMemberCount; -import co.kirikiri.domain.member.EncryptedPassword; -import co.kirikiri.domain.member.Gender; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.MemberProfile; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; -import co.kirikiri.domain.member.vo.Password; +import co.kirikiri.member.domain.EncryptedPassword; +import co.kirikiri.member.domain.Gender; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.MemberProfile; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.domain.vo.Password; import co.kirikiri.domain.roadmap.RoadmapContent; import org.junit.jupiter.api.Test; import java.time.LocalDateTime; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/domain/goalroom/GoalRoomPendingMembersTest.java b/backend/kirikiri/src/test/java/co/kirikiri/domain/goalroom/GoalRoomPendingMembersTest.java index bcb18de45..bdd066327 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/domain/goalroom/GoalRoomPendingMembersTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/domain/goalroom/GoalRoomPendingMembersTest.java @@ -3,14 +3,14 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; -import co.kirikiri.domain.exception.UnexpectedDomainException; +import co.kirikiri.common.exception.UnexpectedDomainException; import co.kirikiri.domain.goalroom.vo.GoalRoomName; import co.kirikiri.domain.goalroom.vo.LimitedMemberCount; -import co.kirikiri.domain.member.EncryptedPassword; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; -import co.kirikiri.domain.member.vo.Password; +import co.kirikiri.member.domain.EncryptedPassword; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.domain.vo.Password; import co.kirikiri.domain.roadmap.RoadmapContent; import java.time.LocalDateTime; import java.util.List; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/domain/goalroom/GoalRoomTest.java b/backend/kirikiri/src/test/java/co/kirikiri/domain/goalroom/GoalRoomTest.java index 8459bd4d1..f11343bd4 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/domain/goalroom/GoalRoomTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/domain/goalroom/GoalRoomTest.java @@ -8,13 +8,13 @@ import co.kirikiri.domain.goalroom.vo.GoalRoomName; import co.kirikiri.domain.goalroom.vo.LimitedMemberCount; import co.kirikiri.domain.goalroom.vo.Period; -import co.kirikiri.domain.member.EncryptedPassword; -import co.kirikiri.domain.member.Gender; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.MemberProfile; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; -import co.kirikiri.domain.member.vo.Password; +import co.kirikiri.member.domain.EncryptedPassword; +import co.kirikiri.member.domain.Gender; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.MemberProfile; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.domain.vo.Password; import co.kirikiri.domain.roadmap.Roadmap; import co.kirikiri.domain.roadmap.RoadmapCategory; import co.kirikiri.domain.roadmap.RoadmapContent; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/domain/roadmap/RoadmapContentTest.java b/backend/kirikiri/src/test/java/co/kirikiri/domain/roadmap/RoadmapContentTest.java index 4a663ac40..1fcf31d41 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/domain/roadmap/RoadmapContentTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/domain/roadmap/RoadmapContentTest.java @@ -6,13 +6,13 @@ import static org.junit.jupiter.api.Assertions.assertAll; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; -import co.kirikiri.domain.member.EncryptedPassword; -import co.kirikiri.domain.member.Gender; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.MemberProfile; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; -import co.kirikiri.domain.member.vo.Password; +import co.kirikiri.member.domain.EncryptedPassword; +import co.kirikiri.member.domain.Gender; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.MemberProfile; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.domain.vo.Password; import co.kirikiri.domain.roadmap.exception.RoadmapException; import java.util.List; import org.junit.jupiter.api.Test; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/domain/roadmap/RoadmapNodeImagesTest.java b/backend/kirikiri/src/test/java/co/kirikiri/domain/roadmap/RoadmapNodeImagesTest.java index d5aab01ae..12b46e1ee 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/domain/roadmap/RoadmapNodeImagesTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/domain/roadmap/RoadmapNodeImagesTest.java @@ -3,7 +3,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; -import co.kirikiri.domain.ImageContentType; +import co.kirikiri.common.type.ImageContentType; import co.kirikiri.domain.roadmap.exception.RoadmapException; import java.util.List; import org.junit.jupiter.api.Test; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/domain/roadmap/RoadmapReviewTest.java b/backend/kirikiri/src/test/java/co/kirikiri/domain/roadmap/RoadmapReviewTest.java index 0e7dcd492..50c32f252 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/domain/roadmap/RoadmapReviewTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/domain/roadmap/RoadmapReviewTest.java @@ -4,13 +4,13 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; -import co.kirikiri.domain.member.EncryptedPassword; -import co.kirikiri.domain.member.Gender; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.MemberProfile; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; -import co.kirikiri.domain.member.vo.Password; +import co.kirikiri.member.domain.EncryptedPassword; +import co.kirikiri.member.domain.Gender; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.MemberProfile; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.domain.vo.Password; import co.kirikiri.domain.roadmap.exception.RoadmapException; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/domain/roadmap/RoadmapTest.java b/backend/kirikiri/src/test/java/co/kirikiri/domain/roadmap/RoadmapTest.java index cea624848..756cb856e 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/domain/roadmap/RoadmapTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/domain/roadmap/RoadmapTest.java @@ -5,13 +5,13 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; -import co.kirikiri.domain.member.EncryptedPassword; -import co.kirikiri.domain.member.Gender; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.MemberProfile; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; -import co.kirikiri.domain.member.vo.Password; +import co.kirikiri.member.domain.EncryptedPassword; +import co.kirikiri.member.domain.Gender; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.MemberProfile; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.domain.vo.Password; import co.kirikiri.domain.roadmap.exception.RoadmapException; import java.util.List; import org.junit.jupiter.api.Test; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/infra/AmazonS3FileServiceTest.java b/backend/kirikiri/src/test/java/co/kirikiri/infra/AmazonS3FileServiceTest.java index 602e83e4d..9e3c12788 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/infra/AmazonS3FileServiceTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/infra/AmazonS3FileServiceTest.java @@ -7,8 +7,10 @@ import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.when; +import co.kirikiri.common.exception.ServerException; +import co.kirikiri.common.infra.AmazonS3FileService; +import co.kirikiri.common.infra.CloudFrontService; import co.kirikiri.service.dto.FileInformation; -import co.kirikiri.service.exception.ServerException; import com.amazonaws.AmazonServiceException; import com.amazonaws.Protocol; import com.amazonaws.SdkClientException; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/infra/CloudFrontServiceTest.java b/backend/kirikiri/src/test/java/co/kirikiri/infra/CloudFrontServiceTest.java index 1b56ff0d4..517944096 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/infra/CloudFrontServiceTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/infra/CloudFrontServiceTest.java @@ -4,7 +4,8 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.mockito.Mockito.when; -import co.kirikiri.service.exception.ServerException; +import co.kirikiri.common.exception.ServerException; +import co.kirikiri.common.infra.CloudFrontService; import java.net.MalformedURLException; import java.net.URL; import org.junit.jupiter.api.Test; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/integration/AuthenticationIntegrationTest.java b/backend/kirikiri/src/test/java/co/kirikiri/integration/AuthenticationIntegrationTest.java index efc6e01a2..7d192e4e6 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/integration/AuthenticationIntegrationTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/integration/AuthenticationIntegrationTest.java @@ -6,11 +6,11 @@ import static co.kirikiri.integration.fixture.MemberAPIFixture.DEFAULT_PASSWORD; import static org.assertj.core.api.Assertions.assertThat; +import co.kirikiri.auth.service.dto.request.LoginRequest; +import co.kirikiri.auth.service.dto.request.ReissueTokenRequest; +import co.kirikiri.auth.service.dto.response.AuthenticationResponse; import co.kirikiri.integration.helper.InitIntegrationTest; import co.kirikiri.service.dto.ErrorResponse; -import co.kirikiri.service.dto.auth.request.LoginRequest; -import co.kirikiri.service.dto.auth.request.ReissueTokenRequest; -import co.kirikiri.service.dto.auth.response.AuthenticationResponse; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import io.restassured.response.ExtractableResponse; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/integration/GoalRoomCreateIntegrationTest.java b/backend/kirikiri/src/test/java/co/kirikiri/integration/GoalRoomCreateIntegrationTest.java index b1f922460..c31018826 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/integration/GoalRoomCreateIntegrationTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/integration/GoalRoomCreateIntegrationTest.java @@ -30,9 +30,13 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertAll; +import co.kirikiri.auth.service.dto.request.LoginRequest; import co.kirikiri.integration.helper.InitIntegrationTest; +import co.kirikiri.member.service.dto.request.GenderType; +import co.kirikiri.member.service.dto.request.MemberJoinRequest; +import co.kirikiri.member.service.dto.response.MemberGoalRoomResponse; +import co.kirikiri.member.service.dto.response.MemberInformationResponse; import co.kirikiri.service.dto.ErrorResponse; -import co.kirikiri.service.dto.auth.request.LoginRequest; import co.kirikiri.service.dto.goalroom.GoalRoomFilterTypeDto; import co.kirikiri.service.dto.goalroom.request.CheckFeedRequest; import co.kirikiri.service.dto.goalroom.request.GoalRoomCreateRequest; @@ -40,10 +44,6 @@ import co.kirikiri.service.dto.goalroom.request.GoalRoomTodoRequest; import co.kirikiri.service.dto.goalroom.response.GoalRoomMemberResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomToDoCheckResponse; -import co.kirikiri.service.dto.member.request.GenderType; -import co.kirikiri.service.dto.member.request.MemberJoinRequest; -import co.kirikiri.service.dto.member.response.MemberGoalRoomResponse; -import co.kirikiri.service.dto.member.response.MemberInformationResponse; import co.kirikiri.service.dto.roadmap.response.RoadmapGoalRoomResponses; import co.kirikiri.service.dto.roadmap.response.RoadmapResponse; import com.fasterxml.jackson.core.JsonProcessingException; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/integration/GoalRoomReadIntegrationTest.java b/backend/kirikiri/src/test/java/co/kirikiri/integration/GoalRoomReadIntegrationTest.java index bed2603b5..026412a1f 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/integration/GoalRoomReadIntegrationTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/integration/GoalRoomReadIntegrationTest.java @@ -32,28 +32,28 @@ import static co.kirikiri.integration.fixture.RoadmapAPIFixture.로드맵을_아이디로_조회하고_응답객체를_반환한다; import static org.assertj.core.api.Assertions.assertThat; +import co.kirikiri.auth.service.dto.request.LoginRequest; import co.kirikiri.integration.helper.InitIntegrationTest; +import co.kirikiri.member.service.dto.request.GenderType; +import co.kirikiri.member.service.dto.request.MemberJoinRequest; +import co.kirikiri.member.service.dto.response.MemberCheckFeedResponse; +import co.kirikiri.member.service.dto.response.MemberGoalRoomForListResponse; +import co.kirikiri.member.service.dto.response.MemberGoalRoomResponse; +import co.kirikiri.member.service.dto.response.MemberGoalRoomRoadmapNodeResponse; +import co.kirikiri.member.service.dto.response.MemberGoalRoomRoadmapNodesResponse; import co.kirikiri.persistence.goalroom.dto.RoadmapGoalRoomsOrderType; import co.kirikiri.service.dto.ErrorResponse; -import co.kirikiri.service.dto.auth.request.LoginRequest; import co.kirikiri.service.dto.goalroom.GoalRoomMemberSortTypeDto; import co.kirikiri.service.dto.goalroom.request.CheckFeedRequest; import co.kirikiri.service.dto.goalroom.request.GoalRoomCreateRequest; import co.kirikiri.service.dto.goalroom.request.GoalRoomRoadmapNodeRequest; import co.kirikiri.service.dto.goalroom.request.GoalRoomTodoRequest; -import co.kirikiri.service.dto.goalroom.response.CheckFeedResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomCertifiedResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomCheckFeedResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomMemberResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodeDetailResponse; -import co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodeResponse; -import co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodesResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomTodoResponse; -import co.kirikiri.service.dto.member.request.GenderType; -import co.kirikiri.service.dto.member.request.MemberJoinRequest; -import co.kirikiri.service.dto.member.response.MemberGoalRoomForListResponse; -import co.kirikiri.service.dto.member.response.MemberGoalRoomResponse; import co.kirikiri.service.dto.roadmap.request.RoadmapDifficultyType; import co.kirikiri.service.dto.roadmap.request.RoadmapNodeSaveRequest; import co.kirikiri.service.dto.roadmap.request.RoadmapSaveRequest; @@ -201,12 +201,12 @@ class GoalRoomReadIntegrationTest extends InitIntegrationTest { // then final MemberGoalRoomResponse 예상되는_응답값 = new MemberGoalRoomResponse(정상적인_골룸_이름, "RUNNING", 기본_회원_아이디, 2, 정상적인_골룸_제한_인원, 오늘, 십일_후, 로드맵_응답.content().id(), - new GoalRoomRoadmapNodesResponse(false, false, - List.of(new GoalRoomRoadmapNodeResponse(로드맵_응답.content().nodes().get(0).id(), + new MemberGoalRoomRoadmapNodesResponse(false, false, + List.of(new MemberGoalRoomRoadmapNodeResponse(로드맵_응답.content().nodes().get(0).id(), "roadmap 1st week", 오늘, 십일_후, 정상적인_골룸_노드_인증_횟수))), List.of(), - List.of(new CheckFeedResponse(2L, "default-image-path", "image description", LocalDate.now()), - new CheckFeedResponse(1L, "default-image-path", "image description", LocalDate.now()))); + List.of(new MemberCheckFeedResponse(2L, "default-image-path", "image description", LocalDate.now()), + new MemberCheckFeedResponse(1L, "default-image-path", "image description", LocalDate.now()))); assertThat(요청_응답값) .usingRecursiveComparison() diff --git a/backend/kirikiri/src/test/java/co/kirikiri/integration/GoalRoomSchedulerIntegrationTest.java b/backend/kirikiri/src/test/java/co/kirikiri/integration/GoalRoomSchedulerIntegrationTest.java index f4f5e9399..c03809593 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/integration/GoalRoomSchedulerIntegrationTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/integration/GoalRoomSchedulerIntegrationTest.java @@ -21,17 +21,17 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertAll; +import co.kirikiri.auth.service.dto.request.LoginRequest; import co.kirikiri.domain.goalroom.GoalRoom; import co.kirikiri.domain.goalroom.GoalRoomStatus; import co.kirikiri.integration.helper.InitIntegrationTest; +import co.kirikiri.member.service.dto.request.GenderType; +import co.kirikiri.member.service.dto.request.MemberJoinRequest; +import co.kirikiri.member.service.dto.response.MemberGoalRoomResponse; import co.kirikiri.persistence.goalroom.GoalRoomMemberRepository; import co.kirikiri.persistence.goalroom.GoalRoomPendingMemberRepository; -import co.kirikiri.service.dto.auth.request.LoginRequest; import co.kirikiri.service.dto.goalroom.request.GoalRoomCreateRequest; import co.kirikiri.service.dto.goalroom.request.GoalRoomRoadmapNodeRequest; -import co.kirikiri.service.dto.member.request.GenderType; -import co.kirikiri.service.dto.member.request.MemberJoinRequest; -import co.kirikiri.service.dto.member.response.MemberGoalRoomResponse; import co.kirikiri.service.dto.roadmap.response.RoadmapResponse; import co.kirikiri.service.scheduler.GoalRoomScheduler; import java.io.IOException; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/integration/MemberCreateIntegrationTest.java b/backend/kirikiri/src/test/java/co/kirikiri/integration/MemberCreateIntegrationTest.java index 9d58ca281..44910b45f 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/integration/MemberCreateIntegrationTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/integration/MemberCreateIntegrationTest.java @@ -5,9 +5,9 @@ import static org.assertj.core.api.Assertions.assertThat; import co.kirikiri.integration.helper.InitIntegrationTest; +import co.kirikiri.member.service.dto.request.GenderType; +import co.kirikiri.member.service.dto.request.MemberJoinRequest; import co.kirikiri.service.dto.ErrorResponse; -import co.kirikiri.service.dto.member.request.GenderType; -import co.kirikiri.service.dto.member.request.MemberJoinRequest; import io.restassured.common.mapper.TypeRef; import io.restassured.response.ExtractableResponse; import io.restassured.response.Response; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/integration/MemberReadIntegrationTest.java b/backend/kirikiri/src/test/java/co/kirikiri/integration/MemberReadIntegrationTest.java index d86c9a31e..9a790a59c 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/integration/MemberReadIntegrationTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/integration/MemberReadIntegrationTest.java @@ -9,12 +9,12 @@ import static co.kirikiri.integration.fixture.MemberAPIFixture.회원가입; import static org.assertj.core.api.Assertions.assertThat; -import co.kirikiri.domain.member.Gender; import co.kirikiri.integration.helper.InitIntegrationTest; +import co.kirikiri.member.domain.Gender; +import co.kirikiri.member.service.dto.request.MemberJoinRequest; +import co.kirikiri.member.service.dto.response.MemberInformationForPublicResponse; +import co.kirikiri.member.service.dto.response.MemberInformationResponse; import co.kirikiri.service.dto.ErrorResponse; -import co.kirikiri.service.dto.member.request.MemberJoinRequest; -import co.kirikiri.service.dto.member.response.MemberInformationForPublicResponse; -import co.kirikiri.service.dto.member.response.MemberInformationResponse; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import io.restassured.response.ExtractableResponse; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/integration/RoadmapCreateIntegrationTest.java b/backend/kirikiri/src/test/java/co/kirikiri/integration/RoadmapCreateIntegrationTest.java index 32e6b9023..28de9fe3d 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/integration/RoadmapCreateIntegrationTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/integration/RoadmapCreateIntegrationTest.java @@ -12,11 +12,11 @@ import static co.kirikiri.integration.fixture.RoadmapAPIFixture.요청을_받는_이미지가_포함된_로드맵_생성; import static org.assertj.core.api.Assertions.assertThat; +import co.kirikiri.auth.service.dto.request.LoginRequest; import co.kirikiri.integration.helper.InitIntegrationTest; +import co.kirikiri.member.service.dto.request.GenderType; +import co.kirikiri.member.service.dto.request.MemberJoinRequest; import co.kirikiri.service.dto.ErrorResponse; -import co.kirikiri.service.dto.auth.request.LoginRequest; -import co.kirikiri.service.dto.member.request.GenderType; -import co.kirikiri.service.dto.member.request.MemberJoinRequest; import co.kirikiri.service.dto.roadmap.request.RoadmapCategorySaveRequest; import co.kirikiri.service.dto.roadmap.request.RoadmapDifficultyType; import co.kirikiri.service.dto.roadmap.request.RoadmapNodeSaveRequest; @@ -25,13 +25,13 @@ import io.restassured.common.mapper.TypeRef; import io.restassured.response.ExtractableResponse; import io.restassured.response.Response; +import java.io.IOException; +import java.util.Collections; +import java.util.List; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; import org.springframework.http.HttpStatus; -import java.io.IOException; -import java.util.Collections; -import java.util.List; class RoadmapCreateIntegrationTest extends InitIntegrationTest { diff --git a/backend/kirikiri/src/test/java/co/kirikiri/integration/RoadmapReadOrderIntegrationTest.java b/backend/kirikiri/src/test/java/co/kirikiri/integration/RoadmapReadOrderIntegrationTest.java index ddd207f71..8630b44c1 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/integration/RoadmapReadOrderIntegrationTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/integration/RoadmapReadOrderIntegrationTest.java @@ -21,10 +21,10 @@ import co.kirikiri.domain.goalroom.GoalRoom; import co.kirikiri.domain.roadmap.RoadmapCategory; import co.kirikiri.integration.helper.InitIntegrationTest; +import co.kirikiri.member.service.dto.response.MemberInformationResponse; import co.kirikiri.persistence.dto.RoadmapOrderType; import co.kirikiri.service.dto.goalroom.request.GoalRoomCreateRequest; import co.kirikiri.service.dto.goalroom.request.GoalRoomRoadmapNodeRequest; -import co.kirikiri.service.dto.member.response.MemberInformationResponse; import co.kirikiri.service.dto.roadmap.request.RoadmapDifficultyType; import co.kirikiri.service.dto.roadmap.request.RoadmapNodeSaveRequest; import co.kirikiri.service.dto.roadmap.request.RoadmapReviewSaveRequest; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/integration/RoadmapReviewCreateIntegrationTest.java b/backend/kirikiri/src/test/java/co/kirikiri/integration/RoadmapReviewCreateIntegrationTest.java index 3f5784e8a..96f22dfaf 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/integration/RoadmapReviewCreateIntegrationTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/integration/RoadmapReviewCreateIntegrationTest.java @@ -8,7 +8,6 @@ import static co.kirikiri.integration.fixture.GoalRoomAPIFixture.정상적인_골룸_노드_인증_횟수; import static co.kirikiri.integration.fixture.GoalRoomAPIFixture.정상적인_골룸_이름; import static co.kirikiri.integration.fixture.GoalRoomAPIFixture.정상적인_골룸_제한_인원; -import static co.kirikiri.integration.fixture.GoalRoomAPIFixture.정상적인_골룸_투두_컨텐츠; import static co.kirikiri.integration.fixture.MemberAPIFixture.DEFAULT_EMAIL; import static co.kirikiri.integration.fixture.MemberAPIFixture.요청을_받는_사용자_자신의_정보_조회_요청; import static co.kirikiri.integration.fixture.MemberAPIFixture.회원가입; @@ -17,24 +16,24 @@ import static co.kirikiri.integration.fixture.RoadmapAPIFixture.리뷰를_생성한다; import static org.assertj.core.api.Assertions.assertThat; +import co.kirikiri.auth.service.dto.request.LoginRequest; import co.kirikiri.domain.goalroom.GoalRoom; import co.kirikiri.integration.helper.InitIntegrationTest; +import co.kirikiri.member.service.dto.request.GenderType; +import co.kirikiri.member.service.dto.request.MemberJoinRequest; +import co.kirikiri.member.service.dto.response.MemberInformationResponse; import co.kirikiri.service.dto.ErrorResponse; -import co.kirikiri.service.dto.auth.request.LoginRequest; import co.kirikiri.service.dto.goalroom.request.GoalRoomCreateRequest; import co.kirikiri.service.dto.goalroom.request.GoalRoomRoadmapNodeRequest; -import co.kirikiri.service.dto.member.request.GenderType; -import co.kirikiri.service.dto.member.request.MemberJoinRequest; -import co.kirikiri.service.dto.member.response.MemberInformationResponse; import co.kirikiri.service.dto.roadmap.request.RoadmapReviewSaveRequest; import co.kirikiri.service.dto.roadmap.response.RoadmapResponse; import io.restassured.common.mapper.TypeRef; import io.restassured.response.ExtractableResponse; import io.restassured.response.Response; -import org.junit.jupiter.api.Test; -import org.springframework.http.HttpStatus; import java.io.IOException; import java.util.List; +import org.junit.jupiter.api.Test; +import org.springframework.http.HttpStatus; class RoadmapReviewCreateIntegrationTest extends InitIntegrationTest { diff --git a/backend/kirikiri/src/test/java/co/kirikiri/integration/RoadmapReviewReadIntegrationTest.java b/backend/kirikiri/src/test/java/co/kirikiri/integration/RoadmapReviewReadIntegrationTest.java index ba7dd7fea..159720a70 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/integration/RoadmapReviewReadIntegrationTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/integration/RoadmapReviewReadIntegrationTest.java @@ -12,15 +12,15 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertAll; +import co.kirikiri.auth.service.dto.request.LoginRequest; import co.kirikiri.domain.goalroom.GoalRoom; import co.kirikiri.integration.helper.InitIntegrationTest; +import co.kirikiri.member.service.dto.request.GenderType; +import co.kirikiri.member.service.dto.request.MemberJoinRequest; +import co.kirikiri.member.service.dto.response.MemberInformationResponse; +import co.kirikiri.member.service.dto.response.MemberResponse; import co.kirikiri.service.dto.CustomScrollRequest; import co.kirikiri.service.dto.ErrorResponse; -import co.kirikiri.service.dto.auth.request.LoginRequest; -import co.kirikiri.service.dto.member.request.GenderType; -import co.kirikiri.service.dto.member.request.MemberJoinRequest; -import co.kirikiri.service.dto.member.response.MemberInformationResponse; -import co.kirikiri.service.dto.member.response.MemberResponse; import co.kirikiri.service.dto.roadmap.request.RoadmapReviewSaveRequest; import co.kirikiri.service.dto.roadmap.response.RoadmapResponse; import co.kirikiri.service.dto.roadmap.response.RoadmapReviewResponse; @@ -29,11 +29,11 @@ import io.restassured.common.mapper.TypeRef; import io.restassured.response.ExtractableResponse; import io.restassured.response.Response; -import org.junit.jupiter.api.Test; -import org.springframework.http.HttpStatus; import java.io.IOException; import java.time.LocalDateTime; import java.util.List; +import org.junit.jupiter.api.Test; +import org.springframework.http.HttpStatus; class RoadmapReviewReadIntegrationTest extends InitIntegrationTest { diff --git a/backend/kirikiri/src/test/java/co/kirikiri/integration/RoadmapSearchIntegrationTest.java b/backend/kirikiri/src/test/java/co/kirikiri/integration/RoadmapSearchIntegrationTest.java index 0f763186e..10382cf1f 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/integration/RoadmapSearchIntegrationTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/integration/RoadmapSearchIntegrationTest.java @@ -8,16 +8,16 @@ import static org.assertj.core.api.Assertions.assertThat; import co.kirikiri.integration.helper.InitIntegrationTest; -import co.kirikiri.service.dto.member.response.MemberInformationResponse; +import co.kirikiri.member.service.dto.response.MemberInformationResponse; import co.kirikiri.service.dto.roadmap.request.RoadmapDifficultyType; import co.kirikiri.service.dto.roadmap.request.RoadmapNodeSaveRequest; import co.kirikiri.service.dto.roadmap.request.RoadmapSaveRequest; import co.kirikiri.service.dto.roadmap.request.RoadmapTagSaveRequest; import co.kirikiri.service.dto.roadmap.response.RoadmapForListResponses; import io.restassured.common.mapper.TypeRef; -import org.junit.jupiter.api.Test; import java.io.IOException; import java.util.List; +import org.junit.jupiter.api.Test; class RoadmapSearchIntegrationTest extends InitIntegrationTest { diff --git a/backend/kirikiri/src/test/java/co/kirikiri/integration/fixture/AuthenticationAPIFixture.java b/backend/kirikiri/src/test/java/co/kirikiri/integration/fixture/AuthenticationAPIFixture.java index 09e803db7..a5b7caef9 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/integration/fixture/AuthenticationAPIFixture.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/integration/fixture/AuthenticationAPIFixture.java @@ -5,9 +5,9 @@ import static co.kirikiri.integration.fixture.MemberAPIFixture.DEFAULT_PASSWORD; import static io.restassured.RestAssured.given; -import co.kirikiri.service.dto.auth.request.LoginRequest; -import co.kirikiri.service.dto.auth.request.ReissueTokenRequest; -import co.kirikiri.service.dto.auth.response.AuthenticationResponse; +import co.kirikiri.auth.service.dto.request.LoginRequest; +import co.kirikiri.auth.service.dto.request.ReissueTokenRequest; +import co.kirikiri.auth.service.dto.response.AuthenticationResponse; import io.restassured.response.ExtractableResponse; import io.restassured.response.Response; import org.springframework.http.MediaType; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/integration/fixture/GoalRoomAPIFixture.java b/backend/kirikiri/src/test/java/co/kirikiri/integration/fixture/GoalRoomAPIFixture.java index 500761b69..ac6d06bd3 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/integration/fixture/GoalRoomAPIFixture.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/integration/fixture/GoalRoomAPIFixture.java @@ -5,24 +5,24 @@ import static co.kirikiri.integration.fixture.CommonFixture.LOCATION; import static io.restassured.RestAssured.given; +import co.kirikiri.member.service.dto.response.MemberGoalRoomResponse; import co.kirikiri.service.dto.goalroom.request.CheckFeedRequest; import co.kirikiri.service.dto.goalroom.request.GoalRoomCreateRequest; import co.kirikiri.service.dto.goalroom.request.GoalRoomRoadmapNodeRequest; import co.kirikiri.service.dto.goalroom.request.GoalRoomTodoRequest; -import co.kirikiri.service.dto.member.response.MemberGoalRoomResponse; import co.kirikiri.service.dto.roadmap.response.RoadmapResponse; import io.restassured.common.mapper.TypeRef; import io.restassured.http.Header; import io.restassured.response.ExtractableResponse; import io.restassured.response.Response; -import org.springframework.http.HttpHeaders; -import org.springframework.http.MediaType; -import org.springframework.mock.web.MockMultipartFile; import java.io.IOException; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.temporal.ChronoUnit; import java.util.List; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.mock.web.MockMultipartFile; public class GoalRoomAPIFixture { diff --git a/backend/kirikiri/src/test/java/co/kirikiri/integration/fixture/MemberAPIFixture.java b/backend/kirikiri/src/test/java/co/kirikiri/integration/fixture/MemberAPIFixture.java index 5cec01f3c..c6097e8df 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/integration/fixture/MemberAPIFixture.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/integration/fixture/MemberAPIFixture.java @@ -6,9 +6,9 @@ import static co.kirikiri.integration.fixture.CommonFixture.BEARER_TOKEN_FORMAT; import static io.restassured.RestAssured.given; -import co.kirikiri.service.dto.auth.request.LoginRequest; -import co.kirikiri.service.dto.member.request.GenderType; -import co.kirikiri.service.dto.member.request.MemberJoinRequest; +import co.kirikiri.auth.service.dto.request.LoginRequest; +import co.kirikiri.member.service.dto.request.GenderType; +import co.kirikiri.member.service.dto.request.MemberJoinRequest; import io.restassured.response.ExtractableResponse; import io.restassured.response.Response; import org.springframework.http.MediaType; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/integration/helper/TestConfig.java b/backend/kirikiri/src/test/java/co/kirikiri/integration/helper/TestConfig.java index 8f62a2887..8fc5c56f0 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/integration/helper/TestConfig.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/integration/helper/TestConfig.java @@ -1,9 +1,9 @@ package co.kirikiri.integration.helper; -import co.kirikiri.persistence.auth.RefreshTokenRepository; +import co.kirikiri.auth.persistence.RefreshTokenRepository; +import co.kirikiri.common.service.FileService; import co.kirikiri.persistence.goalroom.GoalRoomMemberRepository; import co.kirikiri.persistence.goalroom.GoalRoomRepository; -import co.kirikiri.service.FileService; import org.springframework.boot.test.context.TestConfiguration; import org.springframework.context.annotation.Bean; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/integration/helper/TestFileService.java b/backend/kirikiri/src/test/java/co/kirikiri/integration/helper/TestFileService.java index 5803f3af2..54b3a2557 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/integration/helper/TestFileService.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/integration/helper/TestFileService.java @@ -1,10 +1,10 @@ package co.kirikiri.integration.helper; -import co.kirikiri.service.FileService; +import co.kirikiri.common.service.FileService; import co.kirikiri.service.dto.FileInformation; -import org.springframework.http.HttpMethod; import java.net.MalformedURLException; import java.net.URL; +import org.springframework.http.HttpMethod; public class TestFileService implements FileService { diff --git a/backend/kirikiri/src/test/java/co/kirikiri/integration/helper/TestRefreshTokenRepository.java b/backend/kirikiri/src/test/java/co/kirikiri/integration/helper/TestRefreshTokenRepository.java index 94f9344a0..9862d9501 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/integration/helper/TestRefreshTokenRepository.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/integration/helper/TestRefreshTokenRepository.java @@ -2,7 +2,7 @@ import static co.kirikiri.integration.fixture.MemberAPIFixture.DEFAULT_IDENTIFIER; -import co.kirikiri.persistence.auth.RefreshTokenRepository; +import co.kirikiri.auth.persistence.RefreshTokenRepository; import java.util.Optional; public class TestRefreshTokenRepository implements RefreshTokenRepository { diff --git a/backend/kirikiri/src/test/java/co/kirikiri/integration/helper/TestTransactionService.java b/backend/kirikiri/src/test/java/co/kirikiri/integration/helper/TestTransactionService.java index accf118e2..c2b14cdab 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/integration/helper/TestTransactionService.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/integration/helper/TestTransactionService.java @@ -13,18 +13,18 @@ import co.kirikiri.domain.goalroom.GoalRoomMember; import co.kirikiri.domain.goalroom.GoalRoomRole; import co.kirikiri.domain.goalroom.GoalRoomStatus; -import co.kirikiri.domain.member.EncryptedPassword; -import co.kirikiri.domain.member.Gender; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.MemberProfile; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; -import co.kirikiri.domain.member.vo.Password; +import co.kirikiri.member.domain.EncryptedPassword; +import co.kirikiri.member.domain.Gender; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.MemberProfile; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.domain.vo.Password; +import co.kirikiri.member.service.dto.response.MemberInformationResponse; import co.kirikiri.persistence.goalroom.GoalRoomMemberRepository; import co.kirikiri.persistence.goalroom.GoalRoomRepository; import co.kirikiri.service.dto.goalroom.request.GoalRoomCreateRequest; import co.kirikiri.service.dto.goalroom.request.GoalRoomRoadmapNodeRequest; -import co.kirikiri.service.dto.member.response.MemberInformationResponse; import co.kirikiri.service.dto.roadmap.response.RoadmapResponse; import jakarta.persistence.EntityManager; import jakarta.persistence.PersistenceContext; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/domain/member/vo/EncryptedPasswordTest.java b/backend/kirikiri/src/test/java/co/kirikiri/member/domain/vo/EncryptedPasswordTest.java similarity index 87% rename from backend/kirikiri/src/test/java/co/kirikiri/domain/member/vo/EncryptedPasswordTest.java rename to backend/kirikiri/src/test/java/co/kirikiri/member/domain/vo/EncryptedPasswordTest.java index 83d2fa36d..95eb573f7 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/domain/member/vo/EncryptedPasswordTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/member/domain/vo/EncryptedPasswordTest.java @@ -1,8 +1,8 @@ -package co.kirikiri.domain.member.vo; +package co.kirikiri.member.domain.vo; import static org.assertj.core.api.Assertions.assertThat; -import co.kirikiri.domain.member.EncryptedPassword; +import co.kirikiri.member.domain.EncryptedPassword; import org.junit.jupiter.api.Test; class EncryptedPasswordTest { diff --git a/backend/kirikiri/src/test/java/co/kirikiri/domain/member/vo/IdentifierTest.java b/backend/kirikiri/src/test/java/co/kirikiri/member/domain/vo/IdentifierTest.java similarity index 90% rename from backend/kirikiri/src/test/java/co/kirikiri/domain/member/vo/IdentifierTest.java rename to backend/kirikiri/src/test/java/co/kirikiri/member/domain/vo/IdentifierTest.java index 2555e7155..ea84c231f 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/domain/member/vo/IdentifierTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/member/domain/vo/IdentifierTest.java @@ -1,9 +1,9 @@ -package co.kirikiri.domain.member.vo; +package co.kirikiri.member.domain.vo; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; -import co.kirikiri.domain.member.exception.MemberException; +import co.kirikiri.member.domain.exception.MemberException; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/domain/member/vo/NicknameTest.java b/backend/kirikiri/src/test/java/co/kirikiri/member/domain/vo/NicknameTest.java similarity index 90% rename from backend/kirikiri/src/test/java/co/kirikiri/domain/member/vo/NicknameTest.java rename to backend/kirikiri/src/test/java/co/kirikiri/member/domain/vo/NicknameTest.java index 80876918e..fea53e646 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/domain/member/vo/NicknameTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/member/domain/vo/NicknameTest.java @@ -1,9 +1,9 @@ -package co.kirikiri.domain.member.vo; +package co.kirikiri.member.domain.vo; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; -import co.kirikiri.domain.member.exception.MemberException; +import co.kirikiri.member.domain.exception.MemberException; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/domain/member/vo/PasswordTest.java b/backend/kirikiri/src/test/java/co/kirikiri/member/domain/vo/PasswordTest.java similarity index 96% rename from backend/kirikiri/src/test/java/co/kirikiri/domain/member/vo/PasswordTest.java rename to backend/kirikiri/src/test/java/co/kirikiri/member/domain/vo/PasswordTest.java index a0fe0d3cb..90dc1f842 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/domain/member/vo/PasswordTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/member/domain/vo/PasswordTest.java @@ -1,9 +1,9 @@ -package co.kirikiri.domain.member.vo; +package co.kirikiri.member.domain.vo; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; -import co.kirikiri.domain.member.exception.MemberException; +import co.kirikiri.member.domain.exception.MemberException; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/persistence/member/MemberRepositoryTest.java b/backend/kirikiri/src/test/java/co/kirikiri/member/persistence/MemberRepositoryTest.java similarity index 87% rename from backend/kirikiri/src/test/java/co/kirikiri/persistence/member/MemberRepositoryTest.java rename to backend/kirikiri/src/test/java/co/kirikiri/member/persistence/MemberRepositoryTest.java index 99052941c..43eb0fd6a 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/persistence/member/MemberRepositoryTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/member/persistence/MemberRepositoryTest.java @@ -1,21 +1,21 @@ -package co.kirikiri.persistence.member; +package co.kirikiri.member.persistence; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertAll; -import co.kirikiri.domain.ImageContentType; -import co.kirikiri.domain.member.EncryptedPassword; -import co.kirikiri.domain.member.Gender; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.MemberImage; -import co.kirikiri.domain.member.MemberProfile; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; -import co.kirikiri.domain.member.vo.Password; +import co.kirikiri.common.type.ImageContentType; +import co.kirikiri.member.domain.EncryptedPassword; +import co.kirikiri.member.domain.Gender; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.MemberImage; +import co.kirikiri.member.domain.MemberProfile; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.domain.vo.Password; import co.kirikiri.persistence.helper.RepositoryTest; +import java.util.Optional; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.util.Optional; @RepositoryTest class MemberRepositoryTest { diff --git a/backend/kirikiri/src/test/java/co/kirikiri/service/MemberServiceTest.java b/backend/kirikiri/src/test/java/co/kirikiri/member/service/MemberServiceTest.java similarity index 77% rename from backend/kirikiri/src/test/java/co/kirikiri/service/MemberServiceTest.java rename to backend/kirikiri/src/test/java/co/kirikiri/member/service/MemberServiceTest.java index 30d66dc46..247b91d7a 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/service/MemberServiceTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/member/service/MemberServiceTest.java @@ -1,4 +1,4 @@ -package co.kirikiri.service; +package co.kirikiri.member.service; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; @@ -6,27 +6,25 @@ import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.BDDMockito.given; -import co.kirikiri.domain.ImageContentType; -import co.kirikiri.domain.member.EncryptedPassword; -import co.kirikiri.domain.member.Gender; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.MemberImage; -import co.kirikiri.domain.member.MemberProfile; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; -import co.kirikiri.domain.member.vo.Password; -import co.kirikiri.persistence.auth.RefreshTokenRepository; -import co.kirikiri.persistence.member.MemberRepository; -import co.kirikiri.service.auth.TokenProvider; -import co.kirikiri.service.dto.auth.response.AuthenticationResponse; -import co.kirikiri.service.dto.member.OauthMemberJoinDto; -import co.kirikiri.service.dto.member.request.GenderType; -import co.kirikiri.service.dto.member.request.MemberJoinRequest; -import co.kirikiri.service.dto.member.response.MemberInformationForPublicResponse; -import co.kirikiri.service.dto.member.response.MemberInformationResponse; -import co.kirikiri.service.exception.ConflictException; -import co.kirikiri.service.exception.NotFoundException; -import co.kirikiri.service.member.MemberService; +import co.kirikiri.common.exception.ConflictException; +import co.kirikiri.common.exception.NotFoundException; +import co.kirikiri.common.service.FileService; +import co.kirikiri.common.service.NumberGenerator; +import co.kirikiri.common.type.ImageContentType; +import co.kirikiri.member.domain.EncryptedPassword; +import co.kirikiri.member.domain.Gender; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.MemberImage; +import co.kirikiri.member.domain.MemberProfile; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.domain.vo.Password; +import co.kirikiri.member.persistence.MemberRepository; +import co.kirikiri.member.service.dto.OauthMemberJoinDto; +import co.kirikiri.member.service.dto.request.GenderType; +import co.kirikiri.member.service.dto.request.MemberJoinRequest; +import co.kirikiri.member.service.dto.response.MemberInformationForPublicResponse; +import co.kirikiri.member.service.dto.response.MemberInformationResponse; import java.net.MalformedURLException; import java.net.URL; import java.util.Optional; @@ -55,12 +53,6 @@ class MemberServiceTest { @Mock private NumberGenerator numberGenerator; - @Mock - private TokenProvider tokenProvider; - - @Mock - private RefreshTokenRepository refreshTokenRepository; - @Mock private FileService fileService; @@ -216,11 +208,16 @@ class MemberServiceTest { @Test void oauth_회원가입을_한다() { //given - final OauthMemberJoinDto request = new OauthMemberJoinDto("oauthId", "kirikiri@email.com", "nickname", - GenderType.UNDEFINED); + final OauthMemberJoinDto oauthMemberJoinDto = new OauthMemberJoinDto("oauthId", "kirikiri@email.com", + "nickname", GenderType.UNDEFINED); + + final MemberProfile memberProfile = new MemberProfile(Gender.valueOf(oauthMemberJoinDto.gender().name()), + oauthMemberJoinDto.email()); + final Member member = new Member(new Identifier("kirikiri"), oauthMemberJoinDto.oauthId(), + new Nickname(oauthMemberJoinDto.nickname()), null, memberProfile); given(memberRepository.save(any())) - .willReturn(new Member(1L, null, null, null, null, null, null)); + .willReturn(member); given(environment.getProperty(IMAGE_DEFAULT_ORIGINAL_FILE_NAME_PROPERTY)) .willReturn("default-member-image"); given(environment.getProperty(IMAGE_DEFAULT_SERVER_FILE_PATH_PROPERTY)) @@ -229,27 +226,28 @@ class MemberServiceTest { .willReturn("JPG"); given(numberGenerator.generate()) .willReturn(7); - given(tokenProvider.createRefreshToken(any(), any())) - .willReturn("refreshToken"); - given(tokenProvider.createAccessToken(any(), any())) - .willReturn("accessToken"); //when - final AuthenticationResponse result = memberService.oauthJoin(request); + final Member result = memberService.oauthJoin(oauthMemberJoinDto); //then - assertThat(result).isEqualTo(new AuthenticationResponse("refreshToken", "accessToken")); + assertThat(result).isEqualTo(member); } @ParameterizedTest @ValueSource(strings = {"k", "kk", "kkk", "kkkk"}) void oauth_회원가입_시_이메일의_아이디와_UUID_길이의_합이_40이하일때_회원을_생성한다(final String value) { //given - final OauthMemberJoinDto request = new OauthMemberJoinDto("oauthId", value + "@email.com", "nickname", + final OauthMemberJoinDto oauthMemberJoinDto = new OauthMemberJoinDto("oauthId", value + "@email.com", "nickname", GenderType.UNDEFINED); + final MemberProfile memberProfile = new MemberProfile(Gender.valueOf(oauthMemberJoinDto.gender().name()), + oauthMemberJoinDto.email()); + final Member member = new Member(new Identifier("kirikiri"), oauthMemberJoinDto.oauthId(), + new Nickname(oauthMemberJoinDto.nickname()), null, memberProfile); + given(memberRepository.save(any())) - .willReturn(new Member(1L, null, null, null, null, null, null)); + .willReturn(member); given(environment.getProperty(IMAGE_DEFAULT_ORIGINAL_FILE_NAME_PROPERTY)) .willReturn("default-member-image"); given(environment.getProperty(IMAGE_DEFAULT_SERVER_FILE_PATH_PROPERTY)) @@ -258,27 +256,28 @@ class MemberServiceTest { .willReturn("JPG"); given(numberGenerator.generate()) .willReturn(7); - given(tokenProvider.createRefreshToken(any(), any())) - .willReturn("refreshToken"); - given(tokenProvider.createAccessToken(any(), any())) - .willReturn("accessToken"); //when - final AuthenticationResponse result = memberService.oauthJoin(request); + final Member result = memberService.oauthJoin(oauthMemberJoinDto); //then - assertThat(result).isEqualTo(new AuthenticationResponse("refreshToken", "accessToken")); + assertThat(result).isEqualTo(member); } @ParameterizedTest @ValueSource(strings = {"kkkkk", "kkkkkk", "kkkkkkkkkkkkkkkkk"}) void oauth_회원가입_시_이메일의_아이디와_UUID_길이의_합이_40초과일때_회원을_생성한다(final String value) { //given - final OauthMemberJoinDto request = new OauthMemberJoinDto("oauthId", value + "@email.com", "nickname", + final OauthMemberJoinDto oauthMemberJoinDto = new OauthMemberJoinDto("oauthId", value + "@email.com", "nickname", GenderType.UNDEFINED); + final MemberProfile memberProfile = new MemberProfile(Gender.valueOf(oauthMemberJoinDto.gender().name()), + oauthMemberJoinDto.email()); + final Member member = new Member(new Identifier("kirikiri"), oauthMemberJoinDto.oauthId(), + new Nickname(oauthMemberJoinDto.nickname()), null, memberProfile); + given(memberRepository.save(any())) - .willReturn(new Member(1L, null, null, null, null, null, null)); + .willReturn(member); given(environment.getProperty(IMAGE_DEFAULT_ORIGINAL_FILE_NAME_PROPERTY)) .willReturn("default-member-image"); given(environment.getProperty(IMAGE_DEFAULT_SERVER_FILE_PATH_PROPERTY)) @@ -287,15 +286,11 @@ class MemberServiceTest { .willReturn("JPG"); given(numberGenerator.generate()) .willReturn(7); - given(tokenProvider.createRefreshToken(any(), any())) - .willReturn("refreshToken"); - given(tokenProvider.createAccessToken(any(), any())) - .willReturn("accessToken"); //when - final AuthenticationResponse result = memberService.oauthJoin(request); + final Member result = memberService.oauthJoin(oauthMemberJoinDto); //then - assertThat(result).isEqualTo(new AuthenticationResponse("refreshToken", "accessToken")); + assertThat(result).isEqualTo(member); } } diff --git a/backend/kirikiri/src/test/java/co/kirikiri/persistence/dto/RoadmapSearchTagNameTest.java b/backend/kirikiri/src/test/java/co/kirikiri/persistence/dto/RoadmapSearchTagNameTest.java index 23459fce2..795be340d 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/persistence/dto/RoadmapSearchTagNameTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/persistence/dto/RoadmapSearchTagNameTest.java @@ -4,7 +4,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; -import co.kirikiri.service.exception.BadRequestException; +import co.kirikiri.common.exception.BadRequestException; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; import org.junit.jupiter.params.provider.ValueSource; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/persistence/dto/RoadmapSearchTitleTest.java b/backend/kirikiri/src/test/java/co/kirikiri/persistence/dto/RoadmapSearchTitleTest.java index add4ecca9..10e762ae4 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/persistence/dto/RoadmapSearchTitleTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/persistence/dto/RoadmapSearchTitleTest.java @@ -4,7 +4,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; -import co.kirikiri.service.exception.BadRequestException; +import co.kirikiri.common.exception.BadRequestException; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; import org.junit.jupiter.params.provider.ValueSource; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/persistence/goalroom/CheckFeedRepositoryTest.java b/backend/kirikiri/src/test/java/co/kirikiri/persistence/goalroom/CheckFeedRepositoryTest.java index f4eb535ee..2d31ec8ea 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/persistence/goalroom/CheckFeedRepositoryTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/persistence/goalroom/CheckFeedRepositoryTest.java @@ -3,7 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertAll; -import co.kirikiri.domain.ImageContentType; +import co.kirikiri.common.type.ImageContentType; import co.kirikiri.domain.goalroom.CheckFeed; import co.kirikiri.domain.goalroom.GoalRoom; import co.kirikiri.domain.goalroom.GoalRoomMember; @@ -13,14 +13,14 @@ import co.kirikiri.domain.goalroom.vo.GoalRoomName; import co.kirikiri.domain.goalroom.vo.LimitedMemberCount; import co.kirikiri.domain.goalroom.vo.Period; -import co.kirikiri.domain.member.EncryptedPassword; -import co.kirikiri.domain.member.Gender; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.MemberImage; -import co.kirikiri.domain.member.MemberProfile; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; -import co.kirikiri.domain.member.vo.Password; +import co.kirikiri.member.domain.EncryptedPassword; +import co.kirikiri.member.domain.Gender; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.MemberImage; +import co.kirikiri.member.domain.MemberProfile; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.domain.vo.Password; import co.kirikiri.domain.roadmap.Roadmap; import co.kirikiri.domain.roadmap.RoadmapCategory; import co.kirikiri.domain.roadmap.RoadmapContent; @@ -31,7 +31,7 @@ import co.kirikiri.domain.roadmap.RoadmapNodeImages; import co.kirikiri.domain.roadmap.RoadmapNodes; import co.kirikiri.persistence.helper.RepositoryTest; -import co.kirikiri.persistence.member.MemberRepository; +import co.kirikiri.member.persistence.MemberRepository; import co.kirikiri.persistence.roadmap.RoadmapCategoryRepository; import co.kirikiri.persistence.roadmap.RoadmapRepository; import java.time.LocalDate; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/persistence/goalroom/GoalRoomMemberRepositoryTest.java b/backend/kirikiri/src/test/java/co/kirikiri/persistence/goalroom/GoalRoomMemberRepositoryTest.java index 5fed7fa95..c8a4fe403 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/persistence/goalroom/GoalRoomMemberRepositoryTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/persistence/goalroom/GoalRoomMemberRepositoryTest.java @@ -2,7 +2,7 @@ import static org.assertj.core.api.Assertions.assertThat; -import co.kirikiri.domain.ImageContentType; +import co.kirikiri.common.type.ImageContentType; import co.kirikiri.domain.goalroom.GoalRoom; import co.kirikiri.domain.goalroom.GoalRoomMember; import co.kirikiri.domain.goalroom.GoalRoomRoadmapNode; @@ -11,14 +11,14 @@ import co.kirikiri.domain.goalroom.vo.GoalRoomName; import co.kirikiri.domain.goalroom.vo.LimitedMemberCount; import co.kirikiri.domain.goalroom.vo.Period; -import co.kirikiri.domain.member.EncryptedPassword; -import co.kirikiri.domain.member.Gender; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.MemberImage; -import co.kirikiri.domain.member.MemberProfile; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; -import co.kirikiri.domain.member.vo.Password; +import co.kirikiri.member.domain.EncryptedPassword; +import co.kirikiri.member.domain.Gender; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.MemberImage; +import co.kirikiri.member.domain.MemberProfile; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.domain.vo.Password; import co.kirikiri.domain.roadmap.Roadmap; import co.kirikiri.domain.roadmap.RoadmapCategory; import co.kirikiri.domain.roadmap.RoadmapContent; @@ -30,7 +30,7 @@ import co.kirikiri.domain.roadmap.RoadmapNodes; import co.kirikiri.persistence.goalroom.dto.GoalRoomMemberSortType; import co.kirikiri.persistence.helper.RepositoryTest; -import co.kirikiri.persistence.member.MemberRepository; +import co.kirikiri.member.persistence.MemberRepository; import co.kirikiri.persistence.roadmap.RoadmapCategoryRepository; import co.kirikiri.persistence.roadmap.RoadmapRepository; import java.time.LocalDate; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/persistence/goalroom/GoalRoomPendingMemberRepositoryTest.java b/backend/kirikiri/src/test/java/co/kirikiri/persistence/goalroom/GoalRoomPendingMemberRepositoryTest.java index 2febbb556..3916f10c9 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/persistence/goalroom/GoalRoomPendingMemberRepositoryTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/persistence/goalroom/GoalRoomPendingMemberRepositoryTest.java @@ -2,7 +2,7 @@ import static org.assertj.core.api.Assertions.assertThat; -import co.kirikiri.domain.ImageContentType; +import co.kirikiri.common.type.ImageContentType; import co.kirikiri.domain.goalroom.GoalRoom; import co.kirikiri.domain.goalroom.GoalRoomPendingMember; import co.kirikiri.domain.goalroom.GoalRoomRoadmapNode; @@ -11,14 +11,14 @@ import co.kirikiri.domain.goalroom.vo.GoalRoomName; import co.kirikiri.domain.goalroom.vo.LimitedMemberCount; import co.kirikiri.domain.goalroom.vo.Period; -import co.kirikiri.domain.member.EncryptedPassword; -import co.kirikiri.domain.member.Gender; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.MemberImage; -import co.kirikiri.domain.member.MemberProfile; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; -import co.kirikiri.domain.member.vo.Password; +import co.kirikiri.member.domain.EncryptedPassword; +import co.kirikiri.member.domain.Gender; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.MemberImage; +import co.kirikiri.member.domain.MemberProfile; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.domain.vo.Password; import co.kirikiri.domain.roadmap.Roadmap; import co.kirikiri.domain.roadmap.RoadmapCategory; import co.kirikiri.domain.roadmap.RoadmapContent; @@ -30,7 +30,7 @@ import co.kirikiri.domain.roadmap.RoadmapNodes; import co.kirikiri.persistence.goalroom.dto.GoalRoomMemberSortType; import co.kirikiri.persistence.helper.RepositoryTest; -import co.kirikiri.persistence.member.MemberRepository; +import co.kirikiri.member.persistence.MemberRepository; import co.kirikiri.persistence.roadmap.RoadmapCategoryRepository; import co.kirikiri.persistence.roadmap.RoadmapRepository; import org.junit.jupiter.api.Assertions; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/persistence/goalroom/GoalRoomRepositoryTest.java b/backend/kirikiri/src/test/java/co/kirikiri/persistence/goalroom/GoalRoomRepositoryTest.java index 38f6fb513..4bde0bcf9 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/persistence/goalroom/GoalRoomRepositoryTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/persistence/goalroom/GoalRoomRepositoryTest.java @@ -12,13 +12,13 @@ import co.kirikiri.domain.goalroom.vo.GoalRoomTodoContent; import co.kirikiri.domain.goalroom.vo.LimitedMemberCount; import co.kirikiri.domain.goalroom.vo.Period; -import co.kirikiri.domain.member.EncryptedPassword; -import co.kirikiri.domain.member.Gender; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.MemberProfile; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; -import co.kirikiri.domain.member.vo.Password; +import co.kirikiri.member.domain.EncryptedPassword; +import co.kirikiri.member.domain.Gender; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.MemberProfile; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.domain.vo.Password; import co.kirikiri.domain.roadmap.Roadmap; import co.kirikiri.domain.roadmap.RoadmapCategory; import co.kirikiri.domain.roadmap.RoadmapContent; @@ -27,7 +27,7 @@ import co.kirikiri.domain.roadmap.RoadmapNodes; import co.kirikiri.persistence.goalroom.dto.RoadmapGoalRoomsOrderType; import co.kirikiri.persistence.helper.RepositoryTest; -import co.kirikiri.persistence.member.MemberRepository; +import co.kirikiri.member.persistence.MemberRepository; import co.kirikiri.persistence.roadmap.RoadmapCategoryRepository; import co.kirikiri.persistence.roadmap.RoadmapRepository; import org.junit.jupiter.api.Test; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/persistence/goalroom/GoalRoomToDoCheckRepositoryTest.java b/backend/kirikiri/src/test/java/co/kirikiri/persistence/goalroom/GoalRoomToDoCheckRepositoryTest.java index 2d7ebd328..a43022d53 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/persistence/goalroom/GoalRoomToDoCheckRepositoryTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/persistence/goalroom/GoalRoomToDoCheckRepositoryTest.java @@ -13,13 +13,13 @@ import co.kirikiri.domain.goalroom.vo.GoalRoomTodoContent; import co.kirikiri.domain.goalroom.vo.LimitedMemberCount; import co.kirikiri.domain.goalroom.vo.Period; -import co.kirikiri.domain.member.EncryptedPassword; -import co.kirikiri.domain.member.Gender; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.MemberProfile; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; -import co.kirikiri.domain.member.vo.Password; +import co.kirikiri.member.domain.EncryptedPassword; +import co.kirikiri.member.domain.Gender; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.MemberProfile; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.domain.vo.Password; import co.kirikiri.domain.roadmap.Roadmap; import co.kirikiri.domain.roadmap.RoadmapCategory; import co.kirikiri.domain.roadmap.RoadmapContent; @@ -27,7 +27,7 @@ import co.kirikiri.domain.roadmap.RoadmapNode; import co.kirikiri.domain.roadmap.RoadmapNodes; import co.kirikiri.persistence.helper.RepositoryTest; -import co.kirikiri.persistence.member.MemberRepository; +import co.kirikiri.member.persistence.MemberRepository; import co.kirikiri.persistence.roadmap.RoadmapCategoryRepository; import co.kirikiri.persistence.roadmap.RoadmapRepository; import java.time.LocalDate; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/persistence/roadmap/RoadmapContentRepositoryTest.java b/backend/kirikiri/src/test/java/co/kirikiri/persistence/roadmap/RoadmapContentRepositoryTest.java index 9f6ce6a34..3c201e212 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/persistence/roadmap/RoadmapContentRepositoryTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/persistence/roadmap/RoadmapContentRepositoryTest.java @@ -3,19 +3,19 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertAll; -import co.kirikiri.domain.member.EncryptedPassword; -import co.kirikiri.domain.member.Gender; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.MemberProfile; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; -import co.kirikiri.domain.member.vo.Password; +import co.kirikiri.member.domain.EncryptedPassword; +import co.kirikiri.member.domain.Gender; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.MemberProfile; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.domain.vo.Password; import co.kirikiri.domain.roadmap.Roadmap; import co.kirikiri.domain.roadmap.RoadmapCategory; import co.kirikiri.domain.roadmap.RoadmapContent; import co.kirikiri.domain.roadmap.RoadmapDifficulty; import co.kirikiri.persistence.helper.RepositoryTest; -import co.kirikiri.persistence.member.MemberRepository; +import co.kirikiri.member.persistence.MemberRepository; import org.junit.jupiter.api.Test; @RepositoryTest diff --git a/backend/kirikiri/src/test/java/co/kirikiri/persistence/roadmap/RoadmapRepositoryTest.java b/backend/kirikiri/src/test/java/co/kirikiri/persistence/roadmap/RoadmapRepositoryTest.java index 83ab3ff56..026fd182d 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/persistence/roadmap/RoadmapRepositoryTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/persistence/roadmap/RoadmapRepositoryTest.java @@ -3,7 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertAll; -import co.kirikiri.domain.ImageContentType; +import co.kirikiri.common.type.ImageContentType; import co.kirikiri.domain.goalroom.GoalRoom; import co.kirikiri.domain.goalroom.GoalRoomMember; import co.kirikiri.domain.goalroom.GoalRoomRoadmapNode; @@ -12,14 +12,14 @@ import co.kirikiri.domain.goalroom.vo.GoalRoomName; import co.kirikiri.domain.goalroom.vo.LimitedMemberCount; import co.kirikiri.domain.goalroom.vo.Period; -import co.kirikiri.domain.member.EncryptedPassword; -import co.kirikiri.domain.member.Gender; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.MemberImage; -import co.kirikiri.domain.member.MemberProfile; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; -import co.kirikiri.domain.member.vo.Password; +import co.kirikiri.member.domain.EncryptedPassword; +import co.kirikiri.member.domain.Gender; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.MemberImage; +import co.kirikiri.member.domain.MemberProfile; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.domain.vo.Password; import co.kirikiri.domain.roadmap.Roadmap; import co.kirikiri.domain.roadmap.RoadmapCategory; import co.kirikiri.domain.roadmap.RoadmapContent; @@ -36,7 +36,7 @@ import co.kirikiri.persistence.goalroom.GoalRoomMemberRepository; import co.kirikiri.persistence.goalroom.GoalRoomRepository; import co.kirikiri.persistence.helper.RepositoryTest; -import co.kirikiri.persistence.member.MemberRepository; +import co.kirikiri.member.persistence.MemberRepository; import java.time.LocalDate; import java.time.LocalDateTime; import java.util.List; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/persistence/roadmap/RoadmapReviewRepositoryTest.java b/backend/kirikiri/src/test/java/co/kirikiri/persistence/roadmap/RoadmapReviewRepositoryTest.java index 099dd5fc9..188073880 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/persistence/roadmap/RoadmapReviewRepositoryTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/persistence/roadmap/RoadmapReviewRepositoryTest.java @@ -3,15 +3,15 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertAll; -import co.kirikiri.domain.ImageContentType; -import co.kirikiri.domain.member.EncryptedPassword; -import co.kirikiri.domain.member.Gender; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.MemberImage; -import co.kirikiri.domain.member.MemberProfile; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; -import co.kirikiri.domain.member.vo.Password; +import co.kirikiri.common.type.ImageContentType; +import co.kirikiri.member.domain.EncryptedPassword; +import co.kirikiri.member.domain.Gender; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.MemberImage; +import co.kirikiri.member.domain.MemberProfile; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.domain.vo.Password; import co.kirikiri.domain.roadmap.Roadmap; import co.kirikiri.domain.roadmap.RoadmapCategory; import co.kirikiri.domain.roadmap.RoadmapContent; @@ -20,7 +20,7 @@ import co.kirikiri.domain.roadmap.RoadmapNodes; import co.kirikiri.domain.roadmap.RoadmapReview; import co.kirikiri.persistence.helper.RepositoryTest; -import co.kirikiri.persistence.member.MemberRepository; +import co.kirikiri.member.persistence.MemberRepository; import org.junit.jupiter.api.Test; import java.util.List; import java.util.Optional; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/service/GoalRoomCreateServiceTest.java b/backend/kirikiri/src/test/java/co/kirikiri/service/GoalRoomCreateServiceTest.java index b409f8ddb..950c2a051 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/service/GoalRoomCreateServiceTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/service/GoalRoomCreateServiceTest.java @@ -13,8 +13,12 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import co.kirikiri.domain.ImageContentType; -import co.kirikiri.domain.exception.ImageExtensionException; +import co.kirikiri.common.exception.BadRequestException; +import co.kirikiri.common.exception.ImageExtensionException; +import co.kirikiri.common.exception.NotFoundException; +import co.kirikiri.common.service.FilePathGenerator; +import co.kirikiri.common.service.FileService; +import co.kirikiri.common.type.ImageContentType; import co.kirikiri.domain.goalroom.CheckFeed; import co.kirikiri.domain.goalroom.GoalRoom; import co.kirikiri.domain.goalroom.GoalRoomMember; @@ -28,13 +32,6 @@ import co.kirikiri.domain.goalroom.vo.GoalRoomTodoContent; import co.kirikiri.domain.goalroom.vo.LimitedMemberCount; import co.kirikiri.domain.goalroom.vo.Period; -import co.kirikiri.domain.member.EncryptedPassword; -import co.kirikiri.domain.member.Gender; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.MemberProfile; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; -import co.kirikiri.domain.member.vo.Password; import co.kirikiri.domain.roadmap.Roadmap; import co.kirikiri.domain.roadmap.RoadmapCategory; import co.kirikiri.domain.roadmap.RoadmapContent; @@ -45,19 +42,24 @@ import co.kirikiri.domain.roadmap.RoadmapNodeImages; import co.kirikiri.domain.roadmap.RoadmapNodes; import co.kirikiri.domain.roadmap.RoadmapStatus; +import co.kirikiri.member.domain.EncryptedPassword; +import co.kirikiri.member.domain.Gender; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.MemberProfile; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.domain.vo.Password; +import co.kirikiri.member.persistence.MemberRepository; import co.kirikiri.persistence.goalroom.CheckFeedRepository; import co.kirikiri.persistence.goalroom.GoalRoomMemberRepository; import co.kirikiri.persistence.goalroom.GoalRoomRepository; import co.kirikiri.persistence.goalroom.GoalRoomToDoCheckRepository; -import co.kirikiri.persistence.member.MemberRepository; import co.kirikiri.persistence.roadmap.RoadmapContentRepository; import co.kirikiri.service.dto.goalroom.request.CheckFeedRequest; import co.kirikiri.service.dto.goalroom.request.GoalRoomCreateRequest; import co.kirikiri.service.dto.goalroom.request.GoalRoomRoadmapNodeRequest; import co.kirikiri.service.dto.goalroom.request.GoalRoomTodoRequest; import co.kirikiri.service.dto.goalroom.response.GoalRoomToDoCheckResponse; -import co.kirikiri.service.exception.BadRequestException; -import co.kirikiri.service.exception.NotFoundException; import co.kirikiri.service.goalroom.GoalRoomCreateService; import java.net.MalformedURLException; import java.net.URL; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/service/GoalRoomReadServiceTest.java b/backend/kirikiri/src/test/java/co/kirikiri/service/GoalRoomReadServiceTest.java index cf1452150..24c5b30a9 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/service/GoalRoomReadServiceTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/service/GoalRoomReadServiceTest.java @@ -10,7 +10,10 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import co.kirikiri.domain.ImageContentType; +import co.kirikiri.common.exception.ForbiddenException; +import co.kirikiri.common.exception.NotFoundException; +import co.kirikiri.common.service.FileService; +import co.kirikiri.common.type.ImageContentType; import co.kirikiri.domain.goalroom.CheckFeed; import co.kirikiri.domain.goalroom.GoalRoom; import co.kirikiri.domain.goalroom.GoalRoomMember; @@ -24,14 +27,6 @@ import co.kirikiri.domain.goalroom.vo.GoalRoomTodoContent; import co.kirikiri.domain.goalroom.vo.LimitedMemberCount; import co.kirikiri.domain.goalroom.vo.Period; -import co.kirikiri.domain.member.EncryptedPassword; -import co.kirikiri.domain.member.Gender; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.MemberImage; -import co.kirikiri.domain.member.MemberProfile; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; -import co.kirikiri.domain.member.vo.Password; import co.kirikiri.domain.roadmap.Roadmap; import co.kirikiri.domain.roadmap.RoadmapCategory; import co.kirikiri.domain.roadmap.RoadmapContent; @@ -41,12 +36,26 @@ import co.kirikiri.domain.roadmap.RoadmapNodeImage; import co.kirikiri.domain.roadmap.RoadmapNodeImages; import co.kirikiri.domain.roadmap.RoadmapNodes; +import co.kirikiri.member.domain.EncryptedPassword; +import co.kirikiri.member.domain.Gender; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.MemberImage; +import co.kirikiri.member.domain.MemberProfile; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.domain.vo.Password; +import co.kirikiri.member.persistence.MemberRepository; +import co.kirikiri.member.service.dto.response.MemberCheckFeedResponse; +import co.kirikiri.member.service.dto.response.MemberGoalRoomForListResponse; +import co.kirikiri.member.service.dto.response.MemberGoalRoomResponse; +import co.kirikiri.member.service.dto.response.MemberGoalRoomRoadmapNodeResponse; +import co.kirikiri.member.service.dto.response.MemberGoalRoomRoadmapNodesResponse; +import co.kirikiri.member.service.dto.response.MemberResponse; import co.kirikiri.persistence.goalroom.CheckFeedRepository; import co.kirikiri.persistence.goalroom.GoalRoomMemberRepository; import co.kirikiri.persistence.goalroom.GoalRoomPendingMemberRepository; import co.kirikiri.persistence.goalroom.GoalRoomRepository; import co.kirikiri.persistence.goalroom.GoalRoomToDoCheckRepository; -import co.kirikiri.persistence.member.MemberRepository; import co.kirikiri.service.dto.goalroom.GoalRoomMemberSortTypeDto; import co.kirikiri.service.dto.goalroom.request.GoalRoomStatusTypeRequest; import co.kirikiri.service.dto.goalroom.response.CheckFeedResponse; @@ -56,14 +65,8 @@ import co.kirikiri.service.dto.goalroom.response.GoalRoomResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodeDetailResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodeResponse; -import co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodesResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomToDoCheckResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomTodoResponse; -import co.kirikiri.service.dto.member.response.MemberGoalRoomForListResponse; -import co.kirikiri.service.dto.member.response.MemberGoalRoomResponse; -import co.kirikiri.service.dto.member.response.MemberResponse; -import co.kirikiri.service.exception.ForbiddenException; -import co.kirikiri.service.exception.NotFoundException; import co.kirikiri.service.goalroom.GoalRoomReadService; import java.net.MalformedURLException; import java.net.URL; @@ -497,20 +500,20 @@ class GoalRoomReadServiceTest { final MemberGoalRoomResponse expected = new MemberGoalRoomResponse(goalRoom.getName().getValue(), goalRoom.getStatus().name(), member.getId(), goalRoom.getCurrentMemberCount(), goalRoom.getLimitedMemberCount().getValue(), goalRoom.getStartDate(), goalRoom.getEndDate(), - roadmapContent.getId(), new GoalRoomRoadmapNodesResponse(false, true, + roadmapContent.getId(), new MemberGoalRoomRoadmapNodesResponse(false, true, List.of( - new GoalRoomRoadmapNodeResponse(goalRoomRoadmapNode1.getId(), roadmapNode1.getTitle(), + new MemberGoalRoomRoadmapNodeResponse(goalRoomRoadmapNode1.getId(), roadmapNode1.getTitle(), goalRoomRoadmapNode1.getStartDate(), goalRoomRoadmapNode1.getEndDate(), goalRoomRoadmapNode1.getCheckCount()), - new GoalRoomRoadmapNodeResponse(goalRoomRoadmapNode2.getId(), roadmapNode2.getTitle(), + new MemberGoalRoomRoadmapNodeResponse(goalRoomRoadmapNode2.getId(), roadmapNode2.getTitle(), goalRoomRoadmapNode2.getStartDate(), goalRoomRoadmapNode2.getEndDate(), goalRoomRoadmapNode2.getCheckCount()) )), Collections.emptyList(), List.of( - new CheckFeedResponse(1L, "http://example.com/serverFilePath", "인증 피드 설명", LocalDate.now()), - new CheckFeedResponse(2L, "http://example.com/serverFilePath", "인증 피드 설명", LocalDate.now()), - new CheckFeedResponse(3L, "http://example.com/serverFilePath", "인증 피드 설명", LocalDate.now()), - new CheckFeedResponse(4L, "http://example.com/serverFilePath", "인증 피드 설명", LocalDate.now()) + new MemberCheckFeedResponse(1L, "http://example.com/serverFilePath", "인증 피드 설명", LocalDate.now()), + new MemberCheckFeedResponse(2L, "http://example.com/serverFilePath", "인증 피드 설명", LocalDate.now()), + new MemberCheckFeedResponse(3L, "http://example.com/serverFilePath", "인증 피드 설명", LocalDate.now()), + new MemberCheckFeedResponse(4L, "http://example.com/serverFilePath", "인증 피드 설명", LocalDate.now()) )); //when @@ -559,12 +562,12 @@ class GoalRoomReadServiceTest { final MemberGoalRoomResponse expected = new MemberGoalRoomResponse(goalRoom.getName().getValue(), goalRoom.getStatus().name(), member.getId(), goalRoom.getCurrentMemberCount(), goalRoom.getLimitedMemberCount().getValue(), goalRoom.getStartDate(), goalRoom.getEndDate(), - roadmapContent.getId(), new GoalRoomRoadmapNodesResponse(false, true, + roadmapContent.getId(), new MemberGoalRoomRoadmapNodesResponse(false, true, List.of( - new GoalRoomRoadmapNodeResponse(goalRoomRoadmapNode1.getId(), roadmapNode1.getTitle(), + new MemberGoalRoomRoadmapNodeResponse(goalRoomRoadmapNode1.getId(), roadmapNode1.getTitle(), goalRoomRoadmapNode1.getStartDate(), goalRoomRoadmapNode1.getEndDate(), goalRoomRoadmapNode1.getCheckCount()), - new GoalRoomRoadmapNodeResponse(goalRoomRoadmapNode2.getId(), roadmapNode2.getTitle(), + new MemberGoalRoomRoadmapNodeResponse(goalRoomRoadmapNode2.getId(), roadmapNode2.getTitle(), goalRoomRoadmapNode2.getStartDate(), goalRoomRoadmapNode2.getEndDate(), goalRoomRoadmapNode2.getCheckCount()) )), Collections.emptyList(), Collections.emptyList()); @@ -620,20 +623,20 @@ class GoalRoomReadServiceTest { final MemberGoalRoomResponse expected = new MemberGoalRoomResponse(goalRoom.getName().getValue(), goalRoom.getStatus().name(), member.getId(), goalRoom.getCurrentMemberCount(), goalRoom.getLimitedMemberCount().getValue(), goalRoom.getStartDate(), goalRoom.getEndDate(), - roadmapContent.getId(), new GoalRoomRoadmapNodesResponse(false, true, + roadmapContent.getId(), new MemberGoalRoomRoadmapNodesResponse(false, true, List.of( - new GoalRoomRoadmapNodeResponse(goalRoomRoadmapNode1.getId(), roadmapNode1.getTitle(), + new MemberGoalRoomRoadmapNodeResponse(goalRoomRoadmapNode1.getId(), roadmapNode1.getTitle(), goalRoomRoadmapNode1.getStartDate(), goalRoomRoadmapNode1.getEndDate(), goalRoomRoadmapNode1.getCheckCount()), - new GoalRoomRoadmapNodeResponse(goalRoomRoadmapNode2.getId(), roadmapNode2.getTitle(), + new MemberGoalRoomRoadmapNodeResponse(goalRoomRoadmapNode2.getId(), roadmapNode2.getTitle(), goalRoomRoadmapNode2.getStartDate(), goalRoomRoadmapNode2.getEndDate(), goalRoomRoadmapNode2.getCheckCount()) )), Collections.emptyList(), List.of( - new CheckFeedResponse(1L, "http://example.com/serverFilePath", "인증 피드 설명", LocalDate.now()), - new CheckFeedResponse(2L, "http://example.com/serverFilePath", "인증 피드 설명", LocalDate.now()), - new CheckFeedResponse(3L, "http://example.com/serverFilePath", "인증 피드 설명", LocalDate.now()), - new CheckFeedResponse(4L, "http://example.com/serverFilePath", "인증 피드 설명", LocalDate.now()) + new MemberCheckFeedResponse(1L, "http://example.com/serverFilePath", "인증 피드 설명", LocalDate.now()), + new MemberCheckFeedResponse(2L, "http://example.com/serverFilePath", "인증 피드 설명", LocalDate.now()), + new MemberCheckFeedResponse(3L, "http://example.com/serverFilePath", "인증 피드 설명", LocalDate.now()), + new MemberCheckFeedResponse(4L, "http://example.com/serverFilePath", "인증 피드 설명", LocalDate.now()) )); //when diff --git a/backend/kirikiri/src/test/java/co/kirikiri/service/GoalRoomSchedulerTest.java b/backend/kirikiri/src/test/java/co/kirikiri/service/GoalRoomSchedulerTest.java index f4118210d..6d3366e83 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/service/GoalRoomSchedulerTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/service/GoalRoomSchedulerTest.java @@ -9,7 +9,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import co.kirikiri.domain.ImageContentType; +import co.kirikiri.common.type.ImageContentType; import co.kirikiri.domain.goalroom.GoalRoom; import co.kirikiri.domain.goalroom.GoalRoomPendingMember; import co.kirikiri.domain.goalroom.GoalRoomRoadmapNode; @@ -18,13 +18,13 @@ import co.kirikiri.domain.goalroom.vo.GoalRoomName; import co.kirikiri.domain.goalroom.vo.LimitedMemberCount; import co.kirikiri.domain.goalroom.vo.Period; -import co.kirikiri.domain.member.EncryptedPassword; -import co.kirikiri.domain.member.Gender; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.MemberProfile; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; -import co.kirikiri.domain.member.vo.Password; +import co.kirikiri.member.domain.EncryptedPassword; +import co.kirikiri.member.domain.Gender; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.MemberProfile; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.domain.vo.Password; import co.kirikiri.domain.roadmap.Roadmap; import co.kirikiri.domain.roadmap.RoadmapCategory; import co.kirikiri.domain.roadmap.RoadmapContent; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/service/RoadmapCreateEventListenerTest.java b/backend/kirikiri/src/test/java/co/kirikiri/service/RoadmapCreateEventListenerTest.java index e2ce4b915..760430c4b 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/service/RoadmapCreateEventListenerTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/service/RoadmapCreateEventListenerTest.java @@ -4,19 +4,23 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import co.kirikiri.domain.member.EncryptedPassword; -import co.kirikiri.domain.member.Gender; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.MemberProfile; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; -import co.kirikiri.domain.member.vo.Password; +import co.kirikiri.common.exception.BadRequestException; +import co.kirikiri.common.exception.ServerException; +import co.kirikiri.common.service.FilePathGenerator; +import co.kirikiri.common.service.FileService; import co.kirikiri.domain.roadmap.Roadmap; import co.kirikiri.domain.roadmap.RoadmapCategory; import co.kirikiri.domain.roadmap.RoadmapContent; import co.kirikiri.domain.roadmap.RoadmapDifficulty; import co.kirikiri.domain.roadmap.RoadmapNode; import co.kirikiri.domain.roadmap.RoadmapNodes; +import co.kirikiri.member.domain.EncryptedPassword; +import co.kirikiri.member.domain.Gender; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.MemberProfile; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.domain.vo.Password; import co.kirikiri.persistence.roadmap.RoadmapContentRepository; import co.kirikiri.service.dto.FileInformation; import co.kirikiri.service.dto.roadmap.RoadmapNodeSaveDto; @@ -24,8 +28,6 @@ import co.kirikiri.service.dto.roadmap.RoadmapTagSaveDto; import co.kirikiri.service.dto.roadmap.request.RoadmapDifficultyType; import co.kirikiri.service.event.RoadmapCreateEvent; -import co.kirikiri.service.exception.BadRequestException; -import co.kirikiri.service.exception.ServerException; import co.kirikiri.service.roadmap.RoadmapCreateEventListener; import java.io.IOException; import java.util.List; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/service/RoadmapCreateServiceTest.java b/backend/kirikiri/src/test/java/co/kirikiri/service/RoadmapCreateServiceTest.java index f0c78c42e..bcc5e7a5c 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/service/RoadmapCreateServiceTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/service/RoadmapCreateServiceTest.java @@ -12,27 +12,32 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; +import co.kirikiri.common.exception.AuthenticationException; +import co.kirikiri.common.exception.BadRequestException; +import co.kirikiri.common.exception.ConflictException; +import co.kirikiri.common.exception.ForbiddenException; +import co.kirikiri.common.exception.NotFoundException; import co.kirikiri.domain.goalroom.GoalRoom; import co.kirikiri.domain.goalroom.GoalRoomMember; import co.kirikiri.domain.goalroom.GoalRoomRole; import co.kirikiri.domain.goalroom.vo.GoalRoomName; import co.kirikiri.domain.goalroom.vo.LimitedMemberCount; -import co.kirikiri.domain.member.EncryptedPassword; -import co.kirikiri.domain.member.Gender; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.MemberProfile; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; -import co.kirikiri.domain.member.vo.Password; import co.kirikiri.domain.roadmap.Roadmap; import co.kirikiri.domain.roadmap.RoadmapCategory; import co.kirikiri.domain.roadmap.RoadmapContent; import co.kirikiri.domain.roadmap.RoadmapContents; import co.kirikiri.domain.roadmap.RoadmapDifficulty; import co.kirikiri.domain.roadmap.RoadmapReview; +import co.kirikiri.member.domain.EncryptedPassword; +import co.kirikiri.member.domain.Gender; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.MemberProfile; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.domain.vo.Password; +import co.kirikiri.member.persistence.MemberRepository; import co.kirikiri.persistence.goalroom.GoalRoomMemberRepository; import co.kirikiri.persistence.goalroom.GoalRoomRepository; -import co.kirikiri.persistence.member.MemberRepository; import co.kirikiri.persistence.roadmap.RoadmapCategoryRepository; import co.kirikiri.persistence.roadmap.RoadmapRepository; import co.kirikiri.persistence.roadmap.RoadmapReviewRepository; @@ -42,11 +47,6 @@ import co.kirikiri.service.dto.roadmap.request.RoadmapReviewSaveRequest; import co.kirikiri.service.dto.roadmap.request.RoadmapSaveRequest; import co.kirikiri.service.dto.roadmap.request.RoadmapTagSaveRequest; -import co.kirikiri.service.exception.AuthenticationException; -import co.kirikiri.service.exception.BadRequestException; -import co.kirikiri.service.exception.ConflictException; -import co.kirikiri.service.exception.ForbiddenException; -import co.kirikiri.service.exception.NotFoundException; import co.kirikiri.service.roadmap.RoadmapCreateService; import java.time.LocalDateTime; import java.util.Collections; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/service/RoadmapReadServiceTest.java b/backend/kirikiri/src/test/java/co/kirikiri/service/RoadmapReadServiceTest.java index d6222964e..09b00a96e 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/service/RoadmapReadServiceTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/service/RoadmapReadServiceTest.java @@ -9,7 +9,9 @@ import static org.mockito.BDDMockito.given; import static org.mockito.Mockito.when; -import co.kirikiri.domain.ImageContentType; +import co.kirikiri.common.exception.NotFoundException; +import co.kirikiri.common.service.FileService; +import co.kirikiri.common.type.ImageContentType; import co.kirikiri.domain.goalroom.GoalRoom; import co.kirikiri.domain.goalroom.GoalRoomRoadmapNode; import co.kirikiri.domain.goalroom.GoalRoomRoadmapNodes; @@ -17,14 +19,6 @@ import co.kirikiri.domain.goalroom.vo.GoalRoomName; import co.kirikiri.domain.goalroom.vo.LimitedMemberCount; import co.kirikiri.domain.goalroom.vo.Period; -import co.kirikiri.domain.member.EncryptedPassword; -import co.kirikiri.domain.member.Gender; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.MemberImage; -import co.kirikiri.domain.member.MemberProfile; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; -import co.kirikiri.domain.member.vo.Password; import co.kirikiri.domain.roadmap.Roadmap; import co.kirikiri.domain.roadmap.RoadmapCategory; import co.kirikiri.domain.roadmap.RoadmapContent; @@ -35,15 +29,23 @@ import co.kirikiri.domain.roadmap.RoadmapTag; import co.kirikiri.domain.roadmap.RoadmapTags; import co.kirikiri.domain.roadmap.vo.RoadmapTagName; +import co.kirikiri.member.domain.EncryptedPassword; +import co.kirikiri.member.domain.Gender; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.MemberImage; +import co.kirikiri.member.domain.MemberProfile; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.domain.vo.Password; +import co.kirikiri.member.persistence.MemberRepository; +import co.kirikiri.member.service.dto.response.MemberResponse; import co.kirikiri.persistence.goalroom.GoalRoomRepository; import co.kirikiri.persistence.goalroom.dto.RoadmapGoalRoomsOrderType; -import co.kirikiri.persistence.member.MemberRepository; import co.kirikiri.persistence.roadmap.RoadmapCategoryRepository; import co.kirikiri.persistence.roadmap.RoadmapContentRepository; import co.kirikiri.persistence.roadmap.RoadmapRepository; import co.kirikiri.persistence.roadmap.RoadmapReviewRepository; import co.kirikiri.service.dto.CustomScrollRequest; -import co.kirikiri.service.dto.member.response.MemberResponse; import co.kirikiri.service.dto.roadmap.RoadmapGoalRoomsOrderTypeDto; import co.kirikiri.service.dto.roadmap.request.RoadmapOrderTypeRequest; import co.kirikiri.service.dto.roadmap.request.RoadmapSearchRequest; @@ -59,7 +61,6 @@ import co.kirikiri.service.dto.roadmap.response.RoadmapResponse; import co.kirikiri.service.dto.roadmap.response.RoadmapReviewResponse; import co.kirikiri.service.dto.roadmap.response.RoadmapTagResponse; -import co.kirikiri.service.exception.NotFoundException; import co.kirikiri.service.roadmap.RoadmapReadService; import java.net.MalformedURLException; import java.net.URL; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/service/RoadmapSchedulerTest.java b/backend/kirikiri/src/test/java/co/kirikiri/service/RoadmapSchedulerTest.java index eaea4f202..cebdc55be 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/service/RoadmapSchedulerTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/service/RoadmapSchedulerTest.java @@ -12,13 +12,13 @@ import co.kirikiri.domain.goalroom.vo.GoalRoomName; import co.kirikiri.domain.goalroom.vo.LimitedMemberCount; import co.kirikiri.domain.goalroom.vo.Period; -import co.kirikiri.domain.member.EncryptedPassword; -import co.kirikiri.domain.member.Gender; -import co.kirikiri.domain.member.Member; -import co.kirikiri.domain.member.MemberProfile; -import co.kirikiri.domain.member.vo.Identifier; -import co.kirikiri.domain.member.vo.Nickname; -import co.kirikiri.domain.member.vo.Password; +import co.kirikiri.member.domain.EncryptedPassword; +import co.kirikiri.member.domain.Gender; +import co.kirikiri.member.domain.Member; +import co.kirikiri.member.domain.MemberProfile; +import co.kirikiri.member.domain.vo.Identifier; +import co.kirikiri.member.domain.vo.Nickname; +import co.kirikiri.member.domain.vo.Password; import co.kirikiri.domain.roadmap.Roadmap; import co.kirikiri.domain.roadmap.RoadmapCategory; import co.kirikiri.domain.roadmap.RoadmapContent; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/service/UUIDFilePathGeneratorTest.java b/backend/kirikiri/src/test/java/co/kirikiri/service/UUIDFilePathGeneratorTest.java index 7e9dc620d..44e2319f6 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/service/UUIDFilePathGeneratorTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/service/UUIDFilePathGeneratorTest.java @@ -3,7 +3,9 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.jupiter.api.Assertions.assertTrue; -import co.kirikiri.service.exception.BadRequestException; +import co.kirikiri.common.exception.BadRequestException; +import co.kirikiri.common.service.FilePathGenerator; +import co.kirikiri.common.type.ImageDirType; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/service/dto/member/request/GenderTypeTest.java b/backend/kirikiri/src/test/java/co/kirikiri/service/dto/member/request/GenderTypeTest.java index 0c043f4e4..8e3de826a 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/service/dto/member/request/GenderTypeTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/service/dto/member/request/GenderTypeTest.java @@ -2,6 +2,7 @@ import static org.assertj.core.api.Assertions.assertThat; +import co.kirikiri.member.service.dto.request.GenderType; import org.junit.jupiter.api.Test; class GenderTypeTest { From 4ab6879b4f3baa31b4bee4307528c9e102a8a534 Mon Sep 17 00:00:00 2001 From: ChoiYoungHoon Date: Thu, 28 Dec 2023 08:21:49 +0900 Subject: [PATCH 2/6] =?UTF-8?q?build:=20test=20coverage=20=EC=A0=9C?= =?UTF-8?q?=EC=99=B8=20=ED=8C=A8=ED=82=A4=EC=A7=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/kirikiri/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/kirikiri/build.gradle b/backend/kirikiri/build.gradle index 7bd653e1d..54083ba1c 100644 --- a/backend/kirikiri/build.gradle +++ b/backend/kirikiri/build.gradle @@ -73,6 +73,7 @@ jacocoTestReport { fileTree(dir: it, excludes: [ "co/kirikiri/persistence/QuerydslRepositorySupporter", "co/kirikiri/domain/**", + "co/kirikiri/**/domain/**", "co/kirikiri/persistence/goalroom/dto/**", "**/*Application*", "**/*Config*", From c9734029bb6b99e18a83752f39a134df6efed7b1 Mon Sep 17 00:00:00 2001 From: ChoiYoungHoon Date: Thu, 28 Dec 2023 08:26:09 +0900 Subject: [PATCH 3/6] =?UTF-8?q?build:=20test=20coverage=20=EC=A0=9C?= =?UTF-8?q?=EC=99=B8=20=ED=8C=A8=ED=82=A4=EC=A7=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/kirikiri/build.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/kirikiri/build.gradle b/backend/kirikiri/build.gradle index 54083ba1c..8325548e4 100644 --- a/backend/kirikiri/build.gradle +++ b/backend/kirikiri/build.gradle @@ -116,7 +116,8 @@ jacocoTestCoverageVerification { excludes = [ "co.kirikiri.persistence.QuerydslRepositorySupporter", - "co.kirikiri.domain.**.**", + "co.kirikiri.domain.**", + "co.kirikiri.**.domain.**", "co.kirikiri.persistence.goalroom.dto.**", "**.*Application*", "**.*Config*", From 5c7550d9aacaeec5167adda09faacfbcae137d36 Mon Sep 17 00:00:00 2001 From: ChoiYoungHoon Date: Sat, 6 Jan 2024 23:53:03 +0900 Subject: [PATCH 4/6] =?UTF-8?q?feat:=20goalroom=20=ED=8C=A8=ED=82=A4?= =?UTF-8?q?=EC=A7=80=EC=97=90=EC=84=9C=20=EC=82=AC=EC=9A=A9=ED=95=98?= =?UTF-8?q?=EB=8A=94=20member=20dto=20=ED=81=B4=EB=9E=98=EC=8A=A4=20goalro?= =?UTF-8?q?om=20=ED=8C=A8=ED=82=A4=EC=A7=80=EB=A1=9C=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/GoalRoomController.java | 4 +- .../dto/response/MemberCheckFeedResponse.java | 11 ---- .../MemberGoalRoomRoadmapNodeResponse.java | 12 ---- .../MemberGoalRoomRoadmapNodesResponse.java | 10 --- .../MemberGoalRoomToDoCheckResponse.java | 6 -- .../response/MemberGoalRoomTodoResponse.java | 12 ---- .../MemberGoalRoomForListResponse.java | 3 +- .../response/MemberGoalRoomResponse.java | 8 +-- .../service/goalroom/GoalRoomReadService.java | 4 +- .../service/mapper/GoalRoomMapper.java | 66 +++++++++---------- .../RefreshTokenRepositoryTest.java | 2 +- .../auth/service/JwtTokenProviderTest.java | 1 + .../controller/GoalRoomReadApiTest.java | 54 +++++++-------- .../helper/ControllerTestHelper.java | 10 +-- .../GoalRoomCreateIntegrationTest.java | 2 +- .../GoalRoomReadIntegrationTest.java | 18 ++--- .../GoalRoomSchedulerIntegrationTest.java | 2 +- .../fixture/GoalRoomAPIFixture.java | 2 +- .../controller/MemberCreateApiTest.java | 5 +- .../controller/MemberReadApiTest.java | 3 +- .../service/GoalRoomReadServiceTest.java | 66 +++++++++---------- 21 files changed, 120 insertions(+), 181 deletions(-) delete mode 100644 backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberCheckFeedResponse.java delete mode 100644 backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomRoadmapNodeResponse.java delete mode 100644 backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomRoadmapNodesResponse.java delete mode 100644 backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomToDoCheckResponse.java delete mode 100644 backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomTodoResponse.java rename backend/kirikiri/src/main/java/co/kirikiri/{member/service/dto => service/dto/goalroom}/response/MemberGoalRoomForListResponse.java (77%) rename backend/kirikiri/src/main/java/co/kirikiri/{member/service/dto => service/dto/goalroom}/response/MemberGoalRoomResponse.java (59%) rename backend/kirikiri/src/test/java/co/kirikiri/{ => member}/controller/MemberCreateApiTest.java (99%) rename backend/kirikiri/src/test/java/co/kirikiri/{ => member}/controller/MemberReadApiTest.java (98%) diff --git a/backend/kirikiri/src/main/java/co/kirikiri/controller/GoalRoomController.java b/backend/kirikiri/src/main/java/co/kirikiri/controller/GoalRoomController.java index d619a6009..deb0984b8 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/controller/GoalRoomController.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/controller/GoalRoomController.java @@ -2,8 +2,6 @@ import co.kirikiri.common.interceptor.Authenticated; import co.kirikiri.common.resolver.MemberIdentifier; -import co.kirikiri.member.service.dto.response.MemberGoalRoomForListResponse; -import co.kirikiri.member.service.dto.response.MemberGoalRoomResponse; import co.kirikiri.service.dto.goalroom.GoalRoomMemberSortTypeDto; import co.kirikiri.service.dto.goalroom.request.CheckFeedRequest; import co.kirikiri.service.dto.goalroom.request.GoalRoomCreateRequest; @@ -16,6 +14,8 @@ import co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodeDetailResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomToDoCheckResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomTodoResponse; +import co.kirikiri.service.dto.goalroom.response.MemberGoalRoomForListResponse; +import co.kirikiri.service.dto.goalroom.response.MemberGoalRoomResponse; import co.kirikiri.service.goalroom.GoalRoomCreateService; import co.kirikiri.service.goalroom.GoalRoomReadService; import jakarta.validation.Valid; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberCheckFeedResponse.java b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberCheckFeedResponse.java deleted file mode 100644 index bb0edf435..000000000 --- a/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberCheckFeedResponse.java +++ /dev/null @@ -1,11 +0,0 @@ -package co.kirikiri.member.service.dto.response; - -import java.time.LocalDate; - -public record MemberCheckFeedResponse( - Long id, - String imageUrl, - String description, - LocalDate createdAt -) { -} diff --git a/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomRoadmapNodeResponse.java b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomRoadmapNodeResponse.java deleted file mode 100644 index 238b098cd..000000000 --- a/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomRoadmapNodeResponse.java +++ /dev/null @@ -1,12 +0,0 @@ -package co.kirikiri.member.service.dto.response; - -import java.time.LocalDate; - -public record MemberGoalRoomRoadmapNodeResponse( - Long id, - String title, - LocalDate startDate, - LocalDate endDate, - Integer checkCount -) { -} diff --git a/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomRoadmapNodesResponse.java b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomRoadmapNodesResponse.java deleted file mode 100644 index 0282b7201..000000000 --- a/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomRoadmapNodesResponse.java +++ /dev/null @@ -1,10 +0,0 @@ -package co.kirikiri.member.service.dto.response; - -import java.util.List; - -public record MemberGoalRoomRoadmapNodesResponse( - boolean hasFrontNode, - boolean hasBackNode, - List nodes -) { -} diff --git a/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomToDoCheckResponse.java b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomToDoCheckResponse.java deleted file mode 100644 index b358d58b7..000000000 --- a/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomToDoCheckResponse.java +++ /dev/null @@ -1,6 +0,0 @@ -package co.kirikiri.member.service.dto.response; - -public record MemberGoalRoomToDoCheckResponse( - boolean isChecked -) { -} diff --git a/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomTodoResponse.java b/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomTodoResponse.java deleted file mode 100644 index e67d60789..000000000 --- a/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomTodoResponse.java +++ /dev/null @@ -1,12 +0,0 @@ -package co.kirikiri.member.service.dto.response; - -import java.time.LocalDate; - -public record MemberGoalRoomTodoResponse( - Long id, - String content, - LocalDate startDate, - LocalDate endDate, - MemberGoalRoomToDoCheckResponse check -) { -} diff --git a/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomForListResponse.java b/backend/kirikiri/src/main/java/co/kirikiri/service/dto/goalroom/response/MemberGoalRoomForListResponse.java similarity index 77% rename from backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomForListResponse.java rename to backend/kirikiri/src/main/java/co/kirikiri/service/dto/goalroom/response/MemberGoalRoomForListResponse.java index 555fd99c1..f01e093a6 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomForListResponse.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/service/dto/goalroom/response/MemberGoalRoomForListResponse.java @@ -1,5 +1,6 @@ -package co.kirikiri.member.service.dto.response; +package co.kirikiri.service.dto.goalroom.response; +import co.kirikiri.member.service.dto.response.MemberResponse; import java.time.LocalDate; import java.time.LocalDateTime; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomResponse.java b/backend/kirikiri/src/main/java/co/kirikiri/service/dto/goalroom/response/MemberGoalRoomResponse.java similarity index 59% rename from backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomResponse.java rename to backend/kirikiri/src/main/java/co/kirikiri/service/dto/goalroom/response/MemberGoalRoomResponse.java index 8698e1152..093b45cbb 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/member/service/dto/response/MemberGoalRoomResponse.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/service/dto/goalroom/response/MemberGoalRoomResponse.java @@ -1,4 +1,4 @@ -package co.kirikiri.member.service.dto.response; +package co.kirikiri.service.dto.goalroom.response; import java.time.LocalDate; import java.util.List; @@ -12,9 +12,9 @@ public record MemberGoalRoomResponse( LocalDate startDate, LocalDate endDate, Long roadmapContentId, - MemberGoalRoomRoadmapNodesResponse goalRoomRoadmapNodes, - List goalRoomTodos, - List checkFeeds + GoalRoomRoadmapNodesResponse goalRoomRoadmapNodes, + List goalRoomTodos, + List checkFeeds ) { } diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/goalroom/GoalRoomReadService.java b/backend/kirikiri/src/main/java/co/kirikiri/service/goalroom/GoalRoomReadService.java index dfac27398..8f99ae9b2 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/goalroom/GoalRoomReadService.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/service/goalroom/GoalRoomReadService.java @@ -18,8 +18,6 @@ import co.kirikiri.member.domain.vo.Identifier; import co.kirikiri.member.persistence.MemberRepository; import co.kirikiri.member.service.dto.MemberDto; -import co.kirikiri.member.service.dto.response.MemberGoalRoomForListResponse; -import co.kirikiri.member.service.dto.response.MemberGoalRoomResponse; import co.kirikiri.persistence.goalroom.CheckFeedRepository; import co.kirikiri.persistence.goalroom.GoalRoomMemberRepository; import co.kirikiri.persistence.goalroom.GoalRoomPendingMemberRepository; @@ -39,6 +37,8 @@ import co.kirikiri.service.dto.goalroom.response.GoalRoomResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodeDetailResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomTodoResponse; +import co.kirikiri.service.dto.goalroom.response.MemberGoalRoomForListResponse; +import co.kirikiri.service.dto.goalroom.response.MemberGoalRoomResponse; import co.kirikiri.service.mapper.GoalRoomMapper; import java.net.URL; import java.time.LocalDate; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/mapper/GoalRoomMapper.java b/backend/kirikiri/src/main/java/co/kirikiri/service/mapper/GoalRoomMapper.java index 3e6c05b1e..33297f744 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/mapper/GoalRoomMapper.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/service/mapper/GoalRoomMapper.java @@ -13,13 +13,6 @@ import co.kirikiri.domain.goalroom.vo.LimitedMemberCount; import co.kirikiri.domain.goalroom.vo.Period; import co.kirikiri.member.service.dto.MemberDto; -import co.kirikiri.member.service.dto.response.MemberCheckFeedResponse; -import co.kirikiri.member.service.dto.response.MemberGoalRoomForListResponse; -import co.kirikiri.member.service.dto.response.MemberGoalRoomResponse; -import co.kirikiri.member.service.dto.response.MemberGoalRoomRoadmapNodeResponse; -import co.kirikiri.member.service.dto.response.MemberGoalRoomRoadmapNodesResponse; -import co.kirikiri.member.service.dto.response.MemberGoalRoomToDoCheckResponse; -import co.kirikiri.member.service.dto.response.MemberGoalRoomTodoResponse; import co.kirikiri.member.service.dto.response.MemberResponse; import co.kirikiri.persistence.goalroom.dto.GoalRoomMemberSortType; import co.kirikiri.persistence.goalroom.dto.RoadmapGoalRoomsOrderType; @@ -45,8 +38,11 @@ import co.kirikiri.service.dto.goalroom.response.GoalRoomResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodeDetailResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodeResponse; +import co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodesResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomToDoCheckResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomTodoResponse; +import co.kirikiri.service.dto.goalroom.response.MemberGoalRoomForListResponse; +import co.kirikiri.service.dto.goalroom.response.MemberGoalRoomResponse; import co.kirikiri.service.dto.roadmap.RoadmapGoalRoomNumberDto; import co.kirikiri.service.dto.roadmap.RoadmapGoalRoomsOrderTypeDto; import co.kirikiri.service.dto.roadmap.response.RoadmapGoalRoomResponse; @@ -95,20 +91,20 @@ private static List makeGoalRoomRoadmapNodeDtos( public static GoalRoomResponse convertGoalRoomResponse(final GoalRoom goalRoom) { final GoalRoomRoadmapNodes nodes = goalRoom.getGoalRoomRoadmapNodes(); - final List roadmapNodeResponses = convertGoalRoomNodeResponses(nodes); + final List roadmapNodeResponses = convertGoalRoomNodeResponses(nodes); final int period = goalRoom.calculateTotalPeriod(); return new GoalRoomResponse(goalRoom.getName().getValue(), goalRoom.getCurrentMemberCount(), goalRoom.getLimitedMemberCount().getValue(), roadmapNodeResponses, period); } - public static List convertGoalRoomNodeResponses(final GoalRoomRoadmapNodes nodes) { + public static List convertGoalRoomNodeResponses(final GoalRoomRoadmapNodes nodes) { return nodes.getValues().stream() .map(GoalRoomMapper::convertGoalRoomNodeResponse) .toList(); } - private static GoalRoomRoadmapNodeResponse convertGoalRoomNodeResponse(final GoalRoomRoadmapNode node) { - return new GoalRoomRoadmapNodeResponse(node.getId(), node.getRoadmapNode().getTitle(), node.getStartDate(), + private static co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodeResponse convertGoalRoomNodeResponse(final GoalRoomRoadmapNode node) { + return new co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodeResponse(node.getId(), node.getRoadmapNode().getTitle(), node.getStartDate(), node.getEndDate(), node.getCheckCount()); } @@ -130,7 +126,7 @@ private static GoalRoomRoadmapNodeDetailResponse convertGoalRoomNodeDetailRespon public static GoalRoomCertifiedResponse convertGoalRoomCertifiedResponse(final GoalRoom goalRoom, final boolean isJoined) { final GoalRoomRoadmapNodes nodes = goalRoom.getGoalRoomRoadmapNodes(); - final List roadmapNodeResponses = convertGoalRoomNodeResponses(nodes); + final List roadmapNodeResponses = convertGoalRoomNodeResponses(nodes); final int period = goalRoom.calculateTotalPeriod(); return new GoalRoomCertifiedResponse(goalRoom.getName().getValue(), goalRoom.getCurrentMemberCount(), goalRoom.getLimitedMemberCount().getValue(), roadmapNodeResponses, period, isJoined); @@ -185,18 +181,18 @@ private static GoalRoomMemberResponse convertToGoalRoomMemberResponse(final Goal goalRoomMemberDto.imagePath(), goalRoomMemberDto.accomplishmentRate()); } - public static List convertGoalRoomTodoResponses(final GoalRoomToDos goalRoomToDos, - final List checkedTodos) { + public static List convertGoalRoomTodoResponses(final GoalRoomToDos goalRoomToDos, + final List checkedTodos) { return goalRoomToDos.getValues().stream() .map(goalRoomToDo -> convertGoalRoomTodoResponse(checkedTodos, goalRoomToDo)) .toList(); } - private static GoalRoomTodoResponse convertGoalRoomTodoResponse(final List checkedTodos, - final GoalRoomToDo goalRoomToDo) { - final GoalRoomToDoCheckResponse checkResponse = new GoalRoomToDoCheckResponse( + private static co.kirikiri.service.dto.goalroom.response.GoalRoomTodoResponse convertGoalRoomTodoResponse(final List checkedTodos, + final GoalRoomToDo goalRoomToDo) { + final co.kirikiri.service.dto.goalroom.response.GoalRoomToDoCheckResponse checkResponse = new co.kirikiri.service.dto.goalroom.response.GoalRoomToDoCheckResponse( isCheckedTodo(goalRoomToDo.getId(), checkedTodos)); - return new GoalRoomTodoResponse(goalRoomToDo.getId(), + return new co.kirikiri.service.dto.goalroom.response.GoalRoomTodoResponse(goalRoomToDo.getId(), goalRoomToDo.getContent(), goalRoomToDo.getStartDate(), goalRoomToDo.getEndDate(), checkResponse); @@ -212,11 +208,11 @@ private static boolean isCheckedTodo(final Long targetTodoId, final List checkFeedDtos, final List checkedTodos) { - final MemberGoalRoomRoadmapNodesResponse nodeResponses = convertToMemberGoalRoomRoadmapNodesResponse( + final GoalRoomRoadmapNodesResponse nodeResponses = convertToGoalRoomRoadmapNodesResponse( goalRoom.getGoalRoomRoadmapNodes()); - final List todoResponses = convertMemberGoalRoomTodoResponsesLimit(goalRoom.getGoalRoomToDos(), + final List todoResponses = convertGoalRoomTodoResponsesLimit(goalRoom.getGoalRoomToDos(), checkedTodos); - final List checkFeedResponses = convertToMemberCheckFeedResponses(checkFeedDtos); + final List checkFeedResponses = convertToCheckFeedResponses(checkFeedDtos); return new MemberGoalRoomResponse(goalRoom.getName().getValue(), goalRoom.getStatus().name(), goalRoom.findGoalRoomLeader().getId(), goalRoom.getCurrentMemberCount(), @@ -224,13 +220,13 @@ public static MemberGoalRoomResponse convertToMemberGoalRoomResponse(final GoalR goalRoom.getRoadmapContent().getId(), nodeResponses, todoResponses, checkFeedResponses); } - private static MemberGoalRoomRoadmapNodesResponse convertToMemberGoalRoomRoadmapNodesResponse( + private static GoalRoomRoadmapNodesResponse convertToGoalRoomRoadmapNodesResponse( final GoalRoomRoadmapNodes nodes) { final GoalRoomRoadmapNode currentNode = nodes.getNodeByDate(LocalDate.now()) .orElse(nodes.getNodeByDate(nodes.getGoalRoomStartDate()).get()); if (!nodes.hasBackNode(currentNode)) { - return new MemberGoalRoomRoadmapNodesResponse( + return new GoalRoomRoadmapNodesResponse( nodes.hasFrontNode(currentNode), nodes.hasBackNode(currentNode), List.of(convertMemberGoalRoomNodeResponse(currentNode)) @@ -238,17 +234,17 @@ private static MemberGoalRoomRoadmapNodesResponse convertToMemberGoalRoomRoadmap } final GoalRoomRoadmapNode nextNode = nodes.nextNode(currentNode).get(); - return new MemberGoalRoomRoadmapNodesResponse(nodes.hasFrontNode(currentNode), nodes.hasBackNode(nextNode), + return new GoalRoomRoadmapNodesResponse(nodes.hasFrontNode(currentNode), nodes.hasBackNode(nextNode), List.of(convertMemberGoalRoomNodeResponse(currentNode), convertMemberGoalRoomNodeResponse(nextNode))); } - private static MemberGoalRoomRoadmapNodeResponse convertMemberGoalRoomNodeResponse(final GoalRoomRoadmapNode node) { - return new MemberGoalRoomRoadmapNodeResponse(node.getId(), node.getRoadmapNode().getTitle(), node.getStartDate(), + private static GoalRoomRoadmapNodeResponse convertMemberGoalRoomNodeResponse(final GoalRoomRoadmapNode node) { + return new GoalRoomRoadmapNodeResponse(node.getId(), node.getRoadmapNode().getTitle(), node.getStartDate(), node.getEndDate(), node.getCheckCount()); } - private static List convertMemberGoalRoomTodoResponsesLimit(final GoalRoomToDos goalRoomToDos, - final List checkedTodos) { + private static List convertGoalRoomTodoResponsesLimit(final GoalRoomToDos goalRoomToDos, + final List checkedTodos) { return goalRoomToDos.getValues() .stream() .map(goalRoomToDo -> convertMemberGoalRoomTodoResponse(checkedTodos, goalRoomToDo)) @@ -256,19 +252,19 @@ private static List convertMemberGoalRoomTodoRespons .toList(); } - private static MemberGoalRoomTodoResponse convertMemberGoalRoomTodoResponse(final List checkedTodos, - final GoalRoomToDo goalRoomToDo) { - final MemberGoalRoomToDoCheckResponse checkResponse = new MemberGoalRoomToDoCheckResponse( + private static GoalRoomTodoResponse convertMemberGoalRoomTodoResponse(final List checkedTodos, + final GoalRoomToDo goalRoomToDo) { + final GoalRoomToDoCheckResponse checkResponse = new GoalRoomToDoCheckResponse( isCheckedTodo(goalRoomToDo.getId(), checkedTodos)); - return new MemberGoalRoomTodoResponse(goalRoomToDo.getId(), + return new GoalRoomTodoResponse(goalRoomToDo.getId(), goalRoomToDo.getContent(), goalRoomToDo.getStartDate(), goalRoomToDo.getEndDate(), checkResponse); } - private static List convertToMemberCheckFeedResponses(final List checkFeedDtos) { + private static List convertToCheckFeedResponses(final List checkFeedDtos) { return checkFeedDtos.stream() - .map(checkFeed -> new MemberCheckFeedResponse(checkFeed.id(), checkFeed.imageUrl(), + .map(checkFeed -> new CheckFeedResponse(checkFeed.id(), checkFeed.imageUrl(), checkFeed.description(), checkFeed.createdAt().toLocalDate())) .limit(MAX_MEMBER_GOAL_ROOM_CHECK_FEED_NUMBER) .toList(); @@ -311,7 +307,7 @@ private static GoalRoomCheckFeedResponse convertToGoalRoomCheckFeedResponse( memberDto.imageUrl()); final CheckFeedDto checkFeedDto = goalRoomCheckFeedDto.checkFeedDto(); - final CheckFeedResponse checkFeedResponse = new CheckFeedResponse(checkFeedDto.id(), checkFeedDto.imageUrl(), + final co.kirikiri.service.dto.goalroom.response.CheckFeedResponse checkFeedResponse = new co.kirikiri.service.dto.goalroom.response.CheckFeedResponse(checkFeedDto.id(), checkFeedDto.imageUrl(), checkFeedDto.description(), checkFeedDto.createdAt().toLocalDate()); return new GoalRoomCheckFeedResponse(memberResponse, checkFeedResponse); diff --git a/backend/kirikiri/src/test/java/co/kirikiri/auth/persistence/RefreshTokenRepositoryTest.java b/backend/kirikiri/src/test/java/co/kirikiri/auth/persistence/RefreshTokenRepositoryTest.java index 7b1520f1d..866bc22a8 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/auth/persistence/RefreshTokenRepositoryTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/auth/persistence/RefreshTokenRepositoryTest.java @@ -34,7 +34,7 @@ class RefreshTokenRepositoryTest { @Mock private ValueOperations valueOperations; - private RefreshTokenRepositoryImpl refreshTokenRepository; + private RefreshTokenRepository refreshTokenRepository; @BeforeEach void init() { diff --git a/backend/kirikiri/src/test/java/co/kirikiri/auth/service/JwtTokenProviderTest.java b/backend/kirikiri/src/test/java/co/kirikiri/auth/service/JwtTokenProviderTest.java index 5a5504635..582609338 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/auth/service/JwtTokenProviderTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/auth/service/JwtTokenProviderTest.java @@ -16,6 +16,7 @@ class JwtTokenProviderTest { private static final String secretKey = "9zrOjg1kDd2gUp6KBbElGJj5GHP5BnneDs3nXEhdztHAUjKBX7l69JXUErBovPLn7TVWV0UCfejYZyxIjIMC5KPfSvBzo9C1gJ2"; + TokenProvider tokenProvider = new JwtTokenProvider(secretKey, 1_800_000L, 86_400_000L); @Test diff --git a/backend/kirikiri/src/test/java/co/kirikiri/controller/GoalRoomReadApiTest.java b/backend/kirikiri/src/test/java/co/kirikiri/controller/GoalRoomReadApiTest.java index cfd31b50b..ce647440a 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/controller/GoalRoomReadApiTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/controller/GoalRoomReadApiTest.java @@ -23,13 +23,6 @@ import co.kirikiri.common.exception.NotFoundException; import co.kirikiri.controller.helper.ControllerTestHelper; import co.kirikiri.domain.goalroom.GoalRoomStatus; -import co.kirikiri.member.service.dto.response.MemberCheckFeedResponse; -import co.kirikiri.member.service.dto.response.MemberGoalRoomForListResponse; -import co.kirikiri.member.service.dto.response.MemberGoalRoomResponse; -import co.kirikiri.member.service.dto.response.MemberGoalRoomRoadmapNodeResponse; -import co.kirikiri.member.service.dto.response.MemberGoalRoomRoadmapNodesResponse; -import co.kirikiri.member.service.dto.response.MemberGoalRoomToDoCheckResponse; -import co.kirikiri.member.service.dto.response.MemberGoalRoomTodoResponse; import co.kirikiri.member.service.dto.response.MemberResponse; import co.kirikiri.service.dto.ErrorResponse; import co.kirikiri.service.dto.goalroom.request.GoalRoomStatusTypeRequest; @@ -40,8 +33,11 @@ import co.kirikiri.service.dto.goalroom.response.GoalRoomResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodeDetailResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodeResponse; +import co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodesResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomToDoCheckResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomTodoResponse; +import co.kirikiri.service.dto.goalroom.response.MemberGoalRoomForListResponse; +import co.kirikiri.service.dto.goalroom.response.MemberGoalRoomResponse; import co.kirikiri.service.goalroom.GoalRoomCreateService; import co.kirikiri.service.goalroom.GoalRoomReadService; import com.fasterxml.jackson.core.type.TypeReference; @@ -438,10 +434,10 @@ class GoalRoomReadApiTest extends ControllerTestHelper { void 골룸의_투두리스트를_조회한다() throws Exception { // given final LocalDate today = LocalDate.now(); - final List goalRoomTodoResponses = List.of( - new GoalRoomTodoResponse(1L, "투두 1", today, today.plusDays(10), new GoalRoomToDoCheckResponse(true)), - new GoalRoomTodoResponse(2L, "투두 2", today.plusDays(20), today.plusDays(30), - new GoalRoomToDoCheckResponse(false))); + final List goalRoomTodoResponses = List.of( + new co.kirikiri.service.dto.goalroom.response.GoalRoomTodoResponse(1L, "투두 1", today, today.plusDays(10), new co.kirikiri.service.dto.goalroom.response.GoalRoomToDoCheckResponse(true)), + new co.kirikiri.service.dto.goalroom.response.GoalRoomTodoResponse(2L, "투두 2", today.plusDays(20), today.plusDays(30), + new co.kirikiri.service.dto.goalroom.response.GoalRoomToDoCheckResponse(false))); when(goalRoomReadService.findAllGoalRoomTodo(any(), any())) .thenReturn(goalRoomTodoResponses); @@ -469,7 +465,7 @@ class GoalRoomReadApiTest extends ControllerTestHelper { .andReturn(); // then - final List response = jsonToClass(mvcResult, new TypeReference<>() { + final List response = jsonToClass(mvcResult, new TypeReference<>() { }); assertThat(response) @@ -646,10 +642,10 @@ class GoalRoomReadApiTest extends ControllerTestHelper { // given final GoalRoomCheckFeedResponse goalRoomCheckFeedResponse1 = new GoalRoomCheckFeedResponse( new MemberResponse(1L, "name1", "imageUrl"), - new CheckFeedResponse(1L, "imageUrl", "image description1", LocalDate.now())); + new co.kirikiri.service.dto.goalroom.response.CheckFeedResponse(1L, "imageUrl", "image description1", LocalDate.now())); final GoalRoomCheckFeedResponse goalRoomCheckFeedResponse2 = new GoalRoomCheckFeedResponse( new MemberResponse(2L, "name2", "imageUrl"), - new CheckFeedResponse(2L, "imageUrl", "image description2", LocalDate.now())); + new co.kirikiri.service.dto.goalroom.response.CheckFeedResponse(2L, "imageUrl", "image description2", LocalDate.now())); final List expected = List.of(goalRoomCheckFeedResponse2, goalRoomCheckFeedResponse1); @@ -749,19 +745,19 @@ class GoalRoomReadApiTest extends ControllerTestHelper { } private GoalRoomResponse 골룸_조회_응답을_생성한다() { - final List goalRoomNodeResponses = List.of( - new GoalRoomRoadmapNodeResponse(1L, "로드맵 1주차", LocalDate.of(2023, 7, 19), + final List goalRoomNodeResponses = List.of( + new co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodeResponse(1L, "로드맵 1주차", LocalDate.of(2023, 7, 19), LocalDate.of(2023, 7, 30), 10), - new GoalRoomRoadmapNodeResponse(2L, "로드맵 2주차", LocalDate.of(2023, 8, 1), + new co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodeResponse(2L, "로드맵 2주차", LocalDate.of(2023, 8, 1), LocalDate.of(2023, 8, 5), 2)); return new GoalRoomResponse("골룸", 1, 10, goalRoomNodeResponses, 17); } private GoalRoomCertifiedResponse 로그인시_골룸_조회_응답을_생성한다(final boolean isJoined) { - final List goalRoomNodeResponses = List.of( - new GoalRoomRoadmapNodeResponse(1L, "로드맵 1주차", LocalDate.of(2023, 7, 19), + final List goalRoomNodeResponses = List.of( + new co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodeResponse(1L, "로드맵 1주차", LocalDate.of(2023, 7, 19), LocalDate.of(2023, 7, 30), 10), - new GoalRoomRoadmapNodeResponse(2L, "로드맵 2주차", LocalDate.of(2023, 8, 1), + new co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodeResponse(2L, "로드맵 2주차", LocalDate.of(2023, 8, 1), LocalDate.of(2023, 8, 5), 2)); return new GoalRoomCertifiedResponse("골룸", 1, 10, goalRoomNodeResponses, 17, isJoined); } @@ -770,18 +766,18 @@ class GoalRoomReadApiTest extends ControllerTestHelper { return new MemberGoalRoomResponse("골룸 이름", "RUNNING", 1L, 15, 20, LocalDate.of(2023, 1, 1), LocalDate.of(2023, 12, 31), 1L, - new MemberGoalRoomRoadmapNodesResponse(false, true, List.of( - new MemberGoalRoomRoadmapNodeResponse(1L, "첫번째 골룸 노드 제목", LocalDate.of(2023, 1, 1), + new GoalRoomRoadmapNodesResponse(false, true, List.of( + new GoalRoomRoadmapNodeResponse(1L, "첫번째 골룸 노드 제목", LocalDate.of(2023, 1, 1), LocalDate.of(2023, 1, 31), 15), - new MemberGoalRoomRoadmapNodeResponse(2L, "두번째 골룸 노드 제목", LocalDate.of(2023, 2, 1), + new GoalRoomRoadmapNodeResponse(2L, "두번째 골룸 노드 제목", LocalDate.of(2023, 2, 1), LocalDate.of(2023, 2, 28), 14))), - List.of(new MemberGoalRoomTodoResponse(1L, "첫 번째 할일", + List.of(new GoalRoomTodoResponse(1L, "첫 번째 할일", LocalDate.of(2023, 1, 15), LocalDate.of(2023, 1, 31), - new MemberGoalRoomToDoCheckResponse(false))), - List.of(new MemberCheckFeedResponse(1L, "imageUrl1", "인증 피드 설명 1", LocalDate.now()), - new MemberCheckFeedResponse(2L, "imageUrl2", "인증 피드 설명 2", LocalDate.now()), - new MemberCheckFeedResponse(3L, "imageUrl3", "인증 피드 설명 3", LocalDate.now()), - new MemberCheckFeedResponse(4L, "imageUrl4", "인증 피드 설명 4", LocalDate.now()))); + new GoalRoomToDoCheckResponse(false))), + List.of(new CheckFeedResponse(1L, "imageUrl1", "인증 피드 설명 1", LocalDate.now()), + new CheckFeedResponse(2L, "imageUrl2", "인증 피드 설명 2", LocalDate.now()), + new CheckFeedResponse(3L, "imageUrl3", "인증 피드 설명 3", LocalDate.now()), + new CheckFeedResponse(4L, "imageUrl4", "인증 피드 설명 4", LocalDate.now()))); } diff --git a/backend/kirikiri/src/test/java/co/kirikiri/controller/helper/ControllerTestHelper.java b/backend/kirikiri/src/test/java/co/kirikiri/controller/helper/ControllerTestHelper.java index 99144d662..1cea38e17 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/controller/helper/ControllerTestHelper.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/controller/helper/ControllerTestHelper.java @@ -3,8 +3,8 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.when; -import co.kirikiri.auth.interceptor.AuthInterceptorImpl; -import co.kirikiri.auth.resolver.MemberIdentifierArgumentResolverImpl; +import co.kirikiri.common.interceptor.AuthInterceptor; +import co.kirikiri.common.resolver.MemberIdentifierArgumentResolver; import java.util.List; import org.junit.jupiter.api.BeforeEach; import org.springframework.boot.test.mock.mockito.MockBean; @@ -16,13 +16,13 @@ public class ControllerTestHelper extends RestDocsHelper { protected final String BEARER_TOKEN_FORMAT = "Bearer %s"; @MockBean - protected AuthInterceptorImpl authInterceptor; + protected AuthInterceptor authInterceptor; @MockBean - private MemberIdentifierArgumentResolverImpl memberIdentifierArgumentResolver; + private MemberIdentifierArgumentResolver memberIdentifierArgumentResolver; @BeforeEach - void setUp() { + void setUp() throws Exception { when(authInterceptor.preHandle(any(), any(), any())) .thenReturn(true); when(memberIdentifierArgumentResolver.resolveArgument(any(), any(), any(), any())) diff --git a/backend/kirikiri/src/test/java/co/kirikiri/integration/GoalRoomCreateIntegrationTest.java b/backend/kirikiri/src/test/java/co/kirikiri/integration/GoalRoomCreateIntegrationTest.java index c31018826..875cffbc9 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/integration/GoalRoomCreateIntegrationTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/integration/GoalRoomCreateIntegrationTest.java @@ -34,7 +34,6 @@ import co.kirikiri.integration.helper.InitIntegrationTest; import co.kirikiri.member.service.dto.request.GenderType; import co.kirikiri.member.service.dto.request.MemberJoinRequest; -import co.kirikiri.member.service.dto.response.MemberGoalRoomResponse; import co.kirikiri.member.service.dto.response.MemberInformationResponse; import co.kirikiri.service.dto.ErrorResponse; import co.kirikiri.service.dto.goalroom.GoalRoomFilterTypeDto; @@ -44,6 +43,7 @@ import co.kirikiri.service.dto.goalroom.request.GoalRoomTodoRequest; import co.kirikiri.service.dto.goalroom.response.GoalRoomMemberResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomToDoCheckResponse; +import co.kirikiri.service.dto.goalroom.response.MemberGoalRoomResponse; import co.kirikiri.service.dto.roadmap.response.RoadmapGoalRoomResponses; import co.kirikiri.service.dto.roadmap.response.RoadmapResponse; import com.fasterxml.jackson.core.JsonProcessingException; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/integration/GoalRoomReadIntegrationTest.java b/backend/kirikiri/src/test/java/co/kirikiri/integration/GoalRoomReadIntegrationTest.java index 026412a1f..2ab6e6bd6 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/integration/GoalRoomReadIntegrationTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/integration/GoalRoomReadIntegrationTest.java @@ -36,11 +36,6 @@ import co.kirikiri.integration.helper.InitIntegrationTest; import co.kirikiri.member.service.dto.request.GenderType; import co.kirikiri.member.service.dto.request.MemberJoinRequest; -import co.kirikiri.member.service.dto.response.MemberCheckFeedResponse; -import co.kirikiri.member.service.dto.response.MemberGoalRoomForListResponse; -import co.kirikiri.member.service.dto.response.MemberGoalRoomResponse; -import co.kirikiri.member.service.dto.response.MemberGoalRoomRoadmapNodeResponse; -import co.kirikiri.member.service.dto.response.MemberGoalRoomRoadmapNodesResponse; import co.kirikiri.persistence.goalroom.dto.RoadmapGoalRoomsOrderType; import co.kirikiri.service.dto.ErrorResponse; import co.kirikiri.service.dto.goalroom.GoalRoomMemberSortTypeDto; @@ -48,12 +43,17 @@ import co.kirikiri.service.dto.goalroom.request.GoalRoomCreateRequest; import co.kirikiri.service.dto.goalroom.request.GoalRoomRoadmapNodeRequest; import co.kirikiri.service.dto.goalroom.request.GoalRoomTodoRequest; +import co.kirikiri.service.dto.goalroom.response.CheckFeedResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomCertifiedResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomCheckFeedResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomMemberResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodeDetailResponse; +import co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodeResponse; +import co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodesResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomTodoResponse; +import co.kirikiri.service.dto.goalroom.response.MemberGoalRoomForListResponse; +import co.kirikiri.service.dto.goalroom.response.MemberGoalRoomResponse; import co.kirikiri.service.dto.roadmap.request.RoadmapDifficultyType; import co.kirikiri.service.dto.roadmap.request.RoadmapNodeSaveRequest; import co.kirikiri.service.dto.roadmap.request.RoadmapSaveRequest; @@ -201,12 +201,12 @@ class GoalRoomReadIntegrationTest extends InitIntegrationTest { // then final MemberGoalRoomResponse 예상되는_응답값 = new MemberGoalRoomResponse(정상적인_골룸_이름, "RUNNING", 기본_회원_아이디, 2, 정상적인_골룸_제한_인원, 오늘, 십일_후, 로드맵_응답.content().id(), - new MemberGoalRoomRoadmapNodesResponse(false, false, - List.of(new MemberGoalRoomRoadmapNodeResponse(로드맵_응답.content().nodes().get(0).id(), + new GoalRoomRoadmapNodesResponse(false, false, + List.of(new GoalRoomRoadmapNodeResponse(로드맵_응답.content().nodes().get(0).id(), "roadmap 1st week", 오늘, 십일_후, 정상적인_골룸_노드_인증_횟수))), List.of(), - List.of(new MemberCheckFeedResponse(2L, "default-image-path", "image description", LocalDate.now()), - new MemberCheckFeedResponse(1L, "default-image-path", "image description", LocalDate.now()))); + List.of(new CheckFeedResponse(2L, "default-image-path", "image description", LocalDate.now()), + new CheckFeedResponse(1L, "default-image-path", "image description", LocalDate.now()))); assertThat(요청_응답값) .usingRecursiveComparison() diff --git a/backend/kirikiri/src/test/java/co/kirikiri/integration/GoalRoomSchedulerIntegrationTest.java b/backend/kirikiri/src/test/java/co/kirikiri/integration/GoalRoomSchedulerIntegrationTest.java index c03809593..dbd66d24b 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/integration/GoalRoomSchedulerIntegrationTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/integration/GoalRoomSchedulerIntegrationTest.java @@ -27,11 +27,11 @@ import co.kirikiri.integration.helper.InitIntegrationTest; import co.kirikiri.member.service.dto.request.GenderType; import co.kirikiri.member.service.dto.request.MemberJoinRequest; -import co.kirikiri.member.service.dto.response.MemberGoalRoomResponse; import co.kirikiri.persistence.goalroom.GoalRoomMemberRepository; import co.kirikiri.persistence.goalroom.GoalRoomPendingMemberRepository; import co.kirikiri.service.dto.goalroom.request.GoalRoomCreateRequest; import co.kirikiri.service.dto.goalroom.request.GoalRoomRoadmapNodeRequest; +import co.kirikiri.service.dto.goalroom.response.MemberGoalRoomResponse; import co.kirikiri.service.dto.roadmap.response.RoadmapResponse; import co.kirikiri.service.scheduler.GoalRoomScheduler; import java.io.IOException; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/integration/fixture/GoalRoomAPIFixture.java b/backend/kirikiri/src/test/java/co/kirikiri/integration/fixture/GoalRoomAPIFixture.java index ac6d06bd3..2de4126ab 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/integration/fixture/GoalRoomAPIFixture.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/integration/fixture/GoalRoomAPIFixture.java @@ -5,11 +5,11 @@ import static co.kirikiri.integration.fixture.CommonFixture.LOCATION; import static io.restassured.RestAssured.given; -import co.kirikiri.member.service.dto.response.MemberGoalRoomResponse; import co.kirikiri.service.dto.goalroom.request.CheckFeedRequest; import co.kirikiri.service.dto.goalroom.request.GoalRoomCreateRequest; import co.kirikiri.service.dto.goalroom.request.GoalRoomRoadmapNodeRequest; import co.kirikiri.service.dto.goalroom.request.GoalRoomTodoRequest; +import co.kirikiri.service.dto.goalroom.response.MemberGoalRoomResponse; import co.kirikiri.service.dto.roadmap.response.RoadmapResponse; import io.restassured.common.mapper.TypeRef; import io.restassured.http.Header; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/controller/MemberCreateApiTest.java b/backend/kirikiri/src/test/java/co/kirikiri/member/controller/MemberCreateApiTest.java similarity index 99% rename from backend/kirikiri/src/test/java/co/kirikiri/controller/MemberCreateApiTest.java rename to backend/kirikiri/src/test/java/co/kirikiri/member/controller/MemberCreateApiTest.java index b1fdda593..9e2bf952c 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/controller/MemberCreateApiTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/member/controller/MemberCreateApiTest.java @@ -1,4 +1,4 @@ -package co.kirikiri.controller; +package co.kirikiri.member.controller; import static co.kirikiri.integration.fixture.MemberAPIFixture.DEFAULT_EMAIL; import static org.assertj.core.api.Assertions.assertThat; @@ -6,8 +6,8 @@ import static org.mockito.Mockito.doThrow; import static org.springframework.restdocs.headers.HeaderDocumentation.headerWithName; import static org.springframework.restdocs.headers.HeaderDocumentation.responseHeaders; -import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.post; import static org.springframework.restdocs.payload.PayloadDocumentation.requestFields; +import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.post; import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @@ -15,7 +15,6 @@ import co.kirikiri.common.exception.ConflictException; import co.kirikiri.controller.helper.ControllerTestHelper; import co.kirikiri.controller.helper.FieldDescriptionHelper.FieldDescription; -import co.kirikiri.member.controller.MemberController; import co.kirikiri.member.service.MemberService; import co.kirikiri.member.service.dto.request.GenderType; import co.kirikiri.member.service.dto.request.MemberJoinRequest; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/controller/MemberReadApiTest.java b/backend/kirikiri/src/test/java/co/kirikiri/member/controller/MemberReadApiTest.java similarity index 98% rename from backend/kirikiri/src/test/java/co/kirikiri/controller/MemberReadApiTest.java rename to backend/kirikiri/src/test/java/co/kirikiri/member/controller/MemberReadApiTest.java index 341d99994..2c3c2bb01 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/controller/MemberReadApiTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/member/controller/MemberReadApiTest.java @@ -1,4 +1,4 @@ -package co.kirikiri.controller; +package co.kirikiri.member.controller; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; @@ -14,7 +14,6 @@ import co.kirikiri.common.exception.NotFoundException; import co.kirikiri.controller.helper.ControllerTestHelper; -import co.kirikiri.member.controller.MemberController; import co.kirikiri.member.domain.Gender; import co.kirikiri.member.service.MemberService; import co.kirikiri.member.service.dto.response.MemberInformationForPublicResponse; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/service/GoalRoomReadServiceTest.java b/backend/kirikiri/src/test/java/co/kirikiri/service/GoalRoomReadServiceTest.java index 24c5b30a9..015bb7194 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/service/GoalRoomReadServiceTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/service/GoalRoomReadServiceTest.java @@ -45,11 +45,6 @@ import co.kirikiri.member.domain.vo.Nickname; import co.kirikiri.member.domain.vo.Password; import co.kirikiri.member.persistence.MemberRepository; -import co.kirikiri.member.service.dto.response.MemberCheckFeedResponse; -import co.kirikiri.member.service.dto.response.MemberGoalRoomForListResponse; -import co.kirikiri.member.service.dto.response.MemberGoalRoomResponse; -import co.kirikiri.member.service.dto.response.MemberGoalRoomRoadmapNodeResponse; -import co.kirikiri.member.service.dto.response.MemberGoalRoomRoadmapNodesResponse; import co.kirikiri.member.service.dto.response.MemberResponse; import co.kirikiri.persistence.goalroom.CheckFeedRepository; import co.kirikiri.persistence.goalroom.GoalRoomMemberRepository; @@ -65,8 +60,11 @@ import co.kirikiri.service.dto.goalroom.response.GoalRoomResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodeDetailResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodeResponse; +import co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodesResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomToDoCheckResponse; import co.kirikiri.service.dto.goalroom.response.GoalRoomTodoResponse; +import co.kirikiri.service.dto.goalroom.response.MemberGoalRoomForListResponse; +import co.kirikiri.service.dto.goalroom.response.MemberGoalRoomResponse; import co.kirikiri.service.goalroom.GoalRoomReadService; import java.net.MalformedURLException; import java.net.URL; @@ -500,20 +498,20 @@ class GoalRoomReadServiceTest { final MemberGoalRoomResponse expected = new MemberGoalRoomResponse(goalRoom.getName().getValue(), goalRoom.getStatus().name(), member.getId(), goalRoom.getCurrentMemberCount(), goalRoom.getLimitedMemberCount().getValue(), goalRoom.getStartDate(), goalRoom.getEndDate(), - roadmapContent.getId(), new MemberGoalRoomRoadmapNodesResponse(false, true, + roadmapContent.getId(), new GoalRoomRoadmapNodesResponse(false, true, List.of( - new MemberGoalRoomRoadmapNodeResponse(goalRoomRoadmapNode1.getId(), roadmapNode1.getTitle(), + new GoalRoomRoadmapNodeResponse(goalRoomRoadmapNode1.getId(), roadmapNode1.getTitle(), goalRoomRoadmapNode1.getStartDate(), goalRoomRoadmapNode1.getEndDate(), goalRoomRoadmapNode1.getCheckCount()), - new MemberGoalRoomRoadmapNodeResponse(goalRoomRoadmapNode2.getId(), roadmapNode2.getTitle(), + new GoalRoomRoadmapNodeResponse(goalRoomRoadmapNode2.getId(), roadmapNode2.getTitle(), goalRoomRoadmapNode2.getStartDate(), goalRoomRoadmapNode2.getEndDate(), goalRoomRoadmapNode2.getCheckCount()) )), Collections.emptyList(), List.of( - new MemberCheckFeedResponse(1L, "http://example.com/serverFilePath", "인증 피드 설명", LocalDate.now()), - new MemberCheckFeedResponse(2L, "http://example.com/serverFilePath", "인증 피드 설명", LocalDate.now()), - new MemberCheckFeedResponse(3L, "http://example.com/serverFilePath", "인증 피드 설명", LocalDate.now()), - new MemberCheckFeedResponse(4L, "http://example.com/serverFilePath", "인증 피드 설명", LocalDate.now()) + new CheckFeedResponse(1L, "http://example.com/serverFilePath", "인증 피드 설명", LocalDate.now()), + new CheckFeedResponse(2L, "http://example.com/serverFilePath", "인증 피드 설명", LocalDate.now()), + new CheckFeedResponse(3L, "http://example.com/serverFilePath", "인증 피드 설명", LocalDate.now()), + new CheckFeedResponse(4L, "http://example.com/serverFilePath", "인증 피드 설명", LocalDate.now()) )); //when @@ -562,12 +560,12 @@ class GoalRoomReadServiceTest { final MemberGoalRoomResponse expected = new MemberGoalRoomResponse(goalRoom.getName().getValue(), goalRoom.getStatus().name(), member.getId(), goalRoom.getCurrentMemberCount(), goalRoom.getLimitedMemberCount().getValue(), goalRoom.getStartDate(), goalRoom.getEndDate(), - roadmapContent.getId(), new MemberGoalRoomRoadmapNodesResponse(false, true, + roadmapContent.getId(), new GoalRoomRoadmapNodesResponse(false, true, List.of( - new MemberGoalRoomRoadmapNodeResponse(goalRoomRoadmapNode1.getId(), roadmapNode1.getTitle(), + new GoalRoomRoadmapNodeResponse(goalRoomRoadmapNode1.getId(), roadmapNode1.getTitle(), goalRoomRoadmapNode1.getStartDate(), goalRoomRoadmapNode1.getEndDate(), goalRoomRoadmapNode1.getCheckCount()), - new MemberGoalRoomRoadmapNodeResponse(goalRoomRoadmapNode2.getId(), roadmapNode2.getTitle(), + new GoalRoomRoadmapNodeResponse(goalRoomRoadmapNode2.getId(), roadmapNode2.getTitle(), goalRoomRoadmapNode2.getStartDate(), goalRoomRoadmapNode2.getEndDate(), goalRoomRoadmapNode2.getCheckCount()) )), Collections.emptyList(), Collections.emptyList()); @@ -623,20 +621,20 @@ class GoalRoomReadServiceTest { final MemberGoalRoomResponse expected = new MemberGoalRoomResponse(goalRoom.getName().getValue(), goalRoom.getStatus().name(), member.getId(), goalRoom.getCurrentMemberCount(), goalRoom.getLimitedMemberCount().getValue(), goalRoom.getStartDate(), goalRoom.getEndDate(), - roadmapContent.getId(), new MemberGoalRoomRoadmapNodesResponse(false, true, + roadmapContent.getId(), new GoalRoomRoadmapNodesResponse(false, true, List.of( - new MemberGoalRoomRoadmapNodeResponse(goalRoomRoadmapNode1.getId(), roadmapNode1.getTitle(), + new GoalRoomRoadmapNodeResponse(goalRoomRoadmapNode1.getId(), roadmapNode1.getTitle(), goalRoomRoadmapNode1.getStartDate(), goalRoomRoadmapNode1.getEndDate(), goalRoomRoadmapNode1.getCheckCount()), - new MemberGoalRoomRoadmapNodeResponse(goalRoomRoadmapNode2.getId(), roadmapNode2.getTitle(), + new GoalRoomRoadmapNodeResponse(goalRoomRoadmapNode2.getId(), roadmapNode2.getTitle(), goalRoomRoadmapNode2.getStartDate(), goalRoomRoadmapNode2.getEndDate(), goalRoomRoadmapNode2.getCheckCount()) )), Collections.emptyList(), List.of( - new MemberCheckFeedResponse(1L, "http://example.com/serverFilePath", "인증 피드 설명", LocalDate.now()), - new MemberCheckFeedResponse(2L, "http://example.com/serverFilePath", "인증 피드 설명", LocalDate.now()), - new MemberCheckFeedResponse(3L, "http://example.com/serverFilePath", "인증 피드 설명", LocalDate.now()), - new MemberCheckFeedResponse(4L, "http://example.com/serverFilePath", "인증 피드 설명", LocalDate.now()) + new CheckFeedResponse(1L, "http://example.com/serverFilePath", "인증 피드 설명", LocalDate.now()), + new CheckFeedResponse(2L, "http://example.com/serverFilePath", "인증 피드 설명", LocalDate.now()), + new CheckFeedResponse(3L, "http://example.com/serverFilePath", "인증 피드 설명", LocalDate.now()), + new CheckFeedResponse(4L, "http://example.com/serverFilePath", "인증 피드 설명", LocalDate.now()) )); //when @@ -1029,13 +1027,13 @@ THIRTY_DAY_LATER, new MemberResponse(creator.getId(), creator.getNickname().getV // then final GoalRoomCheckFeedResponse goalRoomCheckFeedResponse1 = new GoalRoomCheckFeedResponse( new MemberResponse(1L, "name1", "http://example.com/serverFilePath"), - new CheckFeedResponse(1L, "http://example.com/serverFilePath", "description1", LocalDate.now())); + new co.kirikiri.service.dto.goalroom.response.CheckFeedResponse(1L, "http://example.com/serverFilePath", "description1", LocalDate.now())); final GoalRoomCheckFeedResponse goalRoomCheckFeedResponse2 = new GoalRoomCheckFeedResponse( new MemberResponse(1L, "name1", "http://example.com/serverFilePath"), - new CheckFeedResponse(2L, "http://example.com/serverFilePath", "description2", LocalDate.now())); + new co.kirikiri.service.dto.goalroom.response.CheckFeedResponse(2L, "http://example.com/serverFilePath", "description2", LocalDate.now())); final GoalRoomCheckFeedResponse goalRoomCheckFeedResponse3 = new GoalRoomCheckFeedResponse( new MemberResponse(2L, "name1", "http://example.com/serverFilePath"), - new CheckFeedResponse(3L, "http://example.com/serverFilePath", "description3", LocalDate.now())); + new co.kirikiri.service.dto.goalroom.response.CheckFeedResponse(3L, "http://example.com/serverFilePath", "description3", LocalDate.now())); final List expected = List.of(goalRoomCheckFeedResponse3, goalRoomCheckFeedResponse2, goalRoomCheckFeedResponse1); @@ -1107,13 +1105,13 @@ THIRTY_DAY_LATER, new MemberResponse(creator.getId(), creator.getNickname().getV // then final GoalRoomCheckFeedResponse goalRoomCheckFeedResponse1 = new GoalRoomCheckFeedResponse( new MemberResponse(1L, "name1", "http://example.com/serverFilePath"), - new CheckFeedResponse(1L, "http://example.com/serverFilePath", "description1", LocalDate.now())); + new co.kirikiri.service.dto.goalroom.response.CheckFeedResponse(1L, "http://example.com/serverFilePath", "description1", LocalDate.now())); final GoalRoomCheckFeedResponse goalRoomCheckFeedResponse2 = new GoalRoomCheckFeedResponse( new MemberResponse(1L, "name1", "http://example.com/serverFilePath"), - new CheckFeedResponse(2L, "http://example.com/serverFilePath", "description2", LocalDate.now())); + new co.kirikiri.service.dto.goalroom.response.CheckFeedResponse(2L, "http://example.com/serverFilePath", "description2", LocalDate.now())); final GoalRoomCheckFeedResponse goalRoomCheckFeedResponse3 = new GoalRoomCheckFeedResponse( new MemberResponse(2L, "name1", "http://example.com/serverFilePath"), - new CheckFeedResponse(3L, "http://example.com/serverFilePath", "description3", LocalDate.now())); + new co.kirikiri.service.dto.goalroom.response.CheckFeedResponse(3L, "http://example.com/serverFilePath", "description3", LocalDate.now())); final List expected = List.of(goalRoomCheckFeedResponse3, goalRoomCheckFeedResponse2, goalRoomCheckFeedResponse1); @@ -1268,17 +1266,17 @@ null, new EncryptedPassword(new Password("password1")), new Nickname("name1"), } private static GoalRoomResponse 예상하는_골룸_응답을_생성한다() { - final List goalRoomNodeResponses = List.of( - new GoalRoomRoadmapNodeResponse(1L, "로드맵 1주차", TODAY, TEN_DAY_LATER, 10), - new GoalRoomRoadmapNodeResponse(2L, "로드맵 2주차", TWENTY_DAY_LAYER, THIRTY_DAY_LATER, 2)); + final List goalRoomNodeResponses = List.of( + new co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodeResponse(1L, "로드맵 1주차", TODAY, TEN_DAY_LATER, 10), + new co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodeResponse(2L, "로드맵 2주차", TWENTY_DAY_LAYER, THIRTY_DAY_LATER, 2)); return new GoalRoomResponse("골룸", 1, 10, goalRoomNodeResponses, 31); } private static GoalRoomCertifiedResponse 예상하는_로그인된_사용자의_골룸_응답을_생성한다(final Boolean isJoined, final int currentMemberCount) { - final List goalRoomNodeResponses = List.of( - new GoalRoomRoadmapNodeResponse(1L, "로드맵 1주차", TODAY, TEN_DAY_LATER, 10), - new GoalRoomRoadmapNodeResponse(2L, "로드맵 2주차", TWENTY_DAY_LAYER, THIRTY_DAY_LATER, 2)); + final List goalRoomNodeResponses = List.of( + new co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodeResponse(1L, "로드맵 1주차", TODAY, TEN_DAY_LATER, 10), + new co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodeResponse(2L, "로드맵 2주차", TWENTY_DAY_LAYER, THIRTY_DAY_LATER, 2)); return new GoalRoomCertifiedResponse("골룸", currentMemberCount, 10, goalRoomNodeResponses, 31, isJoined); } From fe568b5e3cfc6e981266c706dbbebceb00fbd389 Mon Sep 17 00:00:00 2001 From: ChoiYoungHoon Date: Sat, 6 Jan 2024 23:56:46 +0900 Subject: [PATCH 5/6] =?UTF-8?q?feat:=20=EB=B3=80=EA=B2=BD=20=EC=9A=94?= =?UTF-8?q?=EA=B5=AC=EC=82=AC=ED=95=AD=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/co/kirikiri/auth/controller/AuthController.java | 2 +- .../main/java/co/kirikiri/auth/service/NaverOauthService.java | 2 +- .../service/dto/{ => response}/OauthRedirectResponse.java | 2 +- .../java/co/kirikiri/auth/service/mapper/OauthMapper.java | 2 +- .../main/java/co/kirikiri/common/aop/ExceptionConvertAop.java | 4 ++-- .../common/exception/{ => domain}/DomainException.java | 2 +- .../exception/{ => domain}/ImageExtensionException.java | 2 +- .../exception/{ => domain}/UnexpectedDomainException.java | 2 +- .../main/java/co/kirikiri/common/type/ImageContentType.java | 2 +- .../java/co/kirikiri/domain/goalroom/GoalRoomMembers.java | 2 +- .../co/kirikiri/domain/goalroom/GoalRoomPendingMembers.java | 2 +- .../kirikiri/domain/goalroom/exception/GoalRoomException.java | 2 +- .../kirikiri/domain/roadmap/exception/RoadmapException.java | 2 +- .../java/co/kirikiri/member/domain/EncryptedPassword.java | 2 +- .../co/kirikiri/member/domain/exception/MemberException.java | 2 +- .../java/co/kirikiri/auth/controller/AuthCreateApiTest.java | 2 +- .../java/co/kirikiri/auth/service/NaverOauthServiceTest.java | 2 +- .../kirikiri/domain/goalroom/GoalRoomPendingMembersTest.java | 2 +- .../co/kirikiri/integration/fixture/GoalRoomAPIFixture.java | 3 +-- .../java/co/kirikiri/service/GoalRoomCreateServiceTest.java | 2 +- 20 files changed, 21 insertions(+), 22 deletions(-) rename backend/kirikiri/src/main/java/co/kirikiri/auth/service/dto/{ => response}/OauthRedirectResponse.java (64%) rename backend/kirikiri/src/main/java/co/kirikiri/common/exception/{ => domain}/DomainException.java (75%) rename backend/kirikiri/src/main/java/co/kirikiri/common/exception/{ => domain}/ImageExtensionException.java (77%) rename backend/kirikiri/src/main/java/co/kirikiri/common/exception/{ => domain}/UnexpectedDomainException.java (78%) diff --git a/backend/kirikiri/src/main/java/co/kirikiri/auth/controller/AuthController.java b/backend/kirikiri/src/main/java/co/kirikiri/auth/controller/AuthController.java index 42e90f863..546a7dca7 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/auth/controller/AuthController.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/auth/controller/AuthController.java @@ -2,7 +2,7 @@ import co.kirikiri.auth.service.AuthService; import co.kirikiri.auth.service.NaverOauthService; -import co.kirikiri.auth.service.dto.OauthRedirectResponse; +import co.kirikiri.auth.service.dto.response.OauthRedirectResponse; import co.kirikiri.auth.service.dto.request.LoginRequest; import co.kirikiri.auth.service.dto.request.ReissueTokenRequest; import co.kirikiri.auth.service.dto.response.AuthenticationResponse; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/auth/service/NaverOauthService.java b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/NaverOauthService.java index 4c977af84..578c01d97 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/auth/service/NaverOauthService.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/NaverOauthService.java @@ -3,7 +3,7 @@ import co.kirikiri.auth.service.dto.NaverMemberProfileDto; import co.kirikiri.auth.service.dto.NaverMemberProfileResponseDto; import co.kirikiri.auth.service.dto.NaverOauthTokenDto; -import co.kirikiri.auth.service.dto.OauthRedirectResponse; +import co.kirikiri.auth.service.dto.response.OauthRedirectResponse; import co.kirikiri.auth.service.dto.response.AuthenticationResponse; import co.kirikiri.auth.service.mapper.OauthMapper; import co.kirikiri.member.domain.Member; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/auth/service/dto/OauthRedirectResponse.java b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/dto/response/OauthRedirectResponse.java similarity index 64% rename from backend/kirikiri/src/main/java/co/kirikiri/auth/service/dto/OauthRedirectResponse.java rename to backend/kirikiri/src/main/java/co/kirikiri/auth/service/dto/response/OauthRedirectResponse.java index 516ff3c08..6041f63e4 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/auth/service/dto/OauthRedirectResponse.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/dto/response/OauthRedirectResponse.java @@ -1,4 +1,4 @@ -package co.kirikiri.auth.service.dto; +package co.kirikiri.auth.service.dto.response; public record OauthRedirectResponse( String url, diff --git a/backend/kirikiri/src/main/java/co/kirikiri/auth/service/mapper/OauthMapper.java b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/mapper/OauthMapper.java index 56b08b676..df8cf4025 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/auth/service/mapper/OauthMapper.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/auth/service/mapper/OauthMapper.java @@ -1,6 +1,6 @@ package co.kirikiri.auth.service.mapper; -import co.kirikiri.auth.service.dto.OauthRedirectResponse; +import co.kirikiri.auth.service.dto.response.OauthRedirectResponse; public class OauthMapper { diff --git a/backend/kirikiri/src/main/java/co/kirikiri/common/aop/ExceptionConvertAop.java b/backend/kirikiri/src/main/java/co/kirikiri/common/aop/ExceptionConvertAop.java index 75a043acd..532f9d2b3 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/common/aop/ExceptionConvertAop.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/aop/ExceptionConvertAop.java @@ -1,9 +1,9 @@ package co.kirikiri.common.aop; import co.kirikiri.common.exception.BadRequestException; -import co.kirikiri.common.exception.DomainException; +import co.kirikiri.common.exception.domain.DomainException; import co.kirikiri.common.exception.ServerException; -import co.kirikiri.common.exception.UnexpectedDomainException; +import co.kirikiri.common.exception.domain.UnexpectedDomainException; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; import org.springframework.stereotype.Component; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/common/exception/DomainException.java b/backend/kirikiri/src/main/java/co/kirikiri/common/exception/domain/DomainException.java similarity index 75% rename from backend/kirikiri/src/main/java/co/kirikiri/common/exception/DomainException.java rename to backend/kirikiri/src/main/java/co/kirikiri/common/exception/domain/DomainException.java index 6d458a6c9..4d53b691f 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/common/exception/DomainException.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/exception/domain/DomainException.java @@ -1,4 +1,4 @@ -package co.kirikiri.common.exception; +package co.kirikiri.common.exception.domain; public class DomainException extends RuntimeException { diff --git a/backend/kirikiri/src/main/java/co/kirikiri/common/exception/ImageExtensionException.java b/backend/kirikiri/src/main/java/co/kirikiri/common/exception/domain/ImageExtensionException.java similarity index 77% rename from backend/kirikiri/src/main/java/co/kirikiri/common/exception/ImageExtensionException.java rename to backend/kirikiri/src/main/java/co/kirikiri/common/exception/domain/ImageExtensionException.java index 1643f0399..e60fff500 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/common/exception/ImageExtensionException.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/exception/domain/ImageExtensionException.java @@ -1,4 +1,4 @@ -package co.kirikiri.common.exception; +package co.kirikiri.common.exception.domain; public class ImageExtensionException extends DomainException { diff --git a/backend/kirikiri/src/main/java/co/kirikiri/common/exception/UnexpectedDomainException.java b/backend/kirikiri/src/main/java/co/kirikiri/common/exception/domain/UnexpectedDomainException.java similarity index 78% rename from backend/kirikiri/src/main/java/co/kirikiri/common/exception/UnexpectedDomainException.java rename to backend/kirikiri/src/main/java/co/kirikiri/common/exception/domain/UnexpectedDomainException.java index 510f3c6bc..067c0241a 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/common/exception/UnexpectedDomainException.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/exception/domain/UnexpectedDomainException.java @@ -1,4 +1,4 @@ -package co.kirikiri.common.exception; +package co.kirikiri.common.exception.domain; public class UnexpectedDomainException extends DomainException { diff --git a/backend/kirikiri/src/main/java/co/kirikiri/common/type/ImageContentType.java b/backend/kirikiri/src/main/java/co/kirikiri/common/type/ImageContentType.java index faf34f204..4c86287a0 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/common/type/ImageContentType.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/common/type/ImageContentType.java @@ -1,6 +1,6 @@ package co.kirikiri.common.type; -import co.kirikiri.common.exception.ImageExtensionException; +import co.kirikiri.common.exception.domain.ImageExtensionException; import java.util.Arrays; public enum ImageContentType { diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomMembers.java b/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomMembers.java index 90b92fcb1..fac858681 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomMembers.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomMembers.java @@ -1,6 +1,6 @@ package co.kirikiri.domain.goalroom; -import co.kirikiri.common.exception.UnexpectedDomainException; +import co.kirikiri.common.exception.domain.UnexpectedDomainException; import co.kirikiri.member.domain.Member; import jakarta.persistence.CascadeType; import jakarta.persistence.Embeddable; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomPendingMembers.java b/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomPendingMembers.java index 72355b4be..8f3299cc5 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomPendingMembers.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/GoalRoomPendingMembers.java @@ -1,6 +1,6 @@ package co.kirikiri.domain.goalroom; -import co.kirikiri.common.exception.UnexpectedDomainException; +import co.kirikiri.common.exception.domain.UnexpectedDomainException; import co.kirikiri.member.domain.Member; import jakarta.persistence.CascadeType; import jakarta.persistence.Embeddable; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/exception/GoalRoomException.java b/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/exception/GoalRoomException.java index 65f4f3a74..407c25426 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/exception/GoalRoomException.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/domain/goalroom/exception/GoalRoomException.java @@ -1,6 +1,6 @@ package co.kirikiri.domain.goalroom.exception; -import co.kirikiri.common.exception.DomainException; +import co.kirikiri.common.exception.domain.DomainException; public class GoalRoomException extends DomainException { diff --git a/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/exception/RoadmapException.java b/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/exception/RoadmapException.java index d178b24d2..987fc96ef 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/exception/RoadmapException.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/domain/roadmap/exception/RoadmapException.java @@ -1,6 +1,6 @@ package co.kirikiri.domain.roadmap.exception; -import co.kirikiri.common.exception.DomainException; +import co.kirikiri.common.exception.domain.DomainException; public class RoadmapException extends DomainException { diff --git a/backend/kirikiri/src/main/java/co/kirikiri/member/domain/EncryptedPassword.java b/backend/kirikiri/src/main/java/co/kirikiri/member/domain/EncryptedPassword.java index 81347da7f..c7967ad11 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/member/domain/EncryptedPassword.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/domain/EncryptedPassword.java @@ -1,6 +1,6 @@ package co.kirikiri.member.domain; -import co.kirikiri.common.exception.UnexpectedDomainException; +import co.kirikiri.common.exception.domain.UnexpectedDomainException; import co.kirikiri.member.domain.vo.Password; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; diff --git a/backend/kirikiri/src/main/java/co/kirikiri/member/domain/exception/MemberException.java b/backend/kirikiri/src/main/java/co/kirikiri/member/domain/exception/MemberException.java index 6b7501b55..e8b62e619 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/member/domain/exception/MemberException.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/member/domain/exception/MemberException.java @@ -1,6 +1,6 @@ package co.kirikiri.member.domain.exception; -import co.kirikiri.common.exception.DomainException; +import co.kirikiri.common.exception.domain.DomainException; public class MemberException extends DomainException { diff --git a/backend/kirikiri/src/test/java/co/kirikiri/auth/controller/AuthCreateApiTest.java b/backend/kirikiri/src/test/java/co/kirikiri/auth/controller/AuthCreateApiTest.java index 420f9b57f..f40865139 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/auth/controller/AuthCreateApiTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/auth/controller/AuthCreateApiTest.java @@ -14,7 +14,7 @@ import co.kirikiri.auth.service.AuthService; import co.kirikiri.auth.service.NaverOauthService; -import co.kirikiri.auth.service.dto.OauthRedirectResponse; +import co.kirikiri.auth.service.dto.response.OauthRedirectResponse; import co.kirikiri.auth.service.dto.request.LoginRequest; import co.kirikiri.auth.service.dto.request.ReissueTokenRequest; import co.kirikiri.auth.service.dto.response.AuthenticationResponse; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/auth/service/NaverOauthServiceTest.java b/backend/kirikiri/src/test/java/co/kirikiri/auth/service/NaverOauthServiceTest.java index d10ec04f6..32213e1b6 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/auth/service/NaverOauthServiceTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/auth/service/NaverOauthServiceTest.java @@ -8,7 +8,7 @@ import co.kirikiri.auth.service.dto.NaverMemberProfileDto; import co.kirikiri.auth.service.dto.NaverMemberProfileResponseDto; import co.kirikiri.auth.service.dto.NaverOauthTokenDto; -import co.kirikiri.auth.service.dto.OauthRedirectResponse; +import co.kirikiri.auth.service.dto.response.OauthRedirectResponse; import co.kirikiri.auth.service.dto.response.AuthenticationResponse; import co.kirikiri.member.domain.Gender; import co.kirikiri.member.domain.Member; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/domain/goalroom/GoalRoomPendingMembersTest.java b/backend/kirikiri/src/test/java/co/kirikiri/domain/goalroom/GoalRoomPendingMembersTest.java index bdd066327..838578967 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/domain/goalroom/GoalRoomPendingMembersTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/domain/goalroom/GoalRoomPendingMembersTest.java @@ -3,7 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; -import co.kirikiri.common.exception.UnexpectedDomainException; +import co.kirikiri.common.exception.domain.UnexpectedDomainException; import co.kirikiri.domain.goalroom.vo.GoalRoomName; import co.kirikiri.domain.goalroom.vo.LimitedMemberCount; import co.kirikiri.member.domain.EncryptedPassword; diff --git a/backend/kirikiri/src/test/java/co/kirikiri/integration/fixture/GoalRoomAPIFixture.java b/backend/kirikiri/src/test/java/co/kirikiri/integration/fixture/GoalRoomAPIFixture.java index 2de4126ab..598efe8ad 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/integration/fixture/GoalRoomAPIFixture.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/integration/fixture/GoalRoomAPIFixture.java @@ -160,7 +160,7 @@ public class GoalRoomAPIFixture { } public static ExtractableResponse 골룸을_시작한다(final String 로그인_토큰, final Long 골룸_아이디) { - final ExtractableResponse 골룸_시작_요청_응답 = given().log().all() + return given().log().all() .contentType(MediaType.APPLICATION_JSON_VALUE) .when() .header(new Header(HttpHeaders.AUTHORIZATION, 로그인_토큰)) @@ -168,7 +168,6 @@ public class GoalRoomAPIFixture { .then() .log().all() .extract(); - return 골룸_시작_요청_응답; } public static ExtractableResponse 골룸의_사용자_정보를_정렬_기준없이_조회(final Long 골룸_아이디, final String 로그인_토큰) { diff --git a/backend/kirikiri/src/test/java/co/kirikiri/service/GoalRoomCreateServiceTest.java b/backend/kirikiri/src/test/java/co/kirikiri/service/GoalRoomCreateServiceTest.java index 950c2a051..75f69cfb9 100644 --- a/backend/kirikiri/src/test/java/co/kirikiri/service/GoalRoomCreateServiceTest.java +++ b/backend/kirikiri/src/test/java/co/kirikiri/service/GoalRoomCreateServiceTest.java @@ -14,7 +14,7 @@ import static org.mockito.Mockito.when; import co.kirikiri.common.exception.BadRequestException; -import co.kirikiri.common.exception.ImageExtensionException; +import co.kirikiri.common.exception.domain.ImageExtensionException; import co.kirikiri.common.exception.NotFoundException; import co.kirikiri.common.service.FilePathGenerator; import co.kirikiri.common.service.FileService; From 75cb5cd76c7b67eb77679994081cee056c3ed425 Mon Sep 17 00:00:00 2001 From: ChoiYoungHoon Date: Sat, 20 Jan 2024 15:43:25 +0900 Subject: [PATCH 6/6] =?UTF-8?q?feat:=20=EB=B3=80=EA=B2=BD=20=EC=9A=94?= =?UTF-8?q?=EA=B5=AC=EC=82=AC=ED=95=AD=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/mapper/GoalRoomMapper.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/backend/kirikiri/src/main/java/co/kirikiri/service/mapper/GoalRoomMapper.java b/backend/kirikiri/src/main/java/co/kirikiri/service/mapper/GoalRoomMapper.java index 33297f744..8bb392b19 100644 --- a/backend/kirikiri/src/main/java/co/kirikiri/service/mapper/GoalRoomMapper.java +++ b/backend/kirikiri/src/main/java/co/kirikiri/service/mapper/GoalRoomMapper.java @@ -91,20 +91,20 @@ private static List makeGoalRoomRoadmapNodeDtos( public static GoalRoomResponse convertGoalRoomResponse(final GoalRoom goalRoom) { final GoalRoomRoadmapNodes nodes = goalRoom.getGoalRoomRoadmapNodes(); - final List roadmapNodeResponses = convertGoalRoomNodeResponses(nodes); + final List roadmapNodeResponses = convertGoalRoomNodeResponses(nodes); final int period = goalRoom.calculateTotalPeriod(); return new GoalRoomResponse(goalRoom.getName().getValue(), goalRoom.getCurrentMemberCount(), goalRoom.getLimitedMemberCount().getValue(), roadmapNodeResponses, period); } - public static List convertGoalRoomNodeResponses(final GoalRoomRoadmapNodes nodes) { + public static List convertGoalRoomNodeResponses(final GoalRoomRoadmapNodes nodes) { return nodes.getValues().stream() .map(GoalRoomMapper::convertGoalRoomNodeResponse) .toList(); } - private static co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodeResponse convertGoalRoomNodeResponse(final GoalRoomRoadmapNode node) { - return new co.kirikiri.service.dto.goalroom.response.GoalRoomRoadmapNodeResponse(node.getId(), node.getRoadmapNode().getTitle(), node.getStartDate(), + private static GoalRoomRoadmapNodeResponse convertGoalRoomNodeResponse(final GoalRoomRoadmapNode node) { + return new GoalRoomRoadmapNodeResponse(node.getId(), node.getRoadmapNode().getTitle(), node.getStartDate(), node.getEndDate(), node.getCheckCount()); } @@ -126,7 +126,7 @@ private static GoalRoomRoadmapNodeDetailResponse convertGoalRoomNodeDetailRespon public static GoalRoomCertifiedResponse convertGoalRoomCertifiedResponse(final GoalRoom goalRoom, final boolean isJoined) { final GoalRoomRoadmapNodes nodes = goalRoom.getGoalRoomRoadmapNodes(); - final List roadmapNodeResponses = convertGoalRoomNodeResponses(nodes); + final List roadmapNodeResponses = convertGoalRoomNodeResponses(nodes); final int period = goalRoom.calculateTotalPeriod(); return new GoalRoomCertifiedResponse(goalRoom.getName().getValue(), goalRoom.getCurrentMemberCount(), goalRoom.getLimitedMemberCount().getValue(), roadmapNodeResponses, period, isJoined); @@ -181,18 +181,18 @@ private static GoalRoomMemberResponse convertToGoalRoomMemberResponse(final Goal goalRoomMemberDto.imagePath(), goalRoomMemberDto.accomplishmentRate()); } - public static List convertGoalRoomTodoResponses(final GoalRoomToDos goalRoomToDos, - final List checkedTodos) { + public static List convertGoalRoomTodoResponses(final GoalRoomToDos goalRoomToDos, + final List checkedTodos) { return goalRoomToDos.getValues().stream() .map(goalRoomToDo -> convertGoalRoomTodoResponse(checkedTodos, goalRoomToDo)) .toList(); } - private static co.kirikiri.service.dto.goalroom.response.GoalRoomTodoResponse convertGoalRoomTodoResponse(final List checkedTodos, - final GoalRoomToDo goalRoomToDo) { - final co.kirikiri.service.dto.goalroom.response.GoalRoomToDoCheckResponse checkResponse = new co.kirikiri.service.dto.goalroom.response.GoalRoomToDoCheckResponse( + private static GoalRoomTodoResponse convertGoalRoomTodoResponse(final List checkedTodos, + final GoalRoomToDo goalRoomToDo) { + final GoalRoomToDoCheckResponse checkResponse = new GoalRoomToDoCheckResponse( isCheckedTodo(goalRoomToDo.getId(), checkedTodos)); - return new co.kirikiri.service.dto.goalroom.response.GoalRoomTodoResponse(goalRoomToDo.getId(), + return new GoalRoomTodoResponse(goalRoomToDo.getId(), goalRoomToDo.getContent(), goalRoomToDo.getStartDate(), goalRoomToDo.getEndDate(), checkResponse); @@ -307,7 +307,7 @@ private static GoalRoomCheckFeedResponse convertToGoalRoomCheckFeedResponse( memberDto.imageUrl()); final CheckFeedDto checkFeedDto = goalRoomCheckFeedDto.checkFeedDto(); - final co.kirikiri.service.dto.goalroom.response.CheckFeedResponse checkFeedResponse = new co.kirikiri.service.dto.goalroom.response.CheckFeedResponse(checkFeedDto.id(), checkFeedDto.imageUrl(), + final CheckFeedResponse checkFeedResponse = new CheckFeedResponse(checkFeedDto.id(), checkFeedDto.imageUrl(), checkFeedDto.description(), checkFeedDto.createdAt().toLocalDate()); return new GoalRoomCheckFeedResponse(memberResponse, checkFeedResponse);