From 3bcee48e1475bb01266bbcc9590ef86f32cbc792 Mon Sep 17 00:00:00 2001 From: Jaehyeon Date: Mon, 8 Jan 2024 23:54:51 +0900 Subject: [PATCH 01/31] Feat: multi-module --- .github/workflows/jib-build-depoly.yml | 9 +- build.gradle | 143 +++++++----------- daepiro-api/build.gradle | 77 ++++++++++ .../numberone/backend/BackendApplication.java | 0 .../numberone/backend/HelloController.java | 0 .../backend/LoginTestController.java | 0 .../numberone/backend/LoginTestResponse.java | 0 .../numberone/backend}/auth/JwtFilter.java | 2 +- .../backend/auth}/SecurityConfig.java | 3 +- .../admin/controller/AdminController.java | 0 .../domain/admin/service/AdminService.java | 0 .../article/controller/ArticleController.java | 0 .../article/service/ArticleService.java | 0 .../comment/controller/CommentController.java | 0 .../comment/service/CommentService.java | 0 .../controller/ConversationController.java | 0 .../service/ConversationService.java | 0 .../controller/DisasterController.java | 0 .../domain/disaster/event/DisasterEvent.java | 0 .../service/DisasterDataCollector.java | 10 -- .../service/DisasterEventHandler.java | 1 - .../disaster/service/DisasterService.java | 2 - .../controller/FriendshipController.java | 0 .../friendship/service/FriendshipService.java | 3 - .../like/controller/LikeController.java | 0 .../domain/like/service/LikeService.java | 3 - .../member/controller/MemberController.java | 0 .../domain/member/service/MemberService.java | 2 - .../controller/NotificationController.java | 0 .../service/NotificationService.java | 0 .../shelter/controller/ShelterController.java | 0 .../shelter/service/ShelterService.java | 0 .../sponsor/controller/SponsorController.java | 0 .../sponsor/service/SponsorService.java | 1 - .../support/controller/SupportController.java | 0 .../support/service/SupportService.java | 0 .../token/controller/TokenController.java | 0 .../domain/token/service/TokenService.java | 12 +- .../support/fcm/dto/FcmNotificationDto.java | 0 .../fcm/service/FcmMessageProvider.java | 0 .../backend/support/logging/LogAspect.java | 0 .../notification/NotificationMessage.java | 0 .../notification/NotificationMessageSpec.java | 0 .../like/repository/RedisLockRepository.java | 0 .../like/service/RedisLockLikeFacade.java | 0 .../backend/support/s3/S3Provider.java | 0 .../backend/util/LocationProvider.java | 0 .../backend/util/dto/MapApiResponse.java | 0 .../src}/main/resources/logback-spring.xml | 0 .../backend/BackendApplicationTests.java | 0 daepiro-common/build.gradle | 27 ++++ .../backend/config/AspectConfig.java | 0 .../backend/config/FirebaseConfig.java | 0 .../backend/config/RestTemplateConfig.java | 0 .../numberone/backend/config/S3Config.java | 0 .../backend/config/SchedulingConfig.java | 0 .../backend/config/SwaggerConfig.java | 0 .../exception/GlobalExceptionHandler.java | 0 .../backend/exception/NumberOneException.java | 0 .../BadRequestConversationSortException.java | 2 - .../badrequest/BadRequestException.java | 2 +- .../badrequest/BadRequestHeartException.java | 2 - .../BadRequestSocialTokenException.java | 2 - .../BadUserAuthenticationException.java | 0 .../badrequest/FileMissingException.java | 0 .../badrequest/FileUploadException.java | 0 .../InvalidDisasterTypeException.java | 0 .../InvalidInviteTypeException.java | 0 .../InvalidShelterTypeException.java | 0 .../conflict/AlreadyLikedException.java | 0 .../conflict/AlreadyUnLikedException.java | 0 .../exception/conflict/ConflictException.java | 0 .../FirebaseInitializationException.java | 0 .../FirebaseMessageSendException.java | 0 .../UnauthorizedLocationException.java | 0 .../context/CustomExceptionContext.java | 0 .../exception/context/ExceptionContext.java | 0 .../backend/exception/dto/ErrorResponse.java | 0 .../ExpiredAccessTokenException.java | 2 - .../forbidden/ForbiddenException.java | 0 .../forbidden/WrongAccessTokenException.java | 0 .../notfound/NotFoundApiException.java | 2 - .../notfound/NotFoundArticleException.java | 0 .../NotFoundArticleImageException.java | 0 .../notfound/NotFoundCommentException.java | 0 .../NotFoundConversationException.java | 2 - .../notfound/NotFoundCrawlingException.java | 2 - .../notfound/NotFoundDisasterException.java | 2 - .../exception/notfound/NotFoundException.java | 2 +- .../notfound/NotFoundFriendshipException.java | 2 - .../notfound/NotFoundMemberException.java | 0 .../NotFoundRefreshTokenException.java | 2 - .../notfound/NotFoundShelterException.java | 0 .../notfound/NotFoundSponsorException.java | 0 .../notfound/NotFoundSupportException.java | 0 daepiro-core/build.gradle | 91 +++++++++++ .../P6spyLogMessageFormatConfiguration.java | 0 .../config/P6spySqlFormatConfiguration.java | 0 .../numberone/backend/config/RedisConfig.java | 1 - .../config/basetime/BaseTimeConfig.java | 0 .../config/basetime/BaseTimeEntity.java | 0 .../dto/request/CreateDisasterEventDto.java | 5 +- .../dto/response/GetAddressResponse.java | 0 .../dto/request/ModifyArticleRequest.java | 0 .../dto/request/UploadArticleRequest.java | 0 .../dto/response/ArticleSearchParameter.java | 0 .../dto/response/DeleteArticleResponse.java | 0 .../response/GetArticleDetailResponse.java | 1 - .../dto/response/GetArticleListResponse.java | 0 .../dto/response/ModifyArticleResponse.java | 0 .../dto/response/UploadArticleResponse.java | 0 .../domain/article/entity/Article.java | 0 .../domain/article/entity/ArticleStatus.java | 0 .../domain/article/entity/ArticleTag.java | 0 .../article/repository/ArticleRepository.java | 0 .../custom/ArticleRepositoryCustom.java | 0 .../custom/ArticleRepositoryCustomImpl.java | 0 .../articleimage/entity/ArticleImage.java | 0 .../repository/ArticleImageRepository.java | 0 .../entity/ArticleParticipant.java | 0 .../ArticleParticipantRepository.java | 0 .../request/CreateChildCommentRequest.java | 0 .../dto/request/CreateCommentRequest.java | 1 - .../response/CreateChildCommentResponse.java | 0 .../dto/response/CreateCommentResponse.java | 0 .../dto/response/DeleteCommentResponse.java | 0 .../comment/dto/response/GetCommentDto.java | 1 - .../domain/comment/entity/CommentEntity.java | 0 .../comment/repository/CommentRepository.java | 0 .../custom/CommentRepositoryCustom.java | 0 .../custom/CommentRepositoryCustomImpl.java | 1 - .../CreateChildConversationRequest.java | 0 .../request/CreateConversationRequest.java | 0 .../dto/response/GetConversationResponse.java | 1 - .../conversation/entity/Conversation.java | 0 .../repository/ConversationRepository.java | 0 .../dto/request/LatestDisasterRequest.java | 4 - .../dto/request/SaveDisasterRequest.java | 0 .../dto/response/DisasterDataResponse.java | 1 - .../dto/response/LatestDisasterResponse.java | 0 .../dto/response/SituationDetailResponse.java | 0 .../dto/response/SituationHomeResponse.java | 1 - .../dto/response/SituationResponse.java | 2 - .../domain/disaster/entity/Disaster.java | 5 +- .../repository/DisasterRepository.java | 2 - .../domain/disaster/util/DisasterType.java | 0 .../dto/response/FriendResponse.java | 2 - .../dto/response/InviteFriendResponse.java | 0 .../dto/response/SendFcmFriendResponse.java | 0 .../domain/friendship/entity/Friendship.java | 0 .../repository/FriendshipRepository.java | 2 - .../response/ArticleLikeResponse.java | 0 .../response/CommentLikeResponse.java | 0 .../domain/like/entity/ArticleLike.java | 0 .../domain/like/entity/CommentLike.java | 0 .../domain/like/entity/ConversationLike.java | 0 .../repository/ArticleLikeRepository.java | 0 .../repository/CommentLikeRepository.java | 0 .../ConversationLikeRepository.java | 1 - .../member/dto/request/BuyHeartRequest.java | 4 +- .../member/dto/request/OnboardingAddress.java | 0 .../dto/request/OnboardingDisasterType.java | 0 .../member/dto/request/OnboardingRequest.java | 0 .../member/dto/request/UpdateGpsRequest.java | 0 .../dto/request/UpdateSafetyRequest.java | 1 - .../GetNotificationRegionResponse.java | 0 .../member/dto/response/HeartCntResponse.java | 0 .../member/dto/response/MemberIdResponse.java | 1 - .../response/UploadProfileImageResponse.java | 0 .../backend/domain/member/entity/Member.java | 0 .../member/repository/MemberRepository.java | 1 - .../custom/MemberRepositoryCustom.java | 0 .../custom/MemberRepositoryImpl.java | 0 .../request/NotificationSearchParameter.java | 0 .../dto/response/NotificationTabResponse.java | 1 - .../entity/NotificationEntity.java | 2 - .../notification/entity/NotificationTag.java | 0 .../repository/NotificationRepository.java | 0 .../custom/NotificationRepositoryCustom.java | 0 .../NotificationRepositoryCustomImpl.java | 1 - .../entity/NotificationDisaster.java | 0 .../NotificationDisasterRepository.java | 0 .../entity/NotificationRegion.java | 1 - .../NotificationRegionRepository.java | 0 .../dto/request/NearbyShelterRequest.java | 2 - .../dto/response/GetAllSheltersResponse.java | 1 - .../GetShelterDatabaseUrlResponse.java | 0 .../response/NearbyShelterListResponse.java | 0 .../dto/response/NearestShelterResponse.java | 0 .../shelter/dto/response/ShelterMapper.java | 0 .../domain/shelter/entity/Shelter.java | 0 .../shelter/repository/ShelterRepository.java | 0 .../custom/CustomShelterRepository.java | 0 .../custom/CustomShelterRepositoryImpl.java | 0 .../backend/domain/shelter/util/Address.java | 0 .../domain/shelter/util/ShelterStatus.java | 0 .../domain/shelter/util/ShelterType.java | 0 .../dto/response/SponsorHomeResponse.java | 0 .../sponsor/dto/response/SponsorResponse.java | 2 - .../domain/sponsor/entity/Sponsor.java | 0 .../sponsor/repository/SponsorRepository.java | 0 .../dto/request/CreateSupportRequest.java | 0 .../dto/request/EditMessageRequest.java | 0 .../dto/response/CreateSupportResponse.java | 1 - .../domain/support/entity/Support.java | 0 .../support/repository/SupportRepository.java | 2 - .../token/dto/request/GetTokenRequest.java | 5 +- .../dto/request/RefreshTokenRequest.java | 0 .../token/dto/response/GetTokenResponse.java | 0 .../token/dto/response/KakaoInfoResponse.java | 0 .../dto/response/KakaoTokenResponse.java | 0 .../token/dto/response/NaverInfoResponse.java | 0 .../dto/response/NaverTokenResponse.java | 0 .../dto/response/RefreshTokenResponse.java | 0 .../backend/domain/token/entity/Token.java | 2 - .../token/repository/TokenRepository.java | 0 .../backend/domain/token/util/JwtUtil.java | 3 - .../token/util/SecurityContextProvider.java | 0 .../properties/DisasterProperties.java | 1 - .../backend/properties/JwtProperties.java | 0 .../backend/properties/KakaoProperties.java | 0 .../backend/properties/NaverProperties.java | 0 .../backend/properties/RedisProperties.java | 0 .../properties/TokenPeriodProperties.java | 0 gradlew | 0 settings.gradle | 3 + 226 files changed, 281 insertions(+), 194 deletions(-) create mode 100644 daepiro-api/build.gradle rename {src => daepiro-api/src}/main/java/com/numberone/backend/BackendApplication.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/HelloController.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/LoginTestController.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/LoginTestResponse.java (100%) rename {src/main/java/com/numberone/backend/config => daepiro-api/src/main/java/com/numberone/backend}/auth/JwtFilter.java (98%) rename {src/main/java/com/numberone/backend/config => daepiro-api/src/main/java/com/numberone/backend/auth}/SecurityConfig.java (96%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/domain/admin/controller/AdminController.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/domain/admin/service/AdminService.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/domain/article/controller/ArticleController.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/domain/article/service/ArticleService.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/domain/comment/controller/CommentController.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/domain/comment/service/CommentService.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/domain/conversation/controller/ConversationController.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/domain/conversation/service/ConversationService.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/domain/disaster/controller/DisasterController.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/domain/disaster/event/DisasterEvent.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/domain/disaster/service/DisasterDataCollector.java (92%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/domain/disaster/service/DisasterEventHandler.java (99%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/domain/disaster/service/DisasterService.java (99%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/domain/friendship/controller/FriendshipController.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/domain/friendship/service/FriendshipService.java (98%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/domain/like/controller/LikeController.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/domain/like/service/LikeService.java (98%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/domain/member/controller/MemberController.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/domain/member/service/MemberService.java (99%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/domain/notification/controller/NotificationController.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/domain/notification/service/NotificationService.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/domain/shelter/controller/ShelterController.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/domain/shelter/service/ShelterService.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/domain/sponsor/controller/SponsorController.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/domain/sponsor/service/SponsorService.java (98%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/domain/support/controller/SupportController.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/domain/support/service/SupportService.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/domain/token/controller/TokenController.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/domain/token/service/TokenService.java (94%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/support/fcm/dto/FcmNotificationDto.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/support/fcm/service/FcmMessageProvider.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/support/logging/LogAspect.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/support/notification/NotificationMessage.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/support/notification/NotificationMessageSpec.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/support/redis/like/repository/RedisLockRepository.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/support/redis/like/service/RedisLockLikeFacade.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/support/s3/S3Provider.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/util/LocationProvider.java (100%) rename {src => daepiro-api/src}/main/java/com/numberone/backend/util/dto/MapApiResponse.java (100%) rename {src => daepiro-api/src}/main/resources/logback-spring.xml (100%) rename {src => daepiro-api/src}/test/java/com/numberone/backend/BackendApplicationTests.java (100%) create mode 100644 daepiro-common/build.gradle rename {src => daepiro-common/src}/main/java/com/numberone/backend/config/AspectConfig.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/config/FirebaseConfig.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/config/RestTemplateConfig.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/config/S3Config.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/config/SchedulingConfig.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/config/SwaggerConfig.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/GlobalExceptionHandler.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/NumberOneException.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/badrequest/BadRequestConversationSortException.java (83%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/badrequest/BadRequestException.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/badrequest/BadRequestHeartException.java (81%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/badrequest/BadRequestSocialTokenException.java (83%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/badrequest/BadUserAuthenticationException.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/badrequest/FileMissingException.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/badrequest/FileUploadException.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/badrequest/InvalidDisasterTypeException.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/badrequest/InvalidInviteTypeException.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/badrequest/InvalidShelterTypeException.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/conflict/AlreadyLikedException.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/conflict/AlreadyUnLikedException.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/conflict/ConflictException.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/conflict/FirebaseInitializationException.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/conflict/FirebaseMessageSendException.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/conflict/UnauthorizedLocationException.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/context/CustomExceptionContext.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/context/ExceptionContext.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/dto/ErrorResponse.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/forbidden/ExpiredAccessTokenException.java (82%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/forbidden/ForbiddenException.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/forbidden/WrongAccessTokenException.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/notfound/NotFoundApiException.java (80%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/notfound/NotFoundArticleException.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/notfound/NotFoundArticleImageException.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/notfound/NotFoundCommentException.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/notfound/NotFoundConversationException.java (82%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/notfound/NotFoundCrawlingException.java (81%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/notfound/NotFoundDisasterException.java (81%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/notfound/NotFoundException.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/notfound/NotFoundFriendshipException.java (82%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/notfound/NotFoundMemberException.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/notfound/NotFoundRefreshTokenException.java (81%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/notfound/NotFoundShelterException.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/notfound/NotFoundSponsorException.java (100%) rename {src => daepiro-common/src}/main/java/com/numberone/backend/exception/notfound/NotFoundSupportException.java (100%) create mode 100644 daepiro-core/build.gradle rename {src => daepiro-core/src}/main/java/com/numberone/backend/config/P6spyLogMessageFormatConfiguration.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/config/P6spySqlFormatConfiguration.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/config/RedisConfig.java (93%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/config/basetime/BaseTimeConfig.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/config/basetime/BaseTimeEntity.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/admin/dto/request/CreateDisasterEventDto.java (74%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/admin/dto/response/GetAddressResponse.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/article/dto/request/ModifyArticleRequest.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/article/dto/request/UploadArticleRequest.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/article/dto/response/ArticleSearchParameter.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/article/dto/response/DeleteArticleResponse.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/article/dto/response/GetArticleDetailResponse.java (97%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/article/dto/response/GetArticleListResponse.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/article/dto/response/ModifyArticleResponse.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/article/dto/response/UploadArticleResponse.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/article/entity/Article.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/article/entity/ArticleStatus.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/article/entity/ArticleTag.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/article/repository/ArticleRepository.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/article/repository/custom/ArticleRepositoryCustom.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/article/repository/custom/ArticleRepositoryCustomImpl.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/articleimage/entity/ArticleImage.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/articleimage/repository/ArticleImageRepository.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/articleparticipant/entity/ArticleParticipant.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/articleparticipant/repository/ArticleParticipantRepository.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/comment/dto/request/CreateChildCommentRequest.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/comment/dto/request/CreateCommentRequest.java (85%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/comment/dto/response/CreateChildCommentResponse.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/comment/dto/response/CreateCommentResponse.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/comment/dto/response/DeleteCommentResponse.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/comment/dto/response/GetCommentDto.java (97%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/comment/entity/CommentEntity.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/comment/repository/CommentRepository.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/comment/repository/custom/CommentRepositoryCustom.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/comment/repository/custom/CommentRepositoryCustomImpl.java (96%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/conversation/dto/request/CreateChildConversationRequest.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/conversation/dto/request/CreateConversationRequest.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/conversation/dto/response/GetConversationResponse.java (98%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/conversation/entity/Conversation.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/conversation/repository/ConversationRepository.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/disaster/dto/request/LatestDisasterRequest.java (71%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/disaster/dto/request/SaveDisasterRequest.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/disaster/dto/response/DisasterDataResponse.java (99%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/disaster/dto/response/LatestDisasterResponse.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/disaster/dto/response/SituationDetailResponse.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/disaster/dto/response/SituationHomeResponse.java (85%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/disaster/dto/response/SituationResponse.java (97%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/disaster/entity/Disaster.java (94%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/disaster/repository/DisasterRepository.java (89%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/disaster/util/DisasterType.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/friendship/dto/response/FriendResponse.java (97%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/friendship/dto/response/InviteFriendResponse.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/friendship/dto/response/SendFcmFriendResponse.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/friendship/entity/Friendship.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/friendship/repository/FriendshipRepository.java (87%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/like/dto/response/response/ArticleLikeResponse.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/like/dto/response/response/CommentLikeResponse.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/like/entity/ArticleLike.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/like/entity/CommentLike.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/like/entity/ConversationLike.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/like/repository/ArticleLikeRepository.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/like/repository/CommentLikeRepository.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/like/repository/ConversationLikeRepository.java (91%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/member/dto/request/BuyHeartRequest.java (78%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/member/dto/request/OnboardingAddress.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/member/dto/request/OnboardingDisasterType.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/member/dto/request/OnboardingRequest.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/member/dto/request/UpdateGpsRequest.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/member/dto/request/UpdateSafetyRequest.java (88%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/member/dto/response/GetNotificationRegionResponse.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/member/dto/response/HeartCntResponse.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/member/dto/response/MemberIdResponse.java (92%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/member/dto/response/UploadProfileImageResponse.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/member/entity/Member.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/member/repository/MemberRepository.java (92%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/member/repository/custom/MemberRepositoryCustom.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/member/repository/custom/MemberRepositoryImpl.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/notification/dto/request/NotificationSearchParameter.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/notification/dto/response/NotificationTabResponse.java (96%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/notification/entity/NotificationEntity.java (98%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/notification/entity/NotificationTag.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/notification/repository/NotificationRepository.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/notification/repository/custom/NotificationRepositoryCustom.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/notification/repository/custom/NotificationRepositoryCustomImpl.java (98%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/notificationdisaster/entity/NotificationDisaster.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/notificationdisaster/repository/NotificationDisasterRepository.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/notificationregion/entity/NotificationRegion.java (96%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/notificationregion/repository/NotificationRegionRepository.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/shelter/dto/request/NearbyShelterRequest.java (90%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/shelter/dto/response/GetAllSheltersResponse.java (97%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/shelter/dto/response/GetShelterDatabaseUrlResponse.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/shelter/dto/response/NearbyShelterListResponse.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/shelter/dto/response/NearestShelterResponse.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/shelter/dto/response/ShelterMapper.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/shelter/entity/Shelter.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/shelter/repository/ShelterRepository.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/shelter/repository/custom/CustomShelterRepository.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/shelter/repository/custom/CustomShelterRepositoryImpl.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/shelter/util/Address.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/shelter/util/ShelterStatus.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/shelter/util/ShelterType.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/sponsor/dto/response/SponsorHomeResponse.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/sponsor/dto/response/SponsorResponse.java (97%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/sponsor/entity/Sponsor.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/sponsor/repository/SponsorRepository.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/support/dto/request/CreateSupportRequest.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/support/dto/request/EditMessageRequest.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/support/dto/response/CreateSupportResponse.java (88%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/support/entity/Support.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/support/repository/SupportRepository.java (94%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/token/dto/request/GetTokenRequest.java (79%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/token/dto/request/RefreshTokenRequest.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/token/dto/response/GetTokenResponse.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/token/dto/response/KakaoInfoResponse.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/token/dto/response/KakaoTokenResponse.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/token/dto/response/NaverInfoResponse.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/token/dto/response/NaverTokenResponse.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/token/dto/response/RefreshTokenResponse.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/token/entity/Token.java (94%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/token/repository/TokenRepository.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/token/util/JwtUtil.java (92%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/domain/token/util/SecurityContextProvider.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/properties/DisasterProperties.java (88%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/properties/JwtProperties.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/properties/KakaoProperties.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/properties/NaverProperties.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/properties/RedisProperties.java (100%) rename {src => daepiro-core/src}/main/java/com/numberone/backend/properties/TokenPeriodProperties.java (100%) mode change 100644 => 100755 gradlew diff --git a/.github/workflows/jib-build-depoly.yml b/.github/workflows/jib-build-depoly.yml index 2e5da52b..a58273b3 100644 --- a/.github/workflows/jib-build-depoly.yml +++ b/.github/workflows/jib-build-depoly.yml @@ -41,8 +41,8 @@ jobs: - name: 🐧 create application.yml run: | - mkdir -p ./src/main/resources - cd ./src/main/resources + mkdir -p ./daepiro-api/src/main/resources + cd ./daepiro-api/src/main/resources touch ./application.yml echo "${{ secrets.PROPERTIES_PROD }}" | base64 --decode > ./application.yml ls -la @@ -50,14 +50,15 @@ jobs: - name: 🐧 create service-account.json run: | - cd ./src/main/resources - touch ./service-account.json + cd ./daepiro-api/src/main/resources + touch ./daepiro-api/service-account.json echo "${{ secrets.FCM }}" | base64 --decode > ./service-account.json ls -la shell: bash - name: Build with jib run: | + ./gradlew clean ./gradlew jib -x test \ -Djib.to.auth.username=${{ secrets.DOCKER_USERNAME }} \ -Djib.to.auth.password=${{ secrets.DOCKER_PASSWORD }} \ diff --git a/build.gradle b/build.gradle index 0ea0b6a8..43b68b80 100644 --- a/build.gradle +++ b/build.gradle @@ -8,113 +8,76 @@ plugins { group = 'com.numberone' version = '0.0.1-SNAPSHOT' -jib { - from { - image = "openjdk:17-alpine" - } - to { - image = "versatile0010/numberone" - credHelper = 'ecr-login' - tags = ["latest"] - } - container { - jvmFlags = ["-Duser.timezone=Asia/Seoul", "-Xms128m", "-Xmx128m"] - } -} - - +allprojects { + apply plugin: 'java' + sourceCompatibility = JavaVersion.VERSION_17 -java { - sourceCompatibility = '17' -} - -configurations { - compileOnly { - extendsFrom annotationProcessor + repositories { + mavenCentral() + maven{url 'https://jitpack.io'} } } -repositories { - mavenCentral() +ext { + set('springCloudVersion', "2021.0.1") + queryDslVersion = "4.3.0" } -dependencies { - implementation 'org.springframework.boot:spring-boot-starter-security' - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-validation' - - // swagger - implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2' - - // jpa - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - - // queryDSL - implementation "com.querydsl:querydsl-jpa:5.0.0:jakarta" - implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.5.8' - - annotationProcessor "com.querydsl:querydsl-apt:5.0.0:jakarta" - annotationProcessor "jakarta.annotation:jakarta.annotation-api" - annotationProcessor "jakarta.persistence:jakarta.persistence-api" - annotationProcessor "com.querydsl:querydsl-apt:${dependencyManagement.importedProperties['querydsl.version']}:jpa" - annotationProcessor "jakarta.annotation:jakarta.annotation-api" - annotationProcessor "jakarta.persistence:jakarta.persistence-api" - annotationProcessor 'org.projectlombok:lombok' +subprojects { + apply plugin: 'java' + apply plugin: 'io.spring.dependency-management' + apply plugin: 'java-library' + apply plugin: 'org.springframework.boot' + apply plugin: 'jacoco' - compileOnly 'org.projectlombok:lombok' + configurations { + developmentOnly + runtimeClasspath { + extendsFrom developmentOnly + } - runtimeOnly 'com.h2database:h2' - runtimeOnly 'com.mysql:mysql-connector-j' + compileOnly { + extendsFrom annotationProcessor + } + all { + exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat' + } + } - testImplementation 'org.springframework.boot:spring-boot-starter-test' - testImplementation 'org.springframework.security:spring-security-test' - - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' - implementation 'org.springframework.boot:spring-boot-starter-data-redis' - - implementation 'io.jsonwebtoken:jjwt:0.9.1' - implementation 'com.sun.xml.bind:jaxb-impl:4.0.1' - implementation 'com.sun.xml.bind:jaxb-core:4.0.1' - implementation 'javax.xml.bind:jaxb-api:2.4.0-b180830.0359' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' - - // cloud - implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE' + repositories { + mavenCentral() + } - // aop - implementation 'org.springframework.boot:spring-boot-starter-aop' + dependencyManagement { + imports { + mavenBom("org.springframework.boot:spring-boot-dependencies:3.1.4") + mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}" + } + } - //crawling - implementation 'com.squareup.okhttp3:okhttp:4.9.1' - implementation 'org.jsoup:jsoup:1.14.2' - implementation 'net.sourceforge.htmlunit:htmlunit:2.70.0' + dependencies { + //implementation 'org.projectlombok:lombok' + compileOnly 'org.projectlombok:lombok' + annotationProcessor 'org.projectlombok:lombok' + annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor' - //geocoding - implementation 'com.google.code.geocoder-java:geocoder-java:0.16' - // fcm - implementation 'com.google.firebase:firebase-admin:9.1.1' -} + implementation 'org.springframework.boot:spring-boot-starter-undertow' -tasks.named('test') { - useJUnitPlatform() -} + implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.10.3' + implementation 'com.google.code.gson:gson:2.10.1' -// Querydsl μ„€μ •λΆ€ -def generated = 'src/main/generated' + testImplementation('org.springframework.boot:spring-boot-starter-test') { + exclude module: 'junit' + } + testImplementation(platform('org.junit:junit-bom:5.9.3')) + testImplementation('org.junit.jupiter:junit-jupiter') + } -// querydsl QClass 파일 생성 μœ„μΉ˜λ₯Ό 지정 -tasks.withType(JavaCompile) { - options.getGeneratedSourceOutputDirectory().set(file(generated)) -} -// java source set 에 querydsl QClass μœ„μΉ˜ μΆ”κ°€ -sourceSets { - main.java.srcDirs += [ generated ] -} + tasks.named('test') { + useJUnitPlatform() + } -// gradle clean μ‹œμ— QClass 디렉토리 μ‚­μ œ -clean { - delete file(generated) } \ No newline at end of file diff --git a/daepiro-api/build.gradle b/daepiro-api/build.gradle new file mode 100644 index 00000000..a755aeae --- /dev/null +++ b/daepiro-api/build.gradle @@ -0,0 +1,77 @@ +plugins { + id 'com.google.cloud.tools.jib' version '3.4.0' +} + +dependencies { + implementation project(':daepiro-core') + implementation project(':daepiro-common') + + implementation 'org.springframework.boot:spring-boot-starter-security' + implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-validation' + + // swagger + implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2' + + // jpa + implementation 'org.springframework.boot:spring-boot-starter-data-jpa' + + annotationProcessor 'org.projectlombok:lombok' + + compileOnly 'org.projectlombok:lombok' + + runtimeOnly 'com.h2database:h2' + runtimeOnly 'com.mysql:mysql-connector-j' + + + testImplementation 'org.springframework.boot:spring-boot-starter-test' + testImplementation 'org.springframework.security:spring-security-test' + + implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' + implementation 'org.springframework.boot:spring-boot-starter-data-redis' + + implementation 'io.jsonwebtoken:jjwt:0.9.1' + implementation 'com.sun.xml.bind:jaxb-impl:4.0.1' + implementation 'com.sun.xml.bind:jaxb-core:4.0.1' + implementation 'javax.xml.bind:jaxb-api:2.4.0-b180830.0359' + implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' + + // cloud + implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE' + + // aop + implementation 'org.springframework.boot:spring-boot-starter-aop' + + //crawling + implementation 'com.squareup.okhttp3:okhttp:4.9.1' + implementation 'org.jsoup:jsoup:1.14.2' + implementation 'net.sourceforge.htmlunit:htmlunit:2.70.0' + + //geocoding + implementation 'com.google.code.geocoder-java:geocoder-java:0.16' + // fcm + implementation 'com.google.firebase:firebase-admin:9.1.1' +} + +tasks.named('test') { + useJUnitPlatform() +} + + +jib { + from { + image = "openjdk:17-alpine" + } + to { + image = "versatile0010/numberone" + credHelper = 'ecr-login' + tags = ["latest"] + } + container { + jvmFlags = ["-Duser.timezone=Asia/Seoul", "-Xms128m", "-Xmx128m"] + } +} + +tasks.bootJar { + enabled = true +} \ No newline at end of file diff --git a/src/main/java/com/numberone/backend/BackendApplication.java b/daepiro-api/src/main/java/com/numberone/backend/BackendApplication.java similarity index 100% rename from src/main/java/com/numberone/backend/BackendApplication.java rename to daepiro-api/src/main/java/com/numberone/backend/BackendApplication.java diff --git a/src/main/java/com/numberone/backend/HelloController.java b/daepiro-api/src/main/java/com/numberone/backend/HelloController.java similarity index 100% rename from src/main/java/com/numberone/backend/HelloController.java rename to daepiro-api/src/main/java/com/numberone/backend/HelloController.java diff --git a/src/main/java/com/numberone/backend/LoginTestController.java b/daepiro-api/src/main/java/com/numberone/backend/LoginTestController.java similarity index 100% rename from src/main/java/com/numberone/backend/LoginTestController.java rename to daepiro-api/src/main/java/com/numberone/backend/LoginTestController.java diff --git a/src/main/java/com/numberone/backend/LoginTestResponse.java b/daepiro-api/src/main/java/com/numberone/backend/LoginTestResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/LoginTestResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/LoginTestResponse.java diff --git a/src/main/java/com/numberone/backend/config/auth/JwtFilter.java b/daepiro-api/src/main/java/com/numberone/backend/auth/JwtFilter.java similarity index 98% rename from src/main/java/com/numberone/backend/config/auth/JwtFilter.java rename to daepiro-api/src/main/java/com/numberone/backend/auth/JwtFilter.java index 4b8445af..d53a605d 100644 --- a/src/main/java/com/numberone/backend/config/auth/JwtFilter.java +++ b/daepiro-api/src/main/java/com/numberone/backend/auth/JwtFilter.java @@ -1,4 +1,4 @@ -package com.numberone.backend.config.auth; +package com.numberone.backend.auth; import com.fasterxml.jackson.databind.ObjectMapper; import com.numberone.backend.domain.member.entity.Member; diff --git a/src/main/java/com/numberone/backend/config/SecurityConfig.java b/daepiro-api/src/main/java/com/numberone/backend/auth/SecurityConfig.java similarity index 96% rename from src/main/java/com/numberone/backend/config/SecurityConfig.java rename to daepiro-api/src/main/java/com/numberone/backend/auth/SecurityConfig.java index e2eef9b7..5a55432c 100644 --- a/src/main/java/com/numberone/backend/config/SecurityConfig.java +++ b/daepiro-api/src/main/java/com/numberone/backend/auth/SecurityConfig.java @@ -1,6 +1,5 @@ -package com.numberone.backend.config; +package com.numberone.backend.auth; -import com.numberone.backend.config.auth.JwtFilter; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.context.annotation.Bean; diff --git a/src/main/java/com/numberone/backend/domain/admin/controller/AdminController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/admin/controller/AdminController.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/admin/controller/AdminController.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/admin/controller/AdminController.java diff --git a/src/main/java/com/numberone/backend/domain/admin/service/AdminService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/admin/service/AdminService.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/admin/service/AdminService.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/admin/service/AdminService.java diff --git a/src/main/java/com/numberone/backend/domain/article/controller/ArticleController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/article/controller/ArticleController.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/article/controller/ArticleController.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/article/controller/ArticleController.java diff --git a/src/main/java/com/numberone/backend/domain/article/service/ArticleService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/article/service/ArticleService.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/article/service/ArticleService.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/article/service/ArticleService.java diff --git a/src/main/java/com/numberone/backend/domain/comment/controller/CommentController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/comment/controller/CommentController.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/comment/controller/CommentController.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/comment/controller/CommentController.java diff --git a/src/main/java/com/numberone/backend/domain/comment/service/CommentService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/comment/service/CommentService.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/comment/service/CommentService.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/comment/service/CommentService.java diff --git a/src/main/java/com/numberone/backend/domain/conversation/controller/ConversationController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/conversation/controller/ConversationController.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/conversation/controller/ConversationController.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/conversation/controller/ConversationController.java diff --git a/src/main/java/com/numberone/backend/domain/conversation/service/ConversationService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/conversation/service/ConversationService.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/conversation/service/ConversationService.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/conversation/service/ConversationService.java diff --git a/src/main/java/com/numberone/backend/domain/disaster/controller/DisasterController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/controller/DisasterController.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/disaster/controller/DisasterController.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/disaster/controller/DisasterController.java diff --git a/src/main/java/com/numberone/backend/domain/disaster/event/DisasterEvent.java b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/event/DisasterEvent.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/disaster/event/DisasterEvent.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/disaster/event/DisasterEvent.java diff --git a/src/main/java/com/numberone/backend/domain/disaster/service/DisasterDataCollector.java b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterDataCollector.java similarity index 92% rename from src/main/java/com/numberone/backend/domain/disaster/service/DisasterDataCollector.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterDataCollector.java index 7352750e..beb14203 100644 --- a/src/main/java/com/numberone/backend/domain/disaster/service/DisasterDataCollector.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterDataCollector.java @@ -6,7 +6,6 @@ import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.numberone.backend.domain.disaster.dto.request.SaveDisasterRequest; import com.numberone.backend.domain.disaster.dto.response.DisasterDataResponse; -import com.numberone.backend.domain.disaster.entity.Disaster; import com.numberone.backend.domain.disaster.repository.DisasterRepository; import com.numberone.backend.domain.disaster.util.DisasterType; import com.numberone.backend.exception.notfound.NotFoundApiException; @@ -17,23 +16,14 @@ import lombok.extern.slf4j.Slf4j; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; -import org.jsoup.nodes.Element; import org.jsoup.select.Elements; -import org.springframework.context.ApplicationEventPublisher; -import org.springframework.http.*; -import org.springframework.http.converter.HttpMessageConverter; -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; -import org.springframework.http.converter.xml.Jaxb2RootElementHttpMessageConverter; import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; import org.springframework.web.client.RestTemplate; import org.springframework.web.util.UriComponentsBuilder; import java.io.IOException; import java.net.URI; -import java.time.LocalDateTime; import java.util.*; @Service diff --git a/src/main/java/com/numberone/backend/domain/disaster/service/DisasterEventHandler.java b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterEventHandler.java similarity index 99% rename from src/main/java/com/numberone/backend/domain/disaster/service/DisasterEventHandler.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterEventHandler.java index 68753ee1..28cf6092 100644 --- a/src/main/java/com/numberone/backend/domain/disaster/service/DisasterEventHandler.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterEventHandler.java @@ -16,7 +16,6 @@ import jakarta.transaction.Transactional; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.transaction.event.TransactionalEventListener; diff --git a/src/main/java/com/numberone/backend/domain/disaster/service/DisasterService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterService.java similarity index 99% rename from src/main/java/com/numberone/backend/domain/disaster/service/DisasterService.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterService.java index 8852475a..b7cae59a 100644 --- a/src/main/java/com/numberone/backend/domain/disaster/service/DisasterService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterService.java @@ -28,11 +28,9 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.awt.print.Pageable; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.*; -import java.util.stream.Collectors; @Service @RequiredArgsConstructor diff --git a/src/main/java/com/numberone/backend/domain/friendship/controller/FriendshipController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/friendship/controller/FriendshipController.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/friendship/controller/FriendshipController.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/friendship/controller/FriendshipController.java diff --git a/src/main/java/com/numberone/backend/domain/friendship/service/FriendshipService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/friendship/service/FriendshipService.java similarity index 98% rename from src/main/java/com/numberone/backend/domain/friendship/service/FriendshipService.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/friendship/service/FriendshipService.java index 988d78c9..d17fe1ec 100644 --- a/src/main/java/com/numberone/backend/domain/friendship/service/FriendshipService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/friendship/service/FriendshipService.java @@ -20,11 +20,8 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.ArrayList; import java.util.List; -import java.util.Set; import java.util.stream.Collectors; -import java.util.stream.Stream; @Slf4j @Service diff --git a/src/main/java/com/numberone/backend/domain/like/controller/LikeController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/like/controller/LikeController.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/like/controller/LikeController.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/like/controller/LikeController.java diff --git a/src/main/java/com/numberone/backend/domain/like/service/LikeService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/like/service/LikeService.java similarity index 98% rename from src/main/java/com/numberone/backend/domain/like/service/LikeService.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/like/service/LikeService.java index 0cd7e4df..ec8b757c 100644 --- a/src/main/java/com/numberone/backend/domain/like/service/LikeService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/like/service/LikeService.java @@ -22,14 +22,11 @@ import com.numberone.backend.support.fcm.service.FcmMessageProvider; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.hibernate.id.IntegralDataTypeHolder; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; -import static com.numberone.backend.support.notification.NotificationMessage.BEST_ARTICLE_FCM_ALARM; - @Slf4j @Service @RequiredArgsConstructor diff --git a/src/main/java/com/numberone/backend/domain/member/controller/MemberController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/member/controller/MemberController.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/member/controller/MemberController.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/member/controller/MemberController.java diff --git a/src/main/java/com/numberone/backend/domain/member/service/MemberService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/member/service/MemberService.java similarity index 99% rename from src/main/java/com/numberone/backend/domain/member/service/MemberService.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/member/service/MemberService.java index bf3ebb1c..10945891 100644 --- a/src/main/java/com/numberone/backend/domain/member/service/MemberService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/member/service/MemberService.java @@ -22,8 +22,6 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; -import java.util.List; - @RequiredArgsConstructor @Service @Slf4j diff --git a/src/main/java/com/numberone/backend/domain/notification/controller/NotificationController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/notification/controller/NotificationController.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/notification/controller/NotificationController.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/notification/controller/NotificationController.java diff --git a/src/main/java/com/numberone/backend/domain/notification/service/NotificationService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/notification/service/NotificationService.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/notification/service/NotificationService.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/notification/service/NotificationService.java diff --git a/src/main/java/com/numberone/backend/domain/shelter/controller/ShelterController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/shelter/controller/ShelterController.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/shelter/controller/ShelterController.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/shelter/controller/ShelterController.java diff --git a/src/main/java/com/numberone/backend/domain/shelter/service/ShelterService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/shelter/service/ShelterService.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/shelter/service/ShelterService.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/shelter/service/ShelterService.java diff --git a/src/main/java/com/numberone/backend/domain/sponsor/controller/SponsorController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/sponsor/controller/SponsorController.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/sponsor/controller/SponsorController.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/sponsor/controller/SponsorController.java diff --git a/src/main/java/com/numberone/backend/domain/sponsor/service/SponsorService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/sponsor/service/SponsorService.java similarity index 98% rename from src/main/java/com/numberone/backend/domain/sponsor/service/SponsorService.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/sponsor/service/SponsorService.java index 11eeb019..a8042e43 100644 --- a/src/main/java/com/numberone/backend/domain/sponsor/service/SponsorService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/sponsor/service/SponsorService.java @@ -11,7 +11,6 @@ import com.numberone.backend.exception.notfound.NotFoundMemberException; import com.numberone.backend.exception.notfound.NotFoundSponsorException; import lombok.RequiredArgsConstructor; -import org.apache.tomcat.util.net.openssl.ciphers.Authentication; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; diff --git a/src/main/java/com/numberone/backend/domain/support/controller/SupportController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/support/controller/SupportController.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/support/controller/SupportController.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/support/controller/SupportController.java diff --git a/src/main/java/com/numberone/backend/domain/support/service/SupportService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/support/service/SupportService.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/support/service/SupportService.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/support/service/SupportService.java diff --git a/src/main/java/com/numberone/backend/domain/token/controller/TokenController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/token/controller/TokenController.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/token/controller/TokenController.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/token/controller/TokenController.java diff --git a/src/main/java/com/numberone/backend/domain/token/service/TokenService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/token/service/TokenService.java similarity index 94% rename from src/main/java/com/numberone/backend/domain/token/service/TokenService.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/token/service/TokenService.java index 5b134faa..323d6623 100644 --- a/src/main/java/com/numberone/backend/domain/token/service/TokenService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/token/service/TokenService.java @@ -4,17 +4,19 @@ import com.numberone.backend.domain.member.service.MemberService; import com.numberone.backend.domain.token.dto.request.GetTokenRequest; import com.numberone.backend.domain.token.dto.request.RefreshTokenRequest; -import com.numberone.backend.domain.token.dto.response.*; +import com.numberone.backend.domain.token.dto.response.GetTokenResponse; +import com.numberone.backend.domain.token.dto.response.KakaoInfoResponse; +import com.numberone.backend.domain.token.dto.response.NaverInfoResponse; +import com.numberone.backend.domain.token.dto.response.RefreshTokenResponse; import com.numberone.backend.domain.token.entity.Token; import com.numberone.backend.domain.token.repository.TokenRepository; +import com.numberone.backend.domain.token.util.JwtUtil; import com.numberone.backend.exception.badrequest.BadRequestSocialTokenException; import com.numberone.backend.exception.forbidden.WrongAccessTokenException; import com.numberone.backend.exception.notfound.NotFoundRefreshTokenException; import com.numberone.backend.properties.KakaoProperties; import com.numberone.backend.properties.NaverProperties; -import com.numberone.backend.domain.token.util.JwtUtil; import com.numberone.backend.properties.TokenPeriodProperties; -import jakarta.annotation.PostConstruct; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.http.*; @@ -22,8 +24,6 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.web.client.RestTemplate; -import java.util.Optional; - @Service @RequiredArgsConstructor @Transactional(readOnly = true) @@ -105,4 +105,4 @@ private GetTokenResponse getTokenResponse(String email) { return GetTokenResponse.of(token.getAccessToken(), token.getRefreshToken(), isNewMember); } } -} +} \ No newline at end of file diff --git a/src/main/java/com/numberone/backend/support/fcm/dto/FcmNotificationDto.java b/daepiro-api/src/main/java/com/numberone/backend/support/fcm/dto/FcmNotificationDto.java similarity index 100% rename from src/main/java/com/numberone/backend/support/fcm/dto/FcmNotificationDto.java rename to daepiro-api/src/main/java/com/numberone/backend/support/fcm/dto/FcmNotificationDto.java diff --git a/src/main/java/com/numberone/backend/support/fcm/service/FcmMessageProvider.java b/daepiro-api/src/main/java/com/numberone/backend/support/fcm/service/FcmMessageProvider.java similarity index 100% rename from src/main/java/com/numberone/backend/support/fcm/service/FcmMessageProvider.java rename to daepiro-api/src/main/java/com/numberone/backend/support/fcm/service/FcmMessageProvider.java diff --git a/src/main/java/com/numberone/backend/support/logging/LogAspect.java b/daepiro-api/src/main/java/com/numberone/backend/support/logging/LogAspect.java similarity index 100% rename from src/main/java/com/numberone/backend/support/logging/LogAspect.java rename to daepiro-api/src/main/java/com/numberone/backend/support/logging/LogAspect.java diff --git a/src/main/java/com/numberone/backend/support/notification/NotificationMessage.java b/daepiro-api/src/main/java/com/numberone/backend/support/notification/NotificationMessage.java similarity index 100% rename from src/main/java/com/numberone/backend/support/notification/NotificationMessage.java rename to daepiro-api/src/main/java/com/numberone/backend/support/notification/NotificationMessage.java diff --git a/src/main/java/com/numberone/backend/support/notification/NotificationMessageSpec.java b/daepiro-api/src/main/java/com/numberone/backend/support/notification/NotificationMessageSpec.java similarity index 100% rename from src/main/java/com/numberone/backend/support/notification/NotificationMessageSpec.java rename to daepiro-api/src/main/java/com/numberone/backend/support/notification/NotificationMessageSpec.java diff --git a/src/main/java/com/numberone/backend/support/redis/like/repository/RedisLockRepository.java b/daepiro-api/src/main/java/com/numberone/backend/support/redis/like/repository/RedisLockRepository.java similarity index 100% rename from src/main/java/com/numberone/backend/support/redis/like/repository/RedisLockRepository.java rename to daepiro-api/src/main/java/com/numberone/backend/support/redis/like/repository/RedisLockRepository.java diff --git a/src/main/java/com/numberone/backend/support/redis/like/service/RedisLockLikeFacade.java b/daepiro-api/src/main/java/com/numberone/backend/support/redis/like/service/RedisLockLikeFacade.java similarity index 100% rename from src/main/java/com/numberone/backend/support/redis/like/service/RedisLockLikeFacade.java rename to daepiro-api/src/main/java/com/numberone/backend/support/redis/like/service/RedisLockLikeFacade.java diff --git a/src/main/java/com/numberone/backend/support/s3/S3Provider.java b/daepiro-api/src/main/java/com/numberone/backend/support/s3/S3Provider.java similarity index 100% rename from src/main/java/com/numberone/backend/support/s3/S3Provider.java rename to daepiro-api/src/main/java/com/numberone/backend/support/s3/S3Provider.java diff --git a/src/main/java/com/numberone/backend/util/LocationProvider.java b/daepiro-api/src/main/java/com/numberone/backend/util/LocationProvider.java similarity index 100% rename from src/main/java/com/numberone/backend/util/LocationProvider.java rename to daepiro-api/src/main/java/com/numberone/backend/util/LocationProvider.java diff --git a/src/main/java/com/numberone/backend/util/dto/MapApiResponse.java b/daepiro-api/src/main/java/com/numberone/backend/util/dto/MapApiResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/util/dto/MapApiResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/util/dto/MapApiResponse.java diff --git a/src/main/resources/logback-spring.xml b/daepiro-api/src/main/resources/logback-spring.xml similarity index 100% rename from src/main/resources/logback-spring.xml rename to daepiro-api/src/main/resources/logback-spring.xml diff --git a/src/test/java/com/numberone/backend/BackendApplicationTests.java b/daepiro-api/src/test/java/com/numberone/backend/BackendApplicationTests.java similarity index 100% rename from src/test/java/com/numberone/backend/BackendApplicationTests.java rename to daepiro-api/src/test/java/com/numberone/backend/BackendApplicationTests.java diff --git a/daepiro-common/build.gradle b/daepiro-common/build.gradle new file mode 100644 index 00000000..48f58ad2 --- /dev/null +++ b/daepiro-common/build.gradle @@ -0,0 +1,27 @@ +plugins { + id 'java' + id "java-library" + id "java-test-fixtures" +} + +dependencies { + implementation 'org.springframework.boot:spring-boot-starter-security' + implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-validation' + + // swagger + implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2' + + implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE' + + // aop + implementation 'org.springframework.boot:spring-boot-starter-aop' + + // fcm + implementation 'com.google.firebase:firebase-admin:9.1.1' +} + +tasks.bootJar { + enabled = false +} + diff --git a/src/main/java/com/numberone/backend/config/AspectConfig.java b/daepiro-common/src/main/java/com/numberone/backend/config/AspectConfig.java similarity index 100% rename from src/main/java/com/numberone/backend/config/AspectConfig.java rename to daepiro-common/src/main/java/com/numberone/backend/config/AspectConfig.java diff --git a/src/main/java/com/numberone/backend/config/FirebaseConfig.java b/daepiro-common/src/main/java/com/numberone/backend/config/FirebaseConfig.java similarity index 100% rename from src/main/java/com/numberone/backend/config/FirebaseConfig.java rename to daepiro-common/src/main/java/com/numberone/backend/config/FirebaseConfig.java diff --git a/src/main/java/com/numberone/backend/config/RestTemplateConfig.java b/daepiro-common/src/main/java/com/numberone/backend/config/RestTemplateConfig.java similarity index 100% rename from src/main/java/com/numberone/backend/config/RestTemplateConfig.java rename to daepiro-common/src/main/java/com/numberone/backend/config/RestTemplateConfig.java diff --git a/src/main/java/com/numberone/backend/config/S3Config.java b/daepiro-common/src/main/java/com/numberone/backend/config/S3Config.java similarity index 100% rename from src/main/java/com/numberone/backend/config/S3Config.java rename to daepiro-common/src/main/java/com/numberone/backend/config/S3Config.java diff --git a/src/main/java/com/numberone/backend/config/SchedulingConfig.java b/daepiro-common/src/main/java/com/numberone/backend/config/SchedulingConfig.java similarity index 100% rename from src/main/java/com/numberone/backend/config/SchedulingConfig.java rename to daepiro-common/src/main/java/com/numberone/backend/config/SchedulingConfig.java diff --git a/src/main/java/com/numberone/backend/config/SwaggerConfig.java b/daepiro-common/src/main/java/com/numberone/backend/config/SwaggerConfig.java similarity index 100% rename from src/main/java/com/numberone/backend/config/SwaggerConfig.java rename to daepiro-common/src/main/java/com/numberone/backend/config/SwaggerConfig.java diff --git a/src/main/java/com/numberone/backend/exception/GlobalExceptionHandler.java b/daepiro-common/src/main/java/com/numberone/backend/exception/GlobalExceptionHandler.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/GlobalExceptionHandler.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/GlobalExceptionHandler.java diff --git a/src/main/java/com/numberone/backend/exception/NumberOneException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/NumberOneException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/NumberOneException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/NumberOneException.java diff --git a/src/main/java/com/numberone/backend/exception/badrequest/BadRequestConversationSortException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/BadRequestConversationSortException.java similarity index 83% rename from src/main/java/com/numberone/backend/exception/badrequest/BadRequestConversationSortException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/BadRequestConversationSortException.java index e86bba4b..51dd3ffb 100644 --- a/src/main/java/com/numberone/backend/exception/badrequest/BadRequestConversationSortException.java +++ b/daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/BadRequestConversationSortException.java @@ -1,7 +1,5 @@ package com.numberone.backend.exception.badrequest; -import com.numberone.backend.exception.context.ExceptionContext; - import static com.numberone.backend.exception.context.CustomExceptionContext.BAD_REQUEST_CONVERSATION_SORT; public class BadRequestConversationSortException extends BadRequestException{ diff --git a/src/main/java/com/numberone/backend/exception/badrequest/BadRequestException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/BadRequestException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/badrequest/BadRequestException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/BadRequestException.java index 51307f97..ffc6c987 100644 --- a/src/main/java/com/numberone/backend/exception/badrequest/BadRequestException.java +++ b/daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/BadRequestException.java @@ -1,7 +1,7 @@ package com.numberone.backend.exception.badrequest; -import com.numberone.backend.exception.context.ExceptionContext; import com.numberone.backend.exception.NumberOneException; +import com.numberone.backend.exception.context.ExceptionContext; import lombok.Getter; import org.springframework.http.HttpStatus; diff --git a/src/main/java/com/numberone/backend/exception/badrequest/BadRequestHeartException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/BadRequestHeartException.java similarity index 81% rename from src/main/java/com/numberone/backend/exception/badrequest/BadRequestHeartException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/BadRequestHeartException.java index 14dc35f5..2ca65186 100644 --- a/src/main/java/com/numberone/backend/exception/badrequest/BadRequestHeartException.java +++ b/daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/BadRequestHeartException.java @@ -1,7 +1,5 @@ package com.numberone.backend.exception.badrequest; -import com.numberone.backend.exception.context.ExceptionContext; - import static com.numberone.backend.exception.context.CustomExceptionContext.BAD_REQUEST_HEART; public class BadRequestHeartException extends BadRequestException{ diff --git a/src/main/java/com/numberone/backend/exception/badrequest/BadRequestSocialTokenException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/BadRequestSocialTokenException.java similarity index 83% rename from src/main/java/com/numberone/backend/exception/badrequest/BadRequestSocialTokenException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/BadRequestSocialTokenException.java index a78ebfe3..75549086 100644 --- a/src/main/java/com/numberone/backend/exception/badrequest/BadRequestSocialTokenException.java +++ b/daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/BadRequestSocialTokenException.java @@ -1,7 +1,5 @@ package com.numberone.backend.exception.badrequest; -import com.numberone.backend.exception.context.ExceptionContext; - import static com.numberone.backend.exception.context.CustomExceptionContext.BAD_REQUEST_SOCIAL_TOKEN; public class BadRequestSocialTokenException extends BadRequestException{ diff --git a/src/main/java/com/numberone/backend/exception/badrequest/BadUserAuthenticationException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/BadUserAuthenticationException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/badrequest/BadUserAuthenticationException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/BadUserAuthenticationException.java diff --git a/src/main/java/com/numberone/backend/exception/badrequest/FileMissingException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/FileMissingException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/badrequest/FileMissingException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/FileMissingException.java diff --git a/src/main/java/com/numberone/backend/exception/badrequest/FileUploadException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/FileUploadException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/badrequest/FileUploadException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/FileUploadException.java diff --git a/src/main/java/com/numberone/backend/exception/badrequest/InvalidDisasterTypeException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/InvalidDisasterTypeException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/badrequest/InvalidDisasterTypeException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/InvalidDisasterTypeException.java diff --git a/src/main/java/com/numberone/backend/exception/badrequest/InvalidInviteTypeException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/InvalidInviteTypeException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/badrequest/InvalidInviteTypeException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/InvalidInviteTypeException.java diff --git a/src/main/java/com/numberone/backend/exception/badrequest/InvalidShelterTypeException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/InvalidShelterTypeException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/badrequest/InvalidShelterTypeException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/badrequest/InvalidShelterTypeException.java diff --git a/src/main/java/com/numberone/backend/exception/conflict/AlreadyLikedException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/conflict/AlreadyLikedException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/conflict/AlreadyLikedException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/conflict/AlreadyLikedException.java diff --git a/src/main/java/com/numberone/backend/exception/conflict/AlreadyUnLikedException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/conflict/AlreadyUnLikedException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/conflict/AlreadyUnLikedException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/conflict/AlreadyUnLikedException.java diff --git a/src/main/java/com/numberone/backend/exception/conflict/ConflictException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/conflict/ConflictException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/conflict/ConflictException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/conflict/ConflictException.java diff --git a/src/main/java/com/numberone/backend/exception/conflict/FirebaseInitializationException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/conflict/FirebaseInitializationException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/conflict/FirebaseInitializationException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/conflict/FirebaseInitializationException.java diff --git a/src/main/java/com/numberone/backend/exception/conflict/FirebaseMessageSendException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/conflict/FirebaseMessageSendException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/conflict/FirebaseMessageSendException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/conflict/FirebaseMessageSendException.java diff --git a/src/main/java/com/numberone/backend/exception/conflict/UnauthorizedLocationException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/conflict/UnauthorizedLocationException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/conflict/UnauthorizedLocationException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/conflict/UnauthorizedLocationException.java diff --git a/src/main/java/com/numberone/backend/exception/context/CustomExceptionContext.java b/daepiro-common/src/main/java/com/numberone/backend/exception/context/CustomExceptionContext.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/context/CustomExceptionContext.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/context/CustomExceptionContext.java diff --git a/src/main/java/com/numberone/backend/exception/context/ExceptionContext.java b/daepiro-common/src/main/java/com/numberone/backend/exception/context/ExceptionContext.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/context/ExceptionContext.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/context/ExceptionContext.java diff --git a/src/main/java/com/numberone/backend/exception/dto/ErrorResponse.java b/daepiro-common/src/main/java/com/numberone/backend/exception/dto/ErrorResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/dto/ErrorResponse.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/dto/ErrorResponse.java diff --git a/src/main/java/com/numberone/backend/exception/forbidden/ExpiredAccessTokenException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/forbidden/ExpiredAccessTokenException.java similarity index 82% rename from src/main/java/com/numberone/backend/exception/forbidden/ExpiredAccessTokenException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/forbidden/ExpiredAccessTokenException.java index ad7b8ee3..ade0d66b 100644 --- a/src/main/java/com/numberone/backend/exception/forbidden/ExpiredAccessTokenException.java +++ b/daepiro-common/src/main/java/com/numberone/backend/exception/forbidden/ExpiredAccessTokenException.java @@ -1,7 +1,5 @@ package com.numberone.backend.exception.forbidden; -import com.numberone.backend.exception.context.ExceptionContext; - import static com.numberone.backend.exception.context.CustomExceptionContext.EXPIRED_ACCESS_TOKEN; public class ExpiredAccessTokenException extends ForbiddenException{ diff --git a/src/main/java/com/numberone/backend/exception/forbidden/ForbiddenException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/forbidden/ForbiddenException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/forbidden/ForbiddenException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/forbidden/ForbiddenException.java diff --git a/src/main/java/com/numberone/backend/exception/forbidden/WrongAccessTokenException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/forbidden/WrongAccessTokenException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/forbidden/WrongAccessTokenException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/forbidden/WrongAccessTokenException.java diff --git a/src/main/java/com/numberone/backend/exception/notfound/NotFoundApiException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundApiException.java similarity index 80% rename from src/main/java/com/numberone/backend/exception/notfound/NotFoundApiException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundApiException.java index 565ca7da..313d4cc8 100644 --- a/src/main/java/com/numberone/backend/exception/notfound/NotFoundApiException.java +++ b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundApiException.java @@ -1,7 +1,5 @@ package com.numberone.backend.exception.notfound; -import com.numberone.backend.exception.context.ExceptionContext; - import static com.numberone.backend.exception.context.CustomExceptionContext.NOT_FOUND_API; public class NotFoundApiException extends NotFoundException { diff --git a/src/main/java/com/numberone/backend/exception/notfound/NotFoundArticleException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundArticleException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/notfound/NotFoundArticleException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundArticleException.java diff --git a/src/main/java/com/numberone/backend/exception/notfound/NotFoundArticleImageException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundArticleImageException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/notfound/NotFoundArticleImageException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundArticleImageException.java diff --git a/src/main/java/com/numberone/backend/exception/notfound/NotFoundCommentException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundCommentException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/notfound/NotFoundCommentException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundCommentException.java diff --git a/src/main/java/com/numberone/backend/exception/notfound/NotFoundConversationException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundConversationException.java similarity index 82% rename from src/main/java/com/numberone/backend/exception/notfound/NotFoundConversationException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundConversationException.java index 8ca37e93..a9cc455f 100644 --- a/src/main/java/com/numberone/backend/exception/notfound/NotFoundConversationException.java +++ b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundConversationException.java @@ -1,7 +1,5 @@ package com.numberone.backend.exception.notfound; -import com.numberone.backend.exception.context.ExceptionContext; - import static com.numberone.backend.exception.context.CustomExceptionContext.NOT_FOUND_CONVERSATION; public class NotFoundConversationException extends NotFoundException { diff --git a/src/main/java/com/numberone/backend/exception/notfound/NotFoundCrawlingException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundCrawlingException.java similarity index 81% rename from src/main/java/com/numberone/backend/exception/notfound/NotFoundCrawlingException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundCrawlingException.java index 9bf2a9ad..0552a4af 100644 --- a/src/main/java/com/numberone/backend/exception/notfound/NotFoundCrawlingException.java +++ b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundCrawlingException.java @@ -1,7 +1,5 @@ package com.numberone.backend.exception.notfound; -import com.numberone.backend.exception.context.ExceptionContext; - import static com.numberone.backend.exception.context.CustomExceptionContext.NOT_FOUND_CRAWLING; public class NotFoundCrawlingException extends NotFoundException { diff --git a/src/main/java/com/numberone/backend/exception/notfound/NotFoundDisasterException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundDisasterException.java similarity index 81% rename from src/main/java/com/numberone/backend/exception/notfound/NotFoundDisasterException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundDisasterException.java index c58872f1..91d3595f 100644 --- a/src/main/java/com/numberone/backend/exception/notfound/NotFoundDisasterException.java +++ b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundDisasterException.java @@ -1,7 +1,5 @@ package com.numberone.backend.exception.notfound; -import com.numberone.backend.exception.context.ExceptionContext; - import static com.numberone.backend.exception.context.CustomExceptionContext.NOT_FOUND_DISASTER; public class NotFoundDisasterException extends NotFoundException { diff --git a/src/main/java/com/numberone/backend/exception/notfound/NotFoundException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/notfound/NotFoundException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundException.java index ce72f7cc..41e0d071 100644 --- a/src/main/java/com/numberone/backend/exception/notfound/NotFoundException.java +++ b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundException.java @@ -1,7 +1,7 @@ package com.numberone.backend.exception.notfound; -import com.numberone.backend.exception.context.ExceptionContext; import com.numberone.backend.exception.NumberOneException; +import com.numberone.backend.exception.context.ExceptionContext; import lombok.Getter; import org.springframework.http.HttpStatus; diff --git a/src/main/java/com/numberone/backend/exception/notfound/NotFoundFriendshipException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundFriendshipException.java similarity index 82% rename from src/main/java/com/numberone/backend/exception/notfound/NotFoundFriendshipException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundFriendshipException.java index 63d5f6b6..adeab696 100644 --- a/src/main/java/com/numberone/backend/exception/notfound/NotFoundFriendshipException.java +++ b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundFriendshipException.java @@ -1,7 +1,5 @@ package com.numberone.backend.exception.notfound; -import com.numberone.backend.exception.context.ExceptionContext; - import static com.numberone.backend.exception.context.CustomExceptionContext.NOT_FOUND_FRIENDSHIP; public class NotFoundFriendshipException extends NotFoundException { diff --git a/src/main/java/com/numberone/backend/exception/notfound/NotFoundMemberException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundMemberException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/notfound/NotFoundMemberException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundMemberException.java diff --git a/src/main/java/com/numberone/backend/exception/notfound/NotFoundRefreshTokenException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundRefreshTokenException.java similarity index 81% rename from src/main/java/com/numberone/backend/exception/notfound/NotFoundRefreshTokenException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundRefreshTokenException.java index 85958b7e..ad057c7b 100644 --- a/src/main/java/com/numberone/backend/exception/notfound/NotFoundRefreshTokenException.java +++ b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundRefreshTokenException.java @@ -1,7 +1,5 @@ package com.numberone.backend.exception.notfound; -import com.numberone.backend.exception.forbidden.ForbiddenException; - import static com.numberone.backend.exception.context.CustomExceptionContext.WRONG_REFRESH_TOKEN; public class NotFoundRefreshTokenException extends NotFoundException { diff --git a/src/main/java/com/numberone/backend/exception/notfound/NotFoundShelterException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundShelterException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/notfound/NotFoundShelterException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundShelterException.java diff --git a/src/main/java/com/numberone/backend/exception/notfound/NotFoundSponsorException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundSponsorException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/notfound/NotFoundSponsorException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundSponsorException.java diff --git a/src/main/java/com/numberone/backend/exception/notfound/NotFoundSupportException.java b/daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundSupportException.java similarity index 100% rename from src/main/java/com/numberone/backend/exception/notfound/NotFoundSupportException.java rename to daepiro-common/src/main/java/com/numberone/backend/exception/notfound/NotFoundSupportException.java diff --git a/daepiro-core/build.gradle b/daepiro-core/build.gradle new file mode 100644 index 00000000..08b8ca09 --- /dev/null +++ b/daepiro-core/build.gradle @@ -0,0 +1,91 @@ + +plugins { + id 'java' + id "com.ewerk.gradle.plugins.querydsl" version "1.0.10" + id "java-library" + id "java-test-fixtures" + id "maven-publish" +} + +configurations { + querydsl.extendsFrom compileClasspath +} + +dependencies { + implementation project(':daepiro-common') + + implementation 'org.springframework.boot:spring-boot-starter-security' + implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-validation' + + // swagger + implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2' + + // jpa + implementation 'org.springframework.boot:spring-boot-starter-data-jpa' + + ///////// query dsl //////////// + implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta' + annotationProcessor 'com.querydsl:querydsl-apt:5.0.0:jakarta' + annotationProcessor "jakarta.annotation:jakarta.annotation-api" + annotationProcessor "jakarta.persistence:jakarta.persistence-api" + + implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.5.8' + + annotationProcessor "jakarta.annotation:jakarta.annotation-api" + annotationProcessor "jakarta.persistence:jakarta.persistence-api" + annotationProcessor 'org.projectlombok:lombok' + + compileOnly 'org.projectlombok:lombok' + + runtimeOnly 'com.h2database:h2' + runtimeOnly 'com.mysql:mysql-connector-j' + + + testImplementation 'org.springframework.boot:spring-boot-starter-test' + testImplementation 'org.springframework.security:spring-security-test' + + implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' + implementation 'org.springframework.boot:spring-boot-starter-data-redis' + + implementation 'io.jsonwebtoken:jjwt:0.9.1' + implementation 'com.sun.xml.bind:jaxb-impl:4.0.1' + implementation 'com.sun.xml.bind:jaxb-core:4.0.1' + implementation 'javax.xml.bind:jaxb-api:2.4.0-b180830.0359' + implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' + + // cloud + implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE' + + // aop + implementation 'org.springframework.boot:spring-boot-starter-aop' + + //crawling + implementation 'com.squareup.okhttp3:okhttp:4.9.1' + implementation 'org.jsoup:jsoup:1.14.2' + implementation 'net.sourceforge.htmlunit:htmlunit:2.70.0' + + //geocoding + implementation 'com.google.code.geocoder-java:geocoder-java:0.16' + // fcm + implementation 'com.google.firebase:firebase-admin:9.1.1' +} + +def querydslDir = "$buildDir/generated/querydsl" + +querydsl { + jpa = true + querydslSourcesDir = querydslDir +} + +sourceSets { + main.java.srcDir querydslDir +} + +compileQuerydsl { + options.annotationProcessorPath = configurations.querydsl +} + +tasks.named('test') { + useJUnitPlatform() +} \ No newline at end of file diff --git a/src/main/java/com/numberone/backend/config/P6spyLogMessageFormatConfiguration.java b/daepiro-core/src/main/java/com/numberone/backend/config/P6spyLogMessageFormatConfiguration.java similarity index 100% rename from src/main/java/com/numberone/backend/config/P6spyLogMessageFormatConfiguration.java rename to daepiro-core/src/main/java/com/numberone/backend/config/P6spyLogMessageFormatConfiguration.java diff --git a/src/main/java/com/numberone/backend/config/P6spySqlFormatConfiguration.java b/daepiro-core/src/main/java/com/numberone/backend/config/P6spySqlFormatConfiguration.java similarity index 100% rename from src/main/java/com/numberone/backend/config/P6spySqlFormatConfiguration.java rename to daepiro-core/src/main/java/com/numberone/backend/config/P6spySqlFormatConfiguration.java diff --git a/src/main/java/com/numberone/backend/config/RedisConfig.java b/daepiro-core/src/main/java/com/numberone/backend/config/RedisConfig.java similarity index 93% rename from src/main/java/com/numberone/backend/config/RedisConfig.java rename to daepiro-core/src/main/java/com/numberone/backend/config/RedisConfig.java index 5c8c7ea8..8a37a980 100644 --- a/src/main/java/com/numberone/backend/config/RedisConfig.java +++ b/daepiro-core/src/main/java/com/numberone/backend/config/RedisConfig.java @@ -7,7 +7,6 @@ import org.springframework.data.redis.connection.RedisConnectionFactory; import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.data.redis.serializer.StringRedisSerializer; @Configuration @RequiredArgsConstructor diff --git a/src/main/java/com/numberone/backend/config/basetime/BaseTimeConfig.java b/daepiro-core/src/main/java/com/numberone/backend/config/basetime/BaseTimeConfig.java similarity index 100% rename from src/main/java/com/numberone/backend/config/basetime/BaseTimeConfig.java rename to daepiro-core/src/main/java/com/numberone/backend/config/basetime/BaseTimeConfig.java diff --git a/src/main/java/com/numberone/backend/config/basetime/BaseTimeEntity.java b/daepiro-core/src/main/java/com/numberone/backend/config/basetime/BaseTimeEntity.java similarity index 100% rename from src/main/java/com/numberone/backend/config/basetime/BaseTimeEntity.java rename to daepiro-core/src/main/java/com/numberone/backend/config/basetime/BaseTimeEntity.java diff --git a/src/main/java/com/numberone/backend/domain/admin/dto/request/CreateDisasterEventDto.java b/daepiro-core/src/main/java/com/numberone/backend/domain/admin/dto/request/CreateDisasterEventDto.java similarity index 74% rename from src/main/java/com/numberone/backend/domain/admin/dto/request/CreateDisasterEventDto.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/admin/dto/request/CreateDisasterEventDto.java index 8c09a02d..087097ee 100644 --- a/src/main/java/com/numberone/backend/domain/admin/dto/request/CreateDisasterEventDto.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/admin/dto/request/CreateDisasterEventDto.java @@ -1,7 +1,10 @@ package com.numberone.backend.domain.admin.dto.request; import com.numberone.backend.domain.disaster.util.DisasterType; -import lombok.*; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.ToString; @ToString @Getter diff --git a/src/main/java/com/numberone/backend/domain/admin/dto/response/GetAddressResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/admin/dto/response/GetAddressResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/admin/dto/response/GetAddressResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/admin/dto/response/GetAddressResponse.java diff --git a/src/main/java/com/numberone/backend/domain/article/dto/request/ModifyArticleRequest.java b/daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/request/ModifyArticleRequest.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/article/dto/request/ModifyArticleRequest.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/request/ModifyArticleRequest.java diff --git a/src/main/java/com/numberone/backend/domain/article/dto/request/UploadArticleRequest.java b/daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/request/UploadArticleRequest.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/article/dto/request/UploadArticleRequest.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/request/UploadArticleRequest.java diff --git a/src/main/java/com/numberone/backend/domain/article/dto/response/ArticleSearchParameter.java b/daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/response/ArticleSearchParameter.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/article/dto/response/ArticleSearchParameter.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/response/ArticleSearchParameter.java diff --git a/src/main/java/com/numberone/backend/domain/article/dto/response/DeleteArticleResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/response/DeleteArticleResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/article/dto/response/DeleteArticleResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/response/DeleteArticleResponse.java diff --git a/src/main/java/com/numberone/backend/domain/article/dto/response/GetArticleDetailResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/response/GetArticleDetailResponse.java similarity index 97% rename from src/main/java/com/numberone/backend/domain/article/dto/response/GetArticleDetailResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/response/GetArticleDetailResponse.java index 8b8ca343..b8e41df7 100644 --- a/src/main/java/com/numberone/backend/domain/article/dto/response/GetArticleDetailResponse.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/response/GetArticleDetailResponse.java @@ -2,7 +2,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.numberone.backend.domain.article.entity.Article; -import com.numberone.backend.domain.article.entity.ArticleStatus; import com.numberone.backend.domain.article.entity.ArticleTag; import com.numberone.backend.domain.member.entity.Member; import lombok.*; diff --git a/src/main/java/com/numberone/backend/domain/article/dto/response/GetArticleListResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/response/GetArticleListResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/article/dto/response/GetArticleListResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/response/GetArticleListResponse.java diff --git a/src/main/java/com/numberone/backend/domain/article/dto/response/ModifyArticleResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/response/ModifyArticleResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/article/dto/response/ModifyArticleResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/response/ModifyArticleResponse.java diff --git a/src/main/java/com/numberone/backend/domain/article/dto/response/UploadArticleResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/response/UploadArticleResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/article/dto/response/UploadArticleResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/response/UploadArticleResponse.java diff --git a/src/main/java/com/numberone/backend/domain/article/entity/Article.java b/daepiro-core/src/main/java/com/numberone/backend/domain/article/entity/Article.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/article/entity/Article.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/article/entity/Article.java diff --git a/src/main/java/com/numberone/backend/domain/article/entity/ArticleStatus.java b/daepiro-core/src/main/java/com/numberone/backend/domain/article/entity/ArticleStatus.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/article/entity/ArticleStatus.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/article/entity/ArticleStatus.java diff --git a/src/main/java/com/numberone/backend/domain/article/entity/ArticleTag.java b/daepiro-core/src/main/java/com/numberone/backend/domain/article/entity/ArticleTag.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/article/entity/ArticleTag.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/article/entity/ArticleTag.java diff --git a/src/main/java/com/numberone/backend/domain/article/repository/ArticleRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/article/repository/ArticleRepository.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/article/repository/ArticleRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/article/repository/ArticleRepository.java diff --git a/src/main/java/com/numberone/backend/domain/article/repository/custom/ArticleRepositoryCustom.java b/daepiro-core/src/main/java/com/numberone/backend/domain/article/repository/custom/ArticleRepositoryCustom.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/article/repository/custom/ArticleRepositoryCustom.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/article/repository/custom/ArticleRepositoryCustom.java diff --git a/src/main/java/com/numberone/backend/domain/article/repository/custom/ArticleRepositoryCustomImpl.java b/daepiro-core/src/main/java/com/numberone/backend/domain/article/repository/custom/ArticleRepositoryCustomImpl.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/article/repository/custom/ArticleRepositoryCustomImpl.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/article/repository/custom/ArticleRepositoryCustomImpl.java diff --git a/src/main/java/com/numberone/backend/domain/articleimage/entity/ArticleImage.java b/daepiro-core/src/main/java/com/numberone/backend/domain/articleimage/entity/ArticleImage.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/articleimage/entity/ArticleImage.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/articleimage/entity/ArticleImage.java diff --git a/src/main/java/com/numberone/backend/domain/articleimage/repository/ArticleImageRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/articleimage/repository/ArticleImageRepository.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/articleimage/repository/ArticleImageRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/articleimage/repository/ArticleImageRepository.java diff --git a/src/main/java/com/numberone/backend/domain/articleparticipant/entity/ArticleParticipant.java b/daepiro-core/src/main/java/com/numberone/backend/domain/articleparticipant/entity/ArticleParticipant.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/articleparticipant/entity/ArticleParticipant.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/articleparticipant/entity/ArticleParticipant.java diff --git a/src/main/java/com/numberone/backend/domain/articleparticipant/repository/ArticleParticipantRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/articleparticipant/repository/ArticleParticipantRepository.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/articleparticipant/repository/ArticleParticipantRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/articleparticipant/repository/ArticleParticipantRepository.java diff --git a/src/main/java/com/numberone/backend/domain/comment/dto/request/CreateChildCommentRequest.java b/daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/request/CreateChildCommentRequest.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/comment/dto/request/CreateChildCommentRequest.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/request/CreateChildCommentRequest.java diff --git a/src/main/java/com/numberone/backend/domain/comment/dto/request/CreateCommentRequest.java b/daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/request/CreateCommentRequest.java similarity index 85% rename from src/main/java/com/numberone/backend/domain/comment/dto/request/CreateCommentRequest.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/request/CreateCommentRequest.java index 057e6a72..80909822 100644 --- a/src/main/java/com/numberone/backend/domain/comment/dto/request/CreateCommentRequest.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/request/CreateCommentRequest.java @@ -1,6 +1,5 @@ package com.numberone.backend.domain.comment.dto.request; -import com.numberone.backend.config.basetime.BaseTimeEntity; import jakarta.validation.constraints.NotNull; import lombok.*; diff --git a/src/main/java/com/numberone/backend/domain/comment/dto/response/CreateChildCommentResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/response/CreateChildCommentResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/comment/dto/response/CreateChildCommentResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/response/CreateChildCommentResponse.java diff --git a/src/main/java/com/numberone/backend/domain/comment/dto/response/CreateCommentResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/response/CreateCommentResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/comment/dto/response/CreateCommentResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/response/CreateCommentResponse.java diff --git a/src/main/java/com/numberone/backend/domain/comment/dto/response/DeleteCommentResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/response/DeleteCommentResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/comment/dto/response/DeleteCommentResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/response/DeleteCommentResponse.java diff --git a/src/main/java/com/numberone/backend/domain/comment/dto/response/GetCommentDto.java b/daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/response/GetCommentDto.java similarity index 97% rename from src/main/java/com/numberone/backend/domain/comment/dto/response/GetCommentDto.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/response/GetCommentDto.java index 30bafbc0..91cf25fd 100644 --- a/src/main/java/com/numberone/backend/domain/comment/dto/response/GetCommentDto.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/response/GetCommentDto.java @@ -1,7 +1,6 @@ package com.numberone.backend.domain.comment.dto.response; import com.fasterxml.jackson.annotation.JsonFormat; -import com.numberone.backend.domain.article.entity.Article; import com.numberone.backend.domain.comment.entity.CommentEntity; import com.numberone.backend.domain.member.entity.Member; import com.querydsl.core.annotations.QueryProjection; diff --git a/src/main/java/com/numberone/backend/domain/comment/entity/CommentEntity.java b/daepiro-core/src/main/java/com/numberone/backend/domain/comment/entity/CommentEntity.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/comment/entity/CommentEntity.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/comment/entity/CommentEntity.java diff --git a/src/main/java/com/numberone/backend/domain/comment/repository/CommentRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/comment/repository/CommentRepository.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/comment/repository/CommentRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/comment/repository/CommentRepository.java diff --git a/src/main/java/com/numberone/backend/domain/comment/repository/custom/CommentRepositoryCustom.java b/daepiro-core/src/main/java/com/numberone/backend/domain/comment/repository/custom/CommentRepositoryCustom.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/comment/repository/custom/CommentRepositoryCustom.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/comment/repository/custom/CommentRepositoryCustom.java diff --git a/src/main/java/com/numberone/backend/domain/comment/repository/custom/CommentRepositoryCustomImpl.java b/daepiro-core/src/main/java/com/numberone/backend/domain/comment/repository/custom/CommentRepositoryCustomImpl.java similarity index 96% rename from src/main/java/com/numberone/backend/domain/comment/repository/custom/CommentRepositoryCustomImpl.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/comment/repository/custom/CommentRepositoryCustomImpl.java index ce15479f..fdba3981 100644 --- a/src/main/java/com/numberone/backend/domain/comment/repository/custom/CommentRepositoryCustomImpl.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/comment/repository/custom/CommentRepositoryCustomImpl.java @@ -1,6 +1,5 @@ package com.numberone.backend.domain.comment.repository.custom; -import com.numberone.backend.domain.article.entity.QArticle; import com.numberone.backend.domain.comment.dto.response.GetCommentDto; import com.numberone.backend.domain.comment.dto.response.QGetCommentDto; import com.querydsl.jpa.impl.JPAQueryFactory; diff --git a/src/main/java/com/numberone/backend/domain/conversation/dto/request/CreateChildConversationRequest.java b/daepiro-core/src/main/java/com/numberone/backend/domain/conversation/dto/request/CreateChildConversationRequest.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/conversation/dto/request/CreateChildConversationRequest.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/conversation/dto/request/CreateChildConversationRequest.java diff --git a/src/main/java/com/numberone/backend/domain/conversation/dto/request/CreateConversationRequest.java b/daepiro-core/src/main/java/com/numberone/backend/domain/conversation/dto/request/CreateConversationRequest.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/conversation/dto/request/CreateConversationRequest.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/conversation/dto/request/CreateConversationRequest.java diff --git a/src/main/java/com/numberone/backend/domain/conversation/dto/response/GetConversationResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/conversation/dto/response/GetConversationResponse.java similarity index 98% rename from src/main/java/com/numberone/backend/domain/conversation/dto/response/GetConversationResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/conversation/dto/response/GetConversationResponse.java index 42b1d661..5e709181 100644 --- a/src/main/java/com/numberone/backend/domain/conversation/dto/response/GetConversationResponse.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/conversation/dto/response/GetConversationResponse.java @@ -7,7 +7,6 @@ import java.time.Duration; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; -import java.util.ArrayList; import java.util.List; import java.util.Locale; diff --git a/src/main/java/com/numberone/backend/domain/conversation/entity/Conversation.java b/daepiro-core/src/main/java/com/numberone/backend/domain/conversation/entity/Conversation.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/conversation/entity/Conversation.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/conversation/entity/Conversation.java diff --git a/src/main/java/com/numberone/backend/domain/conversation/repository/ConversationRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/conversation/repository/ConversationRepository.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/conversation/repository/ConversationRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/conversation/repository/ConversationRepository.java diff --git a/src/main/java/com/numberone/backend/domain/disaster/dto/request/LatestDisasterRequest.java b/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/request/LatestDisasterRequest.java similarity index 71% rename from src/main/java/com/numberone/backend/domain/disaster/dto/request/LatestDisasterRequest.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/request/LatestDisasterRequest.java index e9269d00..6bea9029 100644 --- a/src/main/java/com/numberone/backend/domain/disaster/dto/request/LatestDisasterRequest.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/request/LatestDisasterRequest.java @@ -1,12 +1,8 @@ package com.numberone.backend.domain.disaster.dto.request; -import com.numberone.backend.domain.disaster.dto.response.LatestDisasterResponse; -import com.numberone.backend.domain.disaster.entity.Disaster; -import com.numberone.backend.domain.disaster.util.DisasterType; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; import lombok.AccessLevel; -import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/src/main/java/com/numberone/backend/domain/disaster/dto/request/SaveDisasterRequest.java b/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/request/SaveDisasterRequest.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/disaster/dto/request/SaveDisasterRequest.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/request/SaveDisasterRequest.java diff --git a/src/main/java/com/numberone/backend/domain/disaster/dto/response/DisasterDataResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/response/DisasterDataResponse.java similarity index 99% rename from src/main/java/com/numberone/backend/domain/disaster/dto/response/DisasterDataResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/response/DisasterDataResponse.java index db12e376..7428451b 100644 --- a/src/main/java/com/numberone/backend/domain/disaster/dto/response/DisasterDataResponse.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/response/DisasterDataResponse.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AccessLevel; -import lombok.Data; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/src/main/java/com/numberone/backend/domain/disaster/dto/response/LatestDisasterResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/response/LatestDisasterResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/disaster/dto/response/LatestDisasterResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/response/LatestDisasterResponse.java diff --git a/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationDetailResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationDetailResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationDetailResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationDetailResponse.java diff --git a/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationHomeResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationHomeResponse.java similarity index 85% rename from src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationHomeResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationHomeResponse.java index c66702cd..83a92a7a 100644 --- a/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationHomeResponse.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationHomeResponse.java @@ -1,6 +1,5 @@ package com.numberone.backend.domain.disaster.dto.response; -import com.numberone.backend.domain.conversation.dto.response.GetConversationResponse; import lombok.*; import java.util.ArrayList; diff --git a/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationResponse.java similarity index 97% rename from src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationResponse.java index bf792afd..6cde2394 100644 --- a/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationResponse.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationResponse.java @@ -6,8 +6,6 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import java.time.Duration; -import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.List; import java.util.Locale; diff --git a/src/main/java/com/numberone/backend/domain/disaster/entity/Disaster.java b/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/entity/Disaster.java similarity index 94% rename from src/main/java/com/numberone/backend/domain/disaster/entity/Disaster.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/disaster/entity/Disaster.java index 3493dcc0..991de251 100644 --- a/src/main/java/com/numberone/backend/domain/disaster/entity/Disaster.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/entity/Disaster.java @@ -4,7 +4,10 @@ import com.numberone.backend.domain.conversation.entity.Conversation; import com.numberone.backend.domain.disaster.util.DisasterType; import jakarta.persistence.*; -import lombok.*; +import lombok.AccessLevel; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; import org.hibernate.annotations.Comment; import java.time.LocalDateTime; diff --git a/src/main/java/com/numberone/backend/domain/disaster/repository/DisasterRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/repository/DisasterRepository.java similarity index 89% rename from src/main/java/com/numberone/backend/domain/disaster/repository/DisasterRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/disaster/repository/DisasterRepository.java index e51a067d..79e6cb1c 100644 --- a/src/main/java/com/numberone/backend/domain/disaster/repository/DisasterRepository.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/repository/DisasterRepository.java @@ -1,11 +1,9 @@ package com.numberone.backend.domain.disaster.repository; import com.numberone.backend.domain.disaster.entity.Disaster; -import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; -import javax.swing.text.html.Option; import java.time.LocalDateTime; import java.util.List; import java.util.Optional; diff --git a/src/main/java/com/numberone/backend/domain/disaster/util/DisasterType.java b/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/util/DisasterType.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/disaster/util/DisasterType.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/disaster/util/DisasterType.java diff --git a/src/main/java/com/numberone/backend/domain/friendship/dto/response/FriendResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/friendship/dto/response/FriendResponse.java similarity index 97% rename from src/main/java/com/numberone/backend/domain/friendship/dto/response/FriendResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/friendship/dto/response/FriendResponse.java index 14ccbf27..482df89d 100644 --- a/src/main/java/com/numberone/backend/domain/friendship/dto/response/FriendResponse.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/friendship/dto/response/FriendResponse.java @@ -3,8 +3,6 @@ import com.numberone.backend.domain.member.entity.Member; import lombok.*; -import java.util.List; - @ToString @Builder @Getter diff --git a/src/main/java/com/numberone/backend/domain/friendship/dto/response/InviteFriendResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/friendship/dto/response/InviteFriendResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/friendship/dto/response/InviteFriendResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/friendship/dto/response/InviteFriendResponse.java diff --git a/src/main/java/com/numberone/backend/domain/friendship/dto/response/SendFcmFriendResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/friendship/dto/response/SendFcmFriendResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/friendship/dto/response/SendFcmFriendResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/friendship/dto/response/SendFcmFriendResponse.java diff --git a/src/main/java/com/numberone/backend/domain/friendship/entity/Friendship.java b/daepiro-core/src/main/java/com/numberone/backend/domain/friendship/entity/Friendship.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/friendship/entity/Friendship.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/friendship/entity/Friendship.java diff --git a/src/main/java/com/numberone/backend/domain/friendship/repository/FriendshipRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/friendship/repository/FriendshipRepository.java similarity index 87% rename from src/main/java/com/numberone/backend/domain/friendship/repository/FriendshipRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/friendship/repository/FriendshipRepository.java index 7887ce97..cbe68e2e 100644 --- a/src/main/java/com/numberone/backend/domain/friendship/repository/FriendshipRepository.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/friendship/repository/FriendshipRepository.java @@ -4,8 +4,6 @@ import com.numberone.backend.domain.member.entity.Member; import org.springframework.data.jpa.repository.JpaRepository; -import javax.swing.text.html.Option; -import java.util.List; import java.util.Optional; public interface FriendshipRepository extends JpaRepository { diff --git a/src/main/java/com/numberone/backend/domain/like/dto/response/response/ArticleLikeResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/like/dto/response/response/ArticleLikeResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/like/dto/response/response/ArticleLikeResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/like/dto/response/response/ArticleLikeResponse.java diff --git a/src/main/java/com/numberone/backend/domain/like/dto/response/response/CommentLikeResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/like/dto/response/response/CommentLikeResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/like/dto/response/response/CommentLikeResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/like/dto/response/response/CommentLikeResponse.java diff --git a/src/main/java/com/numberone/backend/domain/like/entity/ArticleLike.java b/daepiro-core/src/main/java/com/numberone/backend/domain/like/entity/ArticleLike.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/like/entity/ArticleLike.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/like/entity/ArticleLike.java diff --git a/src/main/java/com/numberone/backend/domain/like/entity/CommentLike.java b/daepiro-core/src/main/java/com/numberone/backend/domain/like/entity/CommentLike.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/like/entity/CommentLike.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/like/entity/CommentLike.java diff --git a/src/main/java/com/numberone/backend/domain/like/entity/ConversationLike.java b/daepiro-core/src/main/java/com/numberone/backend/domain/like/entity/ConversationLike.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/like/entity/ConversationLike.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/like/entity/ConversationLike.java diff --git a/src/main/java/com/numberone/backend/domain/like/repository/ArticleLikeRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/like/repository/ArticleLikeRepository.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/like/repository/ArticleLikeRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/like/repository/ArticleLikeRepository.java diff --git a/src/main/java/com/numberone/backend/domain/like/repository/CommentLikeRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/like/repository/CommentLikeRepository.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/like/repository/CommentLikeRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/like/repository/CommentLikeRepository.java diff --git a/src/main/java/com/numberone/backend/domain/like/repository/ConversationLikeRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/like/repository/ConversationLikeRepository.java similarity index 91% rename from src/main/java/com/numberone/backend/domain/like/repository/ConversationLikeRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/like/repository/ConversationLikeRepository.java index 81f0bf81..a95c6e64 100644 --- a/src/main/java/com/numberone/backend/domain/like/repository/ConversationLikeRepository.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/like/repository/ConversationLikeRepository.java @@ -4,7 +4,6 @@ import com.numberone.backend.domain.like.entity.ConversationLike; import com.numberone.backend.domain.member.entity.Member; import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.Query; import java.util.Optional; diff --git a/src/main/java/com/numberone/backend/domain/member/dto/request/BuyHeartRequest.java b/daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/request/BuyHeartRequest.java similarity index 78% rename from src/main/java/com/numberone/backend/domain/member/dto/request/BuyHeartRequest.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/request/BuyHeartRequest.java index 72498c9a..1c01252f 100644 --- a/src/main/java/com/numberone/backend/domain/member/dto/request/BuyHeartRequest.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/request/BuyHeartRequest.java @@ -1,7 +1,9 @@ package com.numberone.backend.domain.member.dto.request; import jakarta.validation.constraints.NotNull; -import lombok.*; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.NoArgsConstructor; @NoArgsConstructor(access = AccessLevel.PROTECTED) @Getter diff --git a/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingAddress.java b/daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingAddress.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingAddress.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingAddress.java diff --git a/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingDisasterType.java b/daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingDisasterType.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingDisasterType.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingDisasterType.java diff --git a/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingRequest.java b/daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingRequest.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingRequest.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingRequest.java diff --git a/src/main/java/com/numberone/backend/domain/member/dto/request/UpdateGpsRequest.java b/daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/request/UpdateGpsRequest.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/member/dto/request/UpdateGpsRequest.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/request/UpdateGpsRequest.java diff --git a/src/main/java/com/numberone/backend/domain/member/dto/request/UpdateSafetyRequest.java b/daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/request/UpdateSafetyRequest.java similarity index 88% rename from src/main/java/com/numberone/backend/domain/member/dto/request/UpdateSafetyRequest.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/request/UpdateSafetyRequest.java index 33b8abc6..48284159 100644 --- a/src/main/java/com/numberone/backend/domain/member/dto/request/UpdateSafetyRequest.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/request/UpdateSafetyRequest.java @@ -1,7 +1,6 @@ package com.numberone.backend.domain.member.dto.request; import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotNull; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/src/main/java/com/numberone/backend/domain/member/dto/response/GetNotificationRegionResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/response/GetNotificationRegionResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/member/dto/response/GetNotificationRegionResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/response/GetNotificationRegionResponse.java diff --git a/src/main/java/com/numberone/backend/domain/member/dto/response/HeartCntResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/response/HeartCntResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/member/dto/response/HeartCntResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/response/HeartCntResponse.java diff --git a/src/main/java/com/numberone/backend/domain/member/dto/response/MemberIdResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/response/MemberIdResponse.java similarity index 92% rename from src/main/java/com/numberone/backend/domain/member/dto/response/MemberIdResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/response/MemberIdResponse.java index 47c5c752..6a69fff5 100644 --- a/src/main/java/com/numberone/backend/domain/member/dto/response/MemberIdResponse.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/response/MemberIdResponse.java @@ -1,7 +1,6 @@ package com.numberone.backend.domain.member.dto.response; import com.numberone.backend.domain.member.entity.Member; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; @Getter diff --git a/src/main/java/com/numberone/backend/domain/member/dto/response/UploadProfileImageResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/response/UploadProfileImageResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/member/dto/response/UploadProfileImageResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/response/UploadProfileImageResponse.java diff --git a/src/main/java/com/numberone/backend/domain/member/entity/Member.java b/daepiro-core/src/main/java/com/numberone/backend/domain/member/entity/Member.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/member/entity/Member.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/member/entity/Member.java diff --git a/src/main/java/com/numberone/backend/domain/member/repository/MemberRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/member/repository/MemberRepository.java similarity index 92% rename from src/main/java/com/numberone/backend/domain/member/repository/MemberRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/member/repository/MemberRepository.java index 719544d8..f19f86e5 100644 --- a/src/main/java/com/numberone/backend/domain/member/repository/MemberRepository.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/member/repository/MemberRepository.java @@ -3,7 +3,6 @@ import com.numberone.backend.domain.member.entity.Member; import com.numberone.backend.domain.member.repository.custom.MemberRepositoryCustom; import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.stereotype.Repository; import java.util.List; import java.util.Optional; diff --git a/src/main/java/com/numberone/backend/domain/member/repository/custom/MemberRepositoryCustom.java b/daepiro-core/src/main/java/com/numberone/backend/domain/member/repository/custom/MemberRepositoryCustom.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/member/repository/custom/MemberRepositoryCustom.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/member/repository/custom/MemberRepositoryCustom.java diff --git a/src/main/java/com/numberone/backend/domain/member/repository/custom/MemberRepositoryImpl.java b/daepiro-core/src/main/java/com/numberone/backend/domain/member/repository/custom/MemberRepositoryImpl.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/member/repository/custom/MemberRepositoryImpl.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/member/repository/custom/MemberRepositoryImpl.java diff --git a/src/main/java/com/numberone/backend/domain/notification/dto/request/NotificationSearchParameter.java b/daepiro-core/src/main/java/com/numberone/backend/domain/notification/dto/request/NotificationSearchParameter.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/notification/dto/request/NotificationSearchParameter.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/notification/dto/request/NotificationSearchParameter.java diff --git a/src/main/java/com/numberone/backend/domain/notification/dto/response/NotificationTabResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/notification/dto/response/NotificationTabResponse.java similarity index 96% rename from src/main/java/com/numberone/backend/domain/notification/dto/response/NotificationTabResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/notification/dto/response/NotificationTabResponse.java index db91b72c..f2a1be42 100644 --- a/src/main/java/com/numberone/backend/domain/notification/dto/response/NotificationTabResponse.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/notification/dto/response/NotificationTabResponse.java @@ -2,7 +2,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.numberone.backend.domain.notification.entity.NotificationEntity; -import com.numberone.backend.domain.notification.entity.NotificationTag; import com.querydsl.core.annotations.QueryProjection; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; diff --git a/src/main/java/com/numberone/backend/domain/notification/entity/NotificationEntity.java b/daepiro-core/src/main/java/com/numberone/backend/domain/notification/entity/NotificationEntity.java similarity index 98% rename from src/main/java/com/numberone/backend/domain/notification/entity/NotificationEntity.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/notification/entity/NotificationEntity.java index e59c4aee..078782f8 100644 --- a/src/main/java/com/numberone/backend/domain/notification/entity/NotificationEntity.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/notification/entity/NotificationEntity.java @@ -9,8 +9,6 @@ import lombok.NoArgsConstructor; import org.hibernate.annotations.Comment; -import java.util.MissingFormatArgumentException; - @Comment("μ•Œλ¦Ό 정보") @NoArgsConstructor(access = AccessLevel.PROTECTED) @Getter diff --git a/src/main/java/com/numberone/backend/domain/notification/entity/NotificationTag.java b/daepiro-core/src/main/java/com/numberone/backend/domain/notification/entity/NotificationTag.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/notification/entity/NotificationTag.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/notification/entity/NotificationTag.java diff --git a/src/main/java/com/numberone/backend/domain/notification/repository/NotificationRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/notification/repository/NotificationRepository.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/notification/repository/NotificationRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/notification/repository/NotificationRepository.java diff --git a/src/main/java/com/numberone/backend/domain/notification/repository/custom/NotificationRepositoryCustom.java b/daepiro-core/src/main/java/com/numberone/backend/domain/notification/repository/custom/NotificationRepositoryCustom.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/notification/repository/custom/NotificationRepositoryCustom.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/notification/repository/custom/NotificationRepositoryCustom.java diff --git a/src/main/java/com/numberone/backend/domain/notification/repository/custom/NotificationRepositoryCustomImpl.java b/daepiro-core/src/main/java/com/numberone/backend/domain/notification/repository/custom/NotificationRepositoryCustomImpl.java similarity index 98% rename from src/main/java/com/numberone/backend/domain/notification/repository/custom/NotificationRepositoryCustomImpl.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/notification/repository/custom/NotificationRepositoryCustomImpl.java index 7dab3ffb..547502a2 100644 --- a/src/main/java/com/numberone/backend/domain/notification/repository/custom/NotificationRepositoryCustomImpl.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/notification/repository/custom/NotificationRepositoryCustomImpl.java @@ -5,7 +5,6 @@ import com.numberone.backend.domain.notification.dto.response.QNotificationTabResponse; import com.numberone.backend.domain.notification.entity.NotificationTag; import com.querydsl.core.types.dsl.BooleanExpression; -import com.querydsl.core.types.dsl.CaseBuilder; import com.querydsl.jpa.impl.JPAQueryFactory; import jakarta.persistence.EntityManager; import org.springframework.data.domain.Pageable; diff --git a/src/main/java/com/numberone/backend/domain/notificationdisaster/entity/NotificationDisaster.java b/daepiro-core/src/main/java/com/numberone/backend/domain/notificationdisaster/entity/NotificationDisaster.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/notificationdisaster/entity/NotificationDisaster.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/notificationdisaster/entity/NotificationDisaster.java diff --git a/src/main/java/com/numberone/backend/domain/notificationdisaster/repository/NotificationDisasterRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/notificationdisaster/repository/NotificationDisasterRepository.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/notificationdisaster/repository/NotificationDisasterRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/notificationdisaster/repository/NotificationDisasterRepository.java diff --git a/src/main/java/com/numberone/backend/domain/notificationregion/entity/NotificationRegion.java b/daepiro-core/src/main/java/com/numberone/backend/domain/notificationregion/entity/NotificationRegion.java similarity index 96% rename from src/main/java/com/numberone/backend/domain/notificationregion/entity/NotificationRegion.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/notificationregion/entity/NotificationRegion.java index 5d9cee4e..d8979836 100644 --- a/src/main/java/com/numberone/backend/domain/notificationregion/entity/NotificationRegion.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/notificationregion/entity/NotificationRegion.java @@ -1,7 +1,6 @@ package com.numberone.backend.domain.notificationregion.entity; import com.numberone.backend.domain.member.entity.Member; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.persistence.*; import lombok.AccessLevel; import lombok.Builder; diff --git a/src/main/java/com/numberone/backend/domain/notificationregion/repository/NotificationRegionRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/notificationregion/repository/NotificationRegionRepository.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/notificationregion/repository/NotificationRegionRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/notificationregion/repository/NotificationRegionRepository.java diff --git a/src/main/java/com/numberone/backend/domain/shelter/dto/request/NearbyShelterRequest.java b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/request/NearbyShelterRequest.java similarity index 90% rename from src/main/java/com/numberone/backend/domain/shelter/dto/request/NearbyShelterRequest.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/request/NearbyShelterRequest.java index 3970f627..eca76e27 100644 --- a/src/main/java/com/numberone/backend/domain/shelter/dto/request/NearbyShelterRequest.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/request/NearbyShelterRequest.java @@ -1,9 +1,7 @@ package com.numberone.backend.domain.shelter.dto.request; -import com.numberone.backend.domain.shelter.util.ShelterType; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Null; import lombok.*; @ToString diff --git a/src/main/java/com/numberone/backend/domain/shelter/dto/response/GetAllSheltersResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/response/GetAllSheltersResponse.java similarity index 97% rename from src/main/java/com/numberone/backend/domain/shelter/dto/response/GetAllSheltersResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/response/GetAllSheltersResponse.java index c1168b08..28f01767 100644 --- a/src/main/java/com/numberone/backend/domain/shelter/dto/response/GetAllSheltersResponse.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/response/GetAllSheltersResponse.java @@ -1,6 +1,5 @@ package com.numberone.backend.domain.shelter.dto.response; -import com.numberone.backend.domain.shelter.util.Address; import com.querydsl.core.annotations.QueryProjection; import lombok.*; diff --git a/src/main/java/com/numberone/backend/domain/shelter/dto/response/GetShelterDatabaseUrlResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/response/GetShelterDatabaseUrlResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/shelter/dto/response/GetShelterDatabaseUrlResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/response/GetShelterDatabaseUrlResponse.java diff --git a/src/main/java/com/numberone/backend/domain/shelter/dto/response/NearbyShelterListResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/response/NearbyShelterListResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/shelter/dto/response/NearbyShelterListResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/response/NearbyShelterListResponse.java diff --git a/src/main/java/com/numberone/backend/domain/shelter/dto/response/NearestShelterResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/response/NearestShelterResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/shelter/dto/response/NearestShelterResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/response/NearestShelterResponse.java diff --git a/src/main/java/com/numberone/backend/domain/shelter/dto/response/ShelterMapper.java b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/response/ShelterMapper.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/shelter/dto/response/ShelterMapper.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/response/ShelterMapper.java diff --git a/src/main/java/com/numberone/backend/domain/shelter/entity/Shelter.java b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/entity/Shelter.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/shelter/entity/Shelter.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/shelter/entity/Shelter.java diff --git a/src/main/java/com/numberone/backend/domain/shelter/repository/ShelterRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/repository/ShelterRepository.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/shelter/repository/ShelterRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/shelter/repository/ShelterRepository.java diff --git a/src/main/java/com/numberone/backend/domain/shelter/repository/custom/CustomShelterRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/repository/custom/CustomShelterRepository.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/shelter/repository/custom/CustomShelterRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/shelter/repository/custom/CustomShelterRepository.java diff --git a/src/main/java/com/numberone/backend/domain/shelter/repository/custom/CustomShelterRepositoryImpl.java b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/repository/custom/CustomShelterRepositoryImpl.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/shelter/repository/custom/CustomShelterRepositoryImpl.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/shelter/repository/custom/CustomShelterRepositoryImpl.java diff --git a/src/main/java/com/numberone/backend/domain/shelter/util/Address.java b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/util/Address.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/shelter/util/Address.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/shelter/util/Address.java diff --git a/src/main/java/com/numberone/backend/domain/shelter/util/ShelterStatus.java b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/util/ShelterStatus.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/shelter/util/ShelterStatus.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/shelter/util/ShelterStatus.java diff --git a/src/main/java/com/numberone/backend/domain/shelter/util/ShelterType.java b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/util/ShelterType.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/shelter/util/ShelterType.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/shelter/util/ShelterType.java diff --git a/src/main/java/com/numberone/backend/domain/sponsor/dto/response/SponsorHomeResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/sponsor/dto/response/SponsorHomeResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/sponsor/dto/response/SponsorHomeResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/sponsor/dto/response/SponsorHomeResponse.java diff --git a/src/main/java/com/numberone/backend/domain/sponsor/dto/response/SponsorResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/sponsor/dto/response/SponsorResponse.java similarity index 97% rename from src/main/java/com/numberone/backend/domain/sponsor/dto/response/SponsorResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/sponsor/dto/response/SponsorResponse.java index b9d76076..1b38db60 100644 --- a/src/main/java/com/numberone/backend/domain/sponsor/dto/response/SponsorResponse.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/sponsor/dto/response/SponsorResponse.java @@ -3,12 +3,10 @@ import com.numberone.backend.domain.sponsor.entity.Sponsor; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import org.hibernate.annotations.Comment; import java.time.LocalDate; import java.time.Period; import java.time.format.DateTimeFormatter; -import java.util.Locale; @Getter @NoArgsConstructor(access = AccessLevel.PROTECTED) diff --git a/src/main/java/com/numberone/backend/domain/sponsor/entity/Sponsor.java b/daepiro-core/src/main/java/com/numberone/backend/domain/sponsor/entity/Sponsor.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/sponsor/entity/Sponsor.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/sponsor/entity/Sponsor.java diff --git a/src/main/java/com/numberone/backend/domain/sponsor/repository/SponsorRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/sponsor/repository/SponsorRepository.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/sponsor/repository/SponsorRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/sponsor/repository/SponsorRepository.java diff --git a/src/main/java/com/numberone/backend/domain/support/dto/request/CreateSupportRequest.java b/daepiro-core/src/main/java/com/numberone/backend/domain/support/dto/request/CreateSupportRequest.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/support/dto/request/CreateSupportRequest.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/support/dto/request/CreateSupportRequest.java diff --git a/src/main/java/com/numberone/backend/domain/support/dto/request/EditMessageRequest.java b/daepiro-core/src/main/java/com/numberone/backend/domain/support/dto/request/EditMessageRequest.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/support/dto/request/EditMessageRequest.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/support/dto/request/EditMessageRequest.java diff --git a/src/main/java/com/numberone/backend/domain/support/dto/response/CreateSupportResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/support/dto/response/CreateSupportResponse.java similarity index 88% rename from src/main/java/com/numberone/backend/domain/support/dto/response/CreateSupportResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/support/dto/response/CreateSupportResponse.java index cecccfba..858e558d 100644 --- a/src/main/java/com/numberone/backend/domain/support/dto/response/CreateSupportResponse.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/support/dto/response/CreateSupportResponse.java @@ -1,6 +1,5 @@ package com.numberone.backend.domain.support.dto.response; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; @Getter diff --git a/src/main/java/com/numberone/backend/domain/support/entity/Support.java b/daepiro-core/src/main/java/com/numberone/backend/domain/support/entity/Support.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/support/entity/Support.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/support/entity/Support.java diff --git a/src/main/java/com/numberone/backend/domain/support/repository/SupportRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/support/repository/SupportRepository.java similarity index 94% rename from src/main/java/com/numberone/backend/domain/support/repository/SupportRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/support/repository/SupportRepository.java index 0f2fad79..ee2a87bb 100644 --- a/src/main/java/com/numberone/backend/domain/support/repository/SupportRepository.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/support/repository/SupportRepository.java @@ -4,8 +4,6 @@ import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; -import java.util.List; - public interface SupportRepository extends JpaRepository { @Query("select count(distinct s.member.id) from Support s") long getSupportCnt(); diff --git a/src/main/java/com/numberone/backend/domain/token/dto/request/GetTokenRequest.java b/daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/request/GetTokenRequest.java similarity index 79% rename from src/main/java/com/numberone/backend/domain/token/dto/request/GetTokenRequest.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/request/GetTokenRequest.java index 4f3e07f0..5bed0f3b 100644 --- a/src/main/java/com/numberone/backend/domain/token/dto/request/GetTokenRequest.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/request/GetTokenRequest.java @@ -1,7 +1,10 @@ package com.numberone.backend.domain.token.dto.request; import jakarta.validation.constraints.NotNull; -import lombok.*; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.ToString; import org.hibernate.annotations.Comment; @ToString diff --git a/src/main/java/com/numberone/backend/domain/token/dto/request/RefreshTokenRequest.java b/daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/request/RefreshTokenRequest.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/token/dto/request/RefreshTokenRequest.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/request/RefreshTokenRequest.java diff --git a/src/main/java/com/numberone/backend/domain/token/dto/response/GetTokenResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/response/GetTokenResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/token/dto/response/GetTokenResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/response/GetTokenResponse.java diff --git a/src/main/java/com/numberone/backend/domain/token/dto/response/KakaoInfoResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/response/KakaoInfoResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/token/dto/response/KakaoInfoResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/response/KakaoInfoResponse.java diff --git a/src/main/java/com/numberone/backend/domain/token/dto/response/KakaoTokenResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/response/KakaoTokenResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/token/dto/response/KakaoTokenResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/response/KakaoTokenResponse.java diff --git a/src/main/java/com/numberone/backend/domain/token/dto/response/NaverInfoResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/response/NaverInfoResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/token/dto/response/NaverInfoResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/response/NaverInfoResponse.java diff --git a/src/main/java/com/numberone/backend/domain/token/dto/response/NaverTokenResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/response/NaverTokenResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/token/dto/response/NaverTokenResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/response/NaverTokenResponse.java diff --git a/src/main/java/com/numberone/backend/domain/token/dto/response/RefreshTokenResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/response/RefreshTokenResponse.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/token/dto/response/RefreshTokenResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/response/RefreshTokenResponse.java diff --git a/src/main/java/com/numberone/backend/domain/token/entity/Token.java b/daepiro-core/src/main/java/com/numberone/backend/domain/token/entity/Token.java similarity index 94% rename from src/main/java/com/numberone/backend/domain/token/entity/Token.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/token/entity/Token.java index 0778a852..6f1cdbea 100644 --- a/src/main/java/com/numberone/backend/domain/token/entity/Token.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/token/entity/Token.java @@ -1,9 +1,7 @@ package com.numberone.backend.domain.token.entity; -import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; -import org.hibernate.annotations.Comment; import org.springframework.data.annotation.Id; import org.springframework.data.redis.core.RedisHash; import org.springframework.data.redis.core.index.Indexed; diff --git a/src/main/java/com/numberone/backend/domain/token/repository/TokenRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/token/repository/TokenRepository.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/token/repository/TokenRepository.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/token/repository/TokenRepository.java diff --git a/src/main/java/com/numberone/backend/domain/token/util/JwtUtil.java b/daepiro-core/src/main/java/com/numberone/backend/domain/token/util/JwtUtil.java similarity index 92% rename from src/main/java/com/numberone/backend/domain/token/util/JwtUtil.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/token/util/JwtUtil.java index b2c8fb5e..f8d7e5ef 100644 --- a/src/main/java/com/numberone/backend/domain/token/util/JwtUtil.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/token/util/JwtUtil.java @@ -1,14 +1,11 @@ package com.numberone.backend.domain.token.util; -import com.numberone.backend.domain.token.service.TokenService; import com.numberone.backend.properties.JwtProperties; import io.jsonwebtoken.*; -import jakarta.annotation.PostConstruct; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; -import java.util.Base64; import java.util.Date; @Slf4j diff --git a/src/main/java/com/numberone/backend/domain/token/util/SecurityContextProvider.java b/daepiro-core/src/main/java/com/numberone/backend/domain/token/util/SecurityContextProvider.java similarity index 100% rename from src/main/java/com/numberone/backend/domain/token/util/SecurityContextProvider.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/token/util/SecurityContextProvider.java diff --git a/src/main/java/com/numberone/backend/properties/DisasterProperties.java b/daepiro-core/src/main/java/com/numberone/backend/properties/DisasterProperties.java similarity index 88% rename from src/main/java/com/numberone/backend/properties/DisasterProperties.java rename to daepiro-core/src/main/java/com/numberone/backend/properties/DisasterProperties.java index db3b9aaa..7817be61 100644 --- a/src/main/java/com/numberone/backend/properties/DisasterProperties.java +++ b/daepiro-core/src/main/java/com/numberone/backend/properties/DisasterProperties.java @@ -2,7 +2,6 @@ import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; import org.springframework.stereotype.Service; @Data diff --git a/src/main/java/com/numberone/backend/properties/JwtProperties.java b/daepiro-core/src/main/java/com/numberone/backend/properties/JwtProperties.java similarity index 100% rename from src/main/java/com/numberone/backend/properties/JwtProperties.java rename to daepiro-core/src/main/java/com/numberone/backend/properties/JwtProperties.java diff --git a/src/main/java/com/numberone/backend/properties/KakaoProperties.java b/daepiro-core/src/main/java/com/numberone/backend/properties/KakaoProperties.java similarity index 100% rename from src/main/java/com/numberone/backend/properties/KakaoProperties.java rename to daepiro-core/src/main/java/com/numberone/backend/properties/KakaoProperties.java diff --git a/src/main/java/com/numberone/backend/properties/NaverProperties.java b/daepiro-core/src/main/java/com/numberone/backend/properties/NaverProperties.java similarity index 100% rename from src/main/java/com/numberone/backend/properties/NaverProperties.java rename to daepiro-core/src/main/java/com/numberone/backend/properties/NaverProperties.java diff --git a/src/main/java/com/numberone/backend/properties/RedisProperties.java b/daepiro-core/src/main/java/com/numberone/backend/properties/RedisProperties.java similarity index 100% rename from src/main/java/com/numberone/backend/properties/RedisProperties.java rename to daepiro-core/src/main/java/com/numberone/backend/properties/RedisProperties.java diff --git a/src/main/java/com/numberone/backend/properties/TokenPeriodProperties.java b/daepiro-core/src/main/java/com/numberone/backend/properties/TokenPeriodProperties.java similarity index 100% rename from src/main/java/com/numberone/backend/properties/TokenPeriodProperties.java rename to daepiro-core/src/main/java/com/numberone/backend/properties/TokenPeriodProperties.java diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/settings.gradle b/settings.gradle index ab6c67b7..cd114704 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,4 @@ rootProject.name = 'Backend' +include 'daepiro-api' +include 'daepiro-core' +include 'daepiro-common' \ No newline at end of file From 4d393ea8208b560b73100b77ed555e8f1789d339 Mon Sep 17 00:00:00 2001 From: Jaehyeon Date: Mon, 8 Jan 2024 23:56:36 +0900 Subject: [PATCH 02/31] Feat: deploy test --- .github/workflows/jib-build-depoly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/jib-build-depoly.yml b/.github/workflows/jib-build-depoly.yml index a58273b3..d5304be9 100644 --- a/.github/workflows/jib-build-depoly.yml +++ b/.github/workflows/jib-build-depoly.yml @@ -3,7 +3,7 @@ name: NumberOne-Backend-JIB-BUILD-DEPLOY # event trigger on: push: - branches: [ "main", "dev", "dev-check" ] + branches: [ "main", "dev", "dev-check", "feat/multi-module" ] permissions: write-all From 4b19f0d23531616d0dcb9dcb3ec3c39a587e898e Mon Sep 17 00:00:00 2001 From: Jaehyeon Date: Mon, 8 Jan 2024 23:58:04 +0900 Subject: [PATCH 03/31] Feat: fix shell --- .github/workflows/jib-build-depoly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/jib-build-depoly.yml b/.github/workflows/jib-build-depoly.yml index d5304be9..83d978bb 100644 --- a/.github/workflows/jib-build-depoly.yml +++ b/.github/workflows/jib-build-depoly.yml @@ -51,7 +51,7 @@ jobs: - name: 🐧 create service-account.json run: | cd ./daepiro-api/src/main/resources - touch ./daepiro-api/service-account.json + touch ./service-account.json echo "${{ secrets.FCM }}" | base64 --decode > ./service-account.json ls -la shell: bash From 9008e6dd641ec7b6dc92e659158353ee71f52745 Mon Sep 17 00:00:00 2001 From: Jaehyeon Date: Tue, 9 Jan 2024 00:01:13 +0900 Subject: [PATCH 04/31] Feat: set main class for jib --- .github/workflows/jib-build-depoly.yml | 2 +- build.gradle | 2 +- daepiro-api/build.gradle | 7 ++++--- .../java/com/numberone/backend/BackendApplication.java | 2 ++ 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/jib-build-depoly.yml b/.github/workflows/jib-build-depoly.yml index 83d978bb..948461d1 100644 --- a/.github/workflows/jib-build-depoly.yml +++ b/.github/workflows/jib-build-depoly.yml @@ -59,7 +59,7 @@ jobs: - name: Build with jib run: | ./gradlew clean - ./gradlew jib -x test \ + ./gradlew :daepiro-api:jibDockerBuild -x test \ -Djib.to.auth.username=${{ secrets.DOCKER_USERNAME }} \ -Djib.to.auth.password=${{ secrets.DOCKER_PASSWORD }} \ -Djib.to.image="${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_IMAGE }}:latest" diff --git a/build.gradle b/build.gradle index 43b68b80..1bd0e37d 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { id 'com.google.cloud.tools.jib' version '3.4.0' } -group = 'com.numberone' +group = 'com.numberone.backend' version = '0.0.1-SNAPSHOT' allprojects { diff --git a/daepiro-api/build.gradle b/daepiro-api/build.gradle index a755aeae..efdd50f1 100644 --- a/daepiro-api/build.gradle +++ b/daepiro-api/build.gradle @@ -57,18 +57,19 @@ tasks.named('test') { useJUnitPlatform() } - jib { from { - image = "openjdk:17-alpine" + image = "amazoncorretto:17" } to { image = "versatile0010/numberone" - credHelper = 'ecr-login' tags = ["latest"] } container { + mainClass = 'com.numberone.backend.BackendApplication' + creationTime = "USE_CURRENT_TIMESTAMP" jvmFlags = ["-Duser.timezone=Asia/Seoul", "-Xms128m", "-Xmx128m"] + ports = ['8080'] } } diff --git a/daepiro-api/src/main/java/com/numberone/backend/BackendApplication.java b/daepiro-api/src/main/java/com/numberone/backend/BackendApplication.java index 8cfd171d..3fb21b3a 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/BackendApplication.java +++ b/daepiro-api/src/main/java/com/numberone/backend/BackendApplication.java @@ -2,8 +2,10 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.web.servlet.ServletComponentScan; @SpringBootApplication +@ServletComponentScan public class BackendApplication { public static void main(String[] args) { SpringApplication.run(BackendApplication.class, args); From 9515dad38f2f2bf744369dd65544050bb0afdb9b Mon Sep 17 00:00:00 2001 From: Jaehyeon Date: Tue, 9 Jan 2024 19:27:12 +0900 Subject: [PATCH 05/31] Feat: management dependency and plugins --- .github/workflows/jib-build-depoly.yml | 1 - .../backend/config/SwaggerConfig.java | 2 +- daepiro-core/build.gradle | 99 +++++++++---------- 3 files changed, 49 insertions(+), 53 deletions(-) diff --git a/.github/workflows/jib-build-depoly.yml b/.github/workflows/jib-build-depoly.yml index 948461d1..5ba50cff 100644 --- a/.github/workflows/jib-build-depoly.yml +++ b/.github/workflows/jib-build-depoly.yml @@ -58,7 +58,6 @@ jobs: - name: Build with jib run: | - ./gradlew clean ./gradlew :daepiro-api:jibDockerBuild -x test \ -Djib.to.auth.username=${{ secrets.DOCKER_USERNAME }} \ -Djib.to.auth.password=${{ secrets.DOCKER_PASSWORD }} \ diff --git a/daepiro-common/src/main/java/com/numberone/backend/config/SwaggerConfig.java b/daepiro-common/src/main/java/com/numberone/backend/config/SwaggerConfig.java index c71942b4..fbc3c2e2 100644 --- a/daepiro-common/src/main/java/com/numberone/backend/config/SwaggerConfig.java +++ b/daepiro-common/src/main/java/com/numberone/backend/config/SwaggerConfig.java @@ -15,7 +15,7 @@ @OpenAPIDefinition( servers = @Server(url = "/", description = "${host.url}"), info = @Info( - title = "πŸš€ λŒ€ν”Όλ‘œ λ°±μ—”λ“œ API λͺ…μ„Έμ„œ Jib 배포 23. 11. 18. v2 (jdk base image = openjdk:17-alpine)", + title = "πŸš€ λŒ€ν”Όλ‘œ λ°±μ—”λ“œ API λͺ…μ„Έμ„œ (multi-module μ „ν™˜:24.01.09)", description = """ spring docs λ₯Ό μ΄μš©ν•œ API λͺ…μ„Έμ„œ μž…λ‹ˆλ‹€.😊 """, diff --git a/daepiro-core/build.gradle b/daepiro-core/build.gradle index 08b8ca09..54d3ff24 100644 --- a/daepiro-core/build.gradle +++ b/daepiro-core/build.gradle @@ -1,91 +1,88 @@ +buildscript { + ext { + queryDslVersion = "5.0.0" + } +} plugins { id 'java' - id "com.ewerk.gradle.plugins.querydsl" version "1.0.10" id "java-library" id "java-test-fixtures" id "maven-publish" } configurations { - querydsl.extendsFrom compileClasspath + compileOnly { + extendsFrom annotationProcessor + } +} + +repositories { + mavenCentral() } dependencies { implementation project(':daepiro-common') - implementation 'org.springframework.boot:spring-boot-starter-security' - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-validation' - // swagger implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2' - // jpa - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - - ///////// query dsl //////////// - implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta' - annotationProcessor 'com.querydsl:querydsl-apt:5.0.0:jakarta' - annotationProcessor "jakarta.annotation:jakarta.annotation-api" - annotationProcessor "jakarta.persistence:jakarta.persistence-api" + // redis + implementation 'org.springframework.boot:spring-boot-starter-data-redis' + // p6spy implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.5.8' - annotationProcessor "jakarta.annotation:jakarta.annotation-api" - annotationProcessor "jakarta.persistence:jakarta.persistence-api" - annotationProcessor 'org.projectlombok:lombok' - - compileOnly 'org.projectlombok:lombok' - - runtimeOnly 'com.h2database:h2' - runtimeOnly 'com.mysql:mysql-connector-j' - - - testImplementation 'org.springframework.boot:spring-boot-starter-test' - testImplementation 'org.springframework.security:spring-security-test' - - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' - implementation 'org.springframework.boot:spring-boot-starter-data-redis' + // validation + implementation 'org.springframework.boot:spring-boot-starter-validation' + // jwt implementation 'io.jsonwebtoken:jjwt:0.9.1' implementation 'com.sun.xml.bind:jaxb-impl:4.0.1' implementation 'com.sun.xml.bind:jaxb-core:4.0.1' implementation 'javax.xml.bind:jaxb-api:2.4.0-b180830.0359' implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' - // cloud - implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE' - // aop - implementation 'org.springframework.boot:spring-boot-starter-aop' + // jpa + implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - //crawling - implementation 'com.squareup.okhttp3:okhttp:4.9.1' - implementation 'org.jsoup:jsoup:1.14.2' - implementation 'net.sourceforge.htmlunit:htmlunit:2.70.0' + // web + implementation 'org.springframework.boot:spring-boot-starter-web' - //geocoding - implementation 'com.google.code.geocoder-java:geocoder-java:0.16' - // fcm - implementation 'com.google.firebase:firebase-admin:9.1.1' -} + // lombok + compileOnly 'org.projectlombok:lombok' + annotationProcessor 'org.projectlombok:lombok' -def querydslDir = "$buildDir/generated/querydsl" + // mysql connector + runtimeOnly 'com.mysql:mysql-connector-j' + + // test + testImplementation 'org.springframework.boot:spring-boot-starter-test' -querydsl { - jpa = true - querydslSourcesDir = querydslDir + // === QueryDsl μ‹œμž‘ === + implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta' + annotationProcessor "com.querydsl:querydsl-apt:5.0.0:jakarta" + annotationProcessor "jakarta.annotation:jakarta.annotation-api" + annotationProcessor "jakarta.persistence:jakarta.persistence-api" + // === QueryDsl 끝 === } +tasks.named('test') { + useJUnitPlatform() +} + +// === Querydsl λΉŒλ“œ μ˜΅μ…˜ (선택사항) === +def querydslDir = "$buildDir/generated/querydsl" + sourceSets { - main.java.srcDir querydslDir + main.java.srcDirs += [ querydslDir ] } -compileQuerydsl { - options.annotationProcessorPath = configurations.querydsl +tasks.withType(JavaCompile) { + options.annotationProcessorGeneratedSourcesDirectory = file(querydslDir) } -tasks.named('test') { - useJUnitPlatform() +clean.doLast { + file(querydslDir).deleteDir() } \ No newline at end of file From c1ae34a6e85c94c93268642e87fbc47565ef4b73 Mon Sep 17 00:00:00 2001 From: Jaehyeon Date: Tue, 9 Jan 2024 19:40:02 +0900 Subject: [PATCH 06/31] Feat: fix shell --- .github/workflows/jib-build-depoly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/jib-build-depoly.yml b/.github/workflows/jib-build-depoly.yml index 5ba50cff..f21df09a 100644 --- a/.github/workflows/jib-build-depoly.yml +++ b/.github/workflows/jib-build-depoly.yml @@ -58,7 +58,7 @@ jobs: - name: Build with jib run: | - ./gradlew :daepiro-api:jibDockerBuild -x test \ + ./gradlew :daepiro-api:jib -x test \ -Djib.to.auth.username=${{ secrets.DOCKER_USERNAME }} \ -Djib.to.auth.password=${{ secrets.DOCKER_PASSWORD }} \ -Djib.to.image="${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_IMAGE }}:latest" From e7f10ec913f25167efdf193cfb1f4858945bda09 Mon Sep 17 00:00:00 2001 From: Jaehyeon Date: Tue, 9 Jan 2024 20:42:21 +0900 Subject: [PATCH 07/31] Feat: crawler, redis, auth module --- Dockerfile | 5 --- daepiro-api/build.gradle | 12 +++--- .../auth/{ => config}/SecurityConfig.java | 3 +- .../backend/auth/{ => global}/JwtFilter.java | 8 ++-- .../admin/controller/AdminController.java | 3 -- .../domain/admin/service/AdminService.java | 2 +- .../article/controller/ArticleController.java | 2 +- .../article/service/ArticleService.java | 6 +-- .../comment/service/CommentService.java | 4 +- .../service/DisasterEventHandler.java | 8 ++-- .../friendship/service/FriendshipService.java | 4 +- .../like/controller/LikeController.java | 2 +- .../domain/like/service/LikeService.java | 6 +-- .../like/service/RedisLockLikeFacade.java | 4 +- .../domain/member/service/MemberService.java | 2 +- .../shelter/service/ShelterService.java | 2 +- .../notification/NotificationMessage.java | 18 -------- .../notification/NotificationMessageSpec.java | 7 ---- .../properties/DisasterProperties.java | 4 +- .../backend/properties/JwtProperties.java | 0 .../backend/properties/KakaoProperties.java | 0 .../backend/properties/NaverProperties.java | 0 .../backend/properties/RedisProperties.java | 0 .../properties/TokenPeriodProperties.java | 0 .../provider}/fcm/dto/FcmNotificationDto.java | 2 +- .../fcm/service/FcmMessageProvider.java | 17 ++------ .../backend/provider}/s3/S3Provider.java | 2 +- .../domain/disaster/event/DisasterEvent.java | 0 daepiro-crawler/build.gradle | 27 ++++++++++++ .../service/DisasterDataCollector.java | 41 +++++++++++++------ daepiro-redis/build.gradle | 19 +++++++++ .../numberone/backend/config/RedisConfig.java | 0 .../like/repository/RedisLockRepository.java | 2 +- settings.gradle | 5 ++- 34 files changed, 120 insertions(+), 97 deletions(-) delete mode 100644 Dockerfile rename daepiro-api/src/main/java/com/numberone/backend/auth/{ => config}/SecurityConfig.java (96%) rename daepiro-api/src/main/java/com/numberone/backend/auth/{ => global}/JwtFilter.java (92%) rename daepiro-api/src/main/java/com/numberone/backend/{support/redis => domain}/like/service/RedisLockLikeFacade.java (95%) delete mode 100644 daepiro-api/src/main/java/com/numberone/backend/support/notification/NotificationMessage.java delete mode 100644 daepiro-api/src/main/java/com/numberone/backend/support/notification/NotificationMessageSpec.java rename {daepiro-core => daepiro-common}/src/main/java/com/numberone/backend/properties/DisasterProperties.java (84%) rename {daepiro-core => daepiro-common}/src/main/java/com/numberone/backend/properties/JwtProperties.java (100%) rename {daepiro-core => daepiro-common}/src/main/java/com/numberone/backend/properties/KakaoProperties.java (100%) rename {daepiro-core => daepiro-common}/src/main/java/com/numberone/backend/properties/NaverProperties.java (100%) rename {daepiro-core => daepiro-common}/src/main/java/com/numberone/backend/properties/RedisProperties.java (100%) rename {daepiro-core => daepiro-common}/src/main/java/com/numberone/backend/properties/TokenPeriodProperties.java (100%) rename {daepiro-api/src/main/java/com/numberone/backend/support => daepiro-common/src/main/java/com/numberone/backend/provider}/fcm/dto/FcmNotificationDto.java (91%) rename {daepiro-api/src/main/java/com/numberone/backend/support => daepiro-common/src/main/java/com/numberone/backend/provider}/fcm/service/FcmMessageProvider.java (80%) rename {daepiro-api/src/main/java/com/numberone/backend/support => daepiro-common/src/main/java/com/numberone/backend/provider}/s3/S3Provider.java (98%) rename {daepiro-api => daepiro-core}/src/main/java/com/numberone/backend/domain/disaster/event/DisasterEvent.java (100%) create mode 100644 daepiro-crawler/build.gradle rename {daepiro-api => daepiro-crawler}/src/main/java/com/numberone/backend/domain/disaster/service/DisasterDataCollector.java (81%) create mode 100644 daepiro-redis/build.gradle rename {daepiro-core => daepiro-redis}/src/main/java/com/numberone/backend/config/RedisConfig.java (100%) rename {daepiro-api/src/main/java/com/numberone/backend/support/redis => daepiro-redis/src/main/java/com/numberone/backend/domain}/like/repository/RedisLockRepository.java (90%) diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 3d3c2024..00000000 --- a/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM amazoncorretto:17 -EXPOSE 8080 -ARG JAR_FILE=build/libs/*.jar -COPY ${JAR_FILE} app.jar -ENTRYPOINT ["java","-jar","/app.jar"] \ No newline at end of file diff --git a/daepiro-api/build.gradle b/daepiro-api/build.gradle index efdd50f1..9a2c53e7 100644 --- a/daepiro-api/build.gradle +++ b/daepiro-api/build.gradle @@ -5,6 +5,7 @@ plugins { dependencies { implementation project(':daepiro-core') implementation project(':daepiro-common') + implementation project(':daepiro-redis') implementation 'org.springframework.boot:spring-boot-starter-security' implementation 'org.springframework.boot:spring-boot-starter-web' @@ -23,7 +24,6 @@ dependencies { runtimeOnly 'com.h2database:h2' runtimeOnly 'com.mysql:mysql-connector-j' - testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation 'org.springframework.security:spring-security-test' @@ -42,15 +42,15 @@ dependencies { // aop implementation 'org.springframework.boot:spring-boot-starter-aop' - //crawling - implementation 'com.squareup.okhttp3:okhttp:4.9.1' - implementation 'org.jsoup:jsoup:1.14.2' - implementation 'net.sourceforge.htmlunit:htmlunit:2.70.0' - //geocoding implementation 'com.google.code.geocoder-java:geocoder-java:0.16' + // fcm implementation 'com.google.firebase:firebase-admin:9.1.1' + + implementation 'com.squareup.okhttp3:okhttp:4.9.1' + implementation 'org.jsoup:jsoup:1.14.2' + implementation 'net.sourceforge.htmlunit:htmlunit:2.70.0' } tasks.named('test') { diff --git a/daepiro-api/src/main/java/com/numberone/backend/auth/SecurityConfig.java b/daepiro-api/src/main/java/com/numberone/backend/auth/config/SecurityConfig.java similarity index 96% rename from daepiro-api/src/main/java/com/numberone/backend/auth/SecurityConfig.java rename to daepiro-api/src/main/java/com/numberone/backend/auth/config/SecurityConfig.java index 5a55432c..509bc179 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/auth/SecurityConfig.java +++ b/daepiro-api/src/main/java/com/numberone/backend/auth/config/SecurityConfig.java @@ -1,5 +1,6 @@ -package com.numberone.backend.auth; +package com.numberone.backend.auth.config; +import com.numberone.backend.auth.global.JwtFilter; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.context.annotation.Bean; diff --git a/daepiro-api/src/main/java/com/numberone/backend/auth/JwtFilter.java b/daepiro-api/src/main/java/com/numberone/backend/auth/global/JwtFilter.java similarity index 92% rename from daepiro-api/src/main/java/com/numberone/backend/auth/JwtFilter.java rename to daepiro-api/src/main/java/com/numberone/backend/auth/global/JwtFilter.java index d53a605d..133800a0 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/auth/JwtFilter.java +++ b/daepiro-api/src/main/java/com/numberone/backend/auth/global/JwtFilter.java @@ -1,7 +1,8 @@ -package com.numberone.backend.auth; +package com.numberone.backend.auth.global; import com.fasterxml.jackson.databind.ObjectMapper; import com.numberone.backend.domain.member.entity.Member; +import com.numberone.backend.domain.member.repository.MemberRepository; import com.numberone.backend.domain.member.service.MemberService; import com.numberone.backend.domain.token.util.JwtUtil; import com.numberone.backend.exception.context.ExceptionContext; @@ -29,7 +30,7 @@ @Component public class JwtFilter extends OncePerRequestFilter { private final JwtUtil jwtUtil; - private final MemberService memberService; + private final MemberRepository memberRepository; @Override protected boolean shouldNotFilter(HttpServletRequest request) throws ServletException { @@ -58,7 +59,8 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse String email = jwtUtil.getEmail(token); try { - Member member = memberService.findByEmail(email); + Member member = memberRepository.findByEmail(email) + .orElseThrow(NotFoundMemberException::new);; UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken( member.getEmail(), null, Collections.emptyList()); authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request)); diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/admin/controller/AdminController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/admin/controller/AdminController.java index d542a5ba..a997dd00 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/admin/controller/AdminController.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/admin/controller/AdminController.java @@ -1,14 +1,11 @@ package com.numberone.backend.domain.admin.controller; -import com.numberone.backend.domain.admin.dto.request.CreateDisasterEventDto; import com.numberone.backend.domain.admin.dto.response.GetAddressResponse; import com.numberone.backend.domain.admin.service.AdminService; import com.numberone.backend.domain.disaster.dto.request.SaveDisasterRequest; -import com.numberone.backend.domain.disaster.event.DisasterEvent; import com.numberone.backend.domain.disaster.service.DisasterService; import io.swagger.v3.oas.annotations.Operation; import lombok.RequiredArgsConstructor; -import org.springframework.context.ApplicationEventPublisher; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/admin/service/AdminService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/admin/service/AdminService.java index 5424cb8c..abb4893a 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/admin/service/AdminService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/admin/service/AdminService.java @@ -4,7 +4,7 @@ import com.numberone.backend.domain.admin.dto.response.GetAddressResponse; import com.numberone.backend.domain.shelter.dto.response.GetAllSheltersResponse; import com.numberone.backend.domain.shelter.repository.ShelterRepository; -import com.numberone.backend.support.s3.S3Provider; +import com.numberone.backend.provider.s3.S3Provider; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/article/controller/ArticleController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/article/controller/ArticleController.java index d4bea002..080eae06 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/article/controller/ArticleController.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/article/controller/ArticleController.java @@ -6,7 +6,7 @@ import com.numberone.backend.domain.article.service.ArticleService; import com.numberone.backend.domain.comment.dto.request.CreateCommentRequest; import com.numberone.backend.domain.comment.dto.response.CreateCommentResponse; -import com.numberone.backend.support.redis.like.service.RedisLockLikeFacade; +import com.numberone.backend.domain.like.service.RedisLockLikeFacade; import io.swagger.v3.oas.annotations.Operation; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/article/service/ArticleService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/article/service/ArticleService.java index 41e46790..67b92dca 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/article/service/ArticleService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/article/service/ArticleService.java @@ -27,8 +27,8 @@ import com.numberone.backend.exception.conflict.UnauthorizedLocationException; import com.numberone.backend.exception.notfound.NotFoundArticleException; import com.numberone.backend.exception.notfound.NotFoundMemberException; -import com.numberone.backend.support.fcm.service.FcmMessageProvider; -import com.numberone.backend.support.s3.S3Provider; +import com.numberone.backend.provider.fcm.service.FcmMessageProvider; +import com.numberone.backend.provider.s3.S3Provider; import com.numberone.backend.util.LocationProvider; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -225,7 +225,7 @@ public CreateCommentResponse createComment(Long articleId, CreateCommentRequest λ‚˜μ˜ κ²Œμ‹œκΈ€μ— %sλ‹˜μ΄ λŒ“κΈ€μ„ λ‹¬μ•˜μ–΄μš”.""", memberName); String body = "λŒ€ν”Όλ‘œμ— μ ‘μ†ν•˜μ—¬ ν™•μΈν•˜μ„Έμš”!"; - fcmMessageProvider.sendFcm(articleOwner, title, body, NotificationTag.COMMUNITY); + fcmMessageProvider.sendFcm(articleOwner.getFcmToken(), title, body); notificationRepository.save( new NotificationEntity(articleOwner, NotificationTag.COMMUNITY, title, body, true) ); diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/comment/service/CommentService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/comment/service/CommentService.java index 1c3617c9..aa9b1642 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/comment/service/CommentService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/comment/service/CommentService.java @@ -21,7 +21,7 @@ import com.numberone.backend.exception.notfound.NotFoundArticleException; import com.numberone.backend.exception.notfound.NotFoundCommentException; import com.numberone.backend.exception.notfound.NotFoundMemberException; -import com.numberone.backend.support.fcm.service.FcmMessageProvider; +import com.numberone.backend.provider.fcm.service.FcmMessageProvider; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -69,7 +69,7 @@ public CreateChildCommentResponse createChildComment( String title = String.format(""" λ‚˜μ˜ λŒ“κΈ€μ— %sλ‹˜μ΄ λŒ“κΈ€μ„ λ‹¬μ•˜μ–΄μš”.""", memberName); String body = "λŒ€ν”Όλ‘œμ— μ ‘μ†ν•˜μ—¬ ν™•μΈν•˜μ„Έμš”!"; - fcmMessageProvider.sendFcm(owner, title, body, NotificationTag.COMMUNITY); + fcmMessageProvider.sendFcm(owner.getFcmToken(), title, body); notificationRepository.save( new NotificationEntity(owner, NotificationTag.COMMUNITY, title, body, true) ); diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterEventHandler.java b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterEventHandler.java index 28cf6092..4bb178b4 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterEventHandler.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterEventHandler.java @@ -12,7 +12,7 @@ import com.numberone.backend.domain.notificationdisaster.repository.NotificationDisasterRepository; import com.numberone.backend.domain.notificationregion.repository.NotificationRegionRepository; import com.numberone.backend.exception.notfound.NotFoundMemberException; -import com.numberone.backend.support.fcm.service.FcmMessageProvider; +import com.numberone.backend.provider.fcm.service.FcmMessageProvider; import jakarta.transaction.Transactional; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -78,7 +78,7 @@ public void sendFcmsPresentLocationAndOnboardingDisasterType(DisasterEvent disas // fcm 메세지 일괄 전솑 log.info("ν˜„μž¬ μž¬λ‚œ μœ„μΉ˜μ— μžˆλŠ”, {} μž¬λ‚œ μœ ν˜•μ„ ν—ˆμš©ν•œ νšŒμ›λ“€μ—κ²Œ μ•Œλ¦Όμ„ μ „μ†‘ν•©λ‹ˆλ‹€.", type); - fcmMessageProvider.sendFcmToMembers(fcmTokensByPresentLocationAndOnboardingDisasterType, title, message, NotificationTag.DISASTER); + fcmMessageProvider.sendFcmToMembers(fcmTokensByPresentLocationAndOnboardingDisasterType, title, message); // μ˜¨λ³΄λ”©λ•Œ μ„ νƒν•œ 지역에 λŒ€ν•œ μ•Œλ¦Όμ„ λ°›κ³ μž ν•˜λŠ” νšŒμ› 리슀트λ₯Ό ν•„ν„°λ§ν•©λ‹ˆλ‹€. // μ΄λ•Œ 쀑볡 μ•Œλ¦Ό λ°œμ†‘μ„ λ°©μ§€ν•˜κΈ° μœ„ν•œ 필터링 μž‘μ—…μ„ λ¨Όμ € μˆ˜ν–‰ν•©λ‹ˆλ‹€. @@ -110,7 +110,7 @@ public void sendFcmsPresentLocationAndOnboardingDisasterType(DisasterEvent disas } return (isRegionMatched && isDisasterTypeMatched) ? Stream.of(member.getFcmToken()) : null; }).filter(Objects::nonNull).toList(); - fcmMessageProvider.sendFcmToMembers(targetFcmsByOnboardingRegionsAndDisasterTypes, title, message, NotificationTag.DISASTER); + fcmMessageProvider.sendFcmToMembers(targetFcmsByOnboardingRegionsAndDisasterTypes, title, message); } @Transactional(jakarta.transaction.Transactional.TxType.REQUIRES_NEW) @@ -141,7 +141,7 @@ public void sendFcmToFriends(DisasterEvent disasterEvent) { %sλ‹˜μ΄ μœ„ν—˜ 지역에 μžˆμ–΄μš”. μ§€κΈˆ λ°”λ‘œ %sλ‹˜μ—κ²Œ μ•ˆλΆ€λ₯Ό λ¬Όμ–΄λ³΄μ„Έμš”! """, memberName, memberName); - fcmMessageProvider.sendFcmToMembers(friendFcmTokens, title, body, NotificationTag.FAMILY); + fcmMessageProvider.sendFcmToMembers(friendFcmTokens, title, body); friendList.forEach(friend -> notificationRepository.save( diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/friendship/service/FriendshipService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/friendship/service/FriendshipService.java index d17fe1ec..2cce3c58 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/friendship/service/FriendshipService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/friendship/service/FriendshipService.java @@ -14,7 +14,7 @@ import com.numberone.backend.exception.badrequest.InvalidInviteTypeException; import com.numberone.backend.exception.notfound.NotFoundFriendshipException; import com.numberone.backend.exception.notfound.NotFoundMemberException; -import com.numberone.backend.support.fcm.service.FcmMessageProvider; +import com.numberone.backend.provider.fcm.service.FcmMessageProvider; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -96,7 +96,7 @@ public SendFcmFriendResponse sendFcmToFriend(Long friendId) { String body = String.format(""" %sλ‹˜μ΄ μ•ˆλΆ€λ₯Ό κΆκΈˆν•΄ν•˜κ³  μžˆμ–΄μš”. κ±±μ •ν•˜κ³  μžˆμ„ %sλ‹˜μ„ μœ„ν•΄ 빨리 μ—°λ½ν•΄μ£Όμ„Έμš”!""", memberName, memberName); - fcmMessageProvider.sendFcm(friend, title, body, NotificationTag.FAMILY); + fcmMessageProvider.sendFcm(friend.getFcmToken(), title, body); notificationRepository.save( new NotificationEntity(friend, NotificationTag.FAMILY, title, body, true) ); diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/like/controller/LikeController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/like/controller/LikeController.java index 7a2ba262..a46baf4d 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/like/controller/LikeController.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/like/controller/LikeController.java @@ -2,7 +2,7 @@ import com.numberone.backend.domain.like.dto.response.response.ArticleLikeResponse; import com.numberone.backend.domain.like.dto.response.response.CommentLikeResponse; -import com.numberone.backend.support.redis.like.service.RedisLockLikeFacade; +import com.numberone.backend.domain.like.service.RedisLockLikeFacade; import io.swagger.v3.oas.annotations.Operation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/like/service/LikeService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/like/service/LikeService.java index ec8b757c..30fb9290 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/like/service/LikeService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/like/service/LikeService.java @@ -19,7 +19,7 @@ import com.numberone.backend.exception.notfound.NotFoundApiException; import com.numberone.backend.exception.notfound.NotFoundCommentException; import com.numberone.backend.exception.notfound.NotFoundMemberException; -import com.numberone.backend.support.fcm.service.FcmMessageProvider; +import com.numberone.backend.provider.fcm.service.FcmMessageProvider; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -65,7 +65,7 @@ public Integer increaseArticleLike(Long articleId) { String title = String.format(""" λ‚˜μ˜ κ²Œμ‹œκΈ€μ— %sλ‹˜μ΄ μ’‹μ•„μš”λ₯Ό λˆŒλ €μ–΄μš”.""", memberName); String body = "λŒ€ν”Όλ‘œμ— μ ‘μ†ν•˜μ—¬ ν™•μΈν•˜μ„Έμš”!"; - fcmMessageProvider.sendFcm(owner, title, body, NotificationTag.COMMUNITY); + fcmMessageProvider.sendFcm(owner.getFcmToken(), title, body); notificationRepository.save( new NotificationEntity(owner, NotificationTag.COMMUNITY, title, body, true) ); @@ -117,7 +117,7 @@ public Integer increaseCommentLike(Long commentId) { String title = String.format(""" λ‚˜μ˜ λŒ“κΈ€μ— %sλ‹˜μ΄ μ’‹μ•„μš”λ₯Ό λˆŒλ €μ–΄μš”.""", memberName); String body = "λŒ€ν”Όλ‘œμ— μ ‘μ†ν•˜μ—¬ ν™•μΈν•˜μ„Έμš”!"; - fcmMessageProvider.sendFcm(owner, title, body, NotificationTag.COMMUNITY); + fcmMessageProvider.sendFcm(owner.getFcmToken(), title, body); notificationRepository.save( new NotificationEntity(owner, NotificationTag.COMMUNITY, title, body, true) ); diff --git a/daepiro-api/src/main/java/com/numberone/backend/support/redis/like/service/RedisLockLikeFacade.java b/daepiro-api/src/main/java/com/numberone/backend/domain/like/service/RedisLockLikeFacade.java similarity index 95% rename from daepiro-api/src/main/java/com/numberone/backend/support/redis/like/service/RedisLockLikeFacade.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/like/service/RedisLockLikeFacade.java index 13c82a57..94281aec 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/support/redis/like/service/RedisLockLikeFacade.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/like/service/RedisLockLikeFacade.java @@ -1,9 +1,9 @@ -package com.numberone.backend.support.redis.like.service; +package com.numberone.backend.domain.like.service; import com.numberone.backend.domain.like.dto.response.response.ArticleLikeResponse; import com.numberone.backend.domain.like.dto.response.response.CommentLikeResponse; import com.numberone.backend.domain.like.service.LikeService; -import com.numberone.backend.support.redis.like.repository.RedisLockRepository; +import com.numberone.backend.domain.like.repository.RedisLockRepository; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/member/service/MemberService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/member/service/MemberService.java index 10945891..c78924c2 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/member/service/MemberService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/member/service/MemberService.java @@ -14,7 +14,7 @@ import com.numberone.backend.domain.notificationregion.repository.NotificationRegionRepository; import com.numberone.backend.domain.token.util.SecurityContextProvider; import com.numberone.backend.exception.notfound.NotFoundMemberException; -import com.numberone.backend.support.s3.S3Provider; +import com.numberone.backend.provider.s3.S3Provider; import com.numberone.backend.util.LocationProvider; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/shelter/service/ShelterService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/shelter/service/ShelterService.java index d8b96dfc..ddca0b92 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/shelter/service/ShelterService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/shelter/service/ShelterService.java @@ -5,7 +5,7 @@ import com.numberone.backend.domain.shelter.repository.ShelterRepository; import com.numberone.backend.domain.shelter.util.ShelterType; import com.numberone.backend.exception.notfound.NotFoundShelterException; -import com.numberone.backend.support.s3.S3Provider; +import com.numberone.backend.provider.s3.S3Provider; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; diff --git a/daepiro-api/src/main/java/com/numberone/backend/support/notification/NotificationMessage.java b/daepiro-api/src/main/java/com/numberone/backend/support/notification/NotificationMessage.java deleted file mode 100644 index 15f24651..00000000 --- a/daepiro-api/src/main/java/com/numberone/backend/support/notification/NotificationMessage.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.numberone.backend.support.notification; - -import lombok.Getter; -import lombok.RequiredArgsConstructor; - -@Getter -@RequiredArgsConstructor -public enum NotificationMessage implements NotificationMessageSpec { - - ARTICLE_COMMENT_FCM_ALARM("[λŒ€ν”Όλ‘œ μ•Œλ¦Ό]", "κ²Œμ‹œκΈ€μ— λŒ“κΈ€μ΄ λ‹¬λ Έμ–΄μš”!", null), - BEST_ARTICLE_FCM_ALARM("[λŒ€ν”Όλ‘œ μ•Œλ¦Ό]", "μΆ•ν•˜λ“œλ¦½λ‹ˆλ‹€! 베슀트 κ²Œμ‹œκΈ€λ‘œ μ„ μ •λ˜μ—ˆμŠ΅λ‹ˆλ‹€. πŸŽ‰", null) - ; - - private final String title; - private final String body; - private final String imageUrl; - -} diff --git a/daepiro-api/src/main/java/com/numberone/backend/support/notification/NotificationMessageSpec.java b/daepiro-api/src/main/java/com/numberone/backend/support/notification/NotificationMessageSpec.java deleted file mode 100644 index e9083410..00000000 --- a/daepiro-api/src/main/java/com/numberone/backend/support/notification/NotificationMessageSpec.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.numberone.backend.support.notification; - -public interface NotificationMessageSpec { - String getTitle(); - String getBody(); - String getImageUrl(); -} diff --git a/daepiro-core/src/main/java/com/numberone/backend/properties/DisasterProperties.java b/daepiro-common/src/main/java/com/numberone/backend/properties/DisasterProperties.java similarity index 84% rename from daepiro-core/src/main/java/com/numberone/backend/properties/DisasterProperties.java rename to daepiro-common/src/main/java/com/numberone/backend/properties/DisasterProperties.java index 7817be61..4032b55b 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/properties/DisasterProperties.java +++ b/daepiro-common/src/main/java/com/numberone/backend/properties/DisasterProperties.java @@ -2,10 +2,10 @@ import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Service; +import org.springframework.stereotype.Component; @Data -@Service +@Component @ConfigurationProperties(prefix = "disaster") public class DisasterProperties { private String apiUrl; diff --git a/daepiro-core/src/main/java/com/numberone/backend/properties/JwtProperties.java b/daepiro-common/src/main/java/com/numberone/backend/properties/JwtProperties.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/properties/JwtProperties.java rename to daepiro-common/src/main/java/com/numberone/backend/properties/JwtProperties.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/properties/KakaoProperties.java b/daepiro-common/src/main/java/com/numberone/backend/properties/KakaoProperties.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/properties/KakaoProperties.java rename to daepiro-common/src/main/java/com/numberone/backend/properties/KakaoProperties.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/properties/NaverProperties.java b/daepiro-common/src/main/java/com/numberone/backend/properties/NaverProperties.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/properties/NaverProperties.java rename to daepiro-common/src/main/java/com/numberone/backend/properties/NaverProperties.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/properties/RedisProperties.java b/daepiro-common/src/main/java/com/numberone/backend/properties/RedisProperties.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/properties/RedisProperties.java rename to daepiro-common/src/main/java/com/numberone/backend/properties/RedisProperties.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/properties/TokenPeriodProperties.java b/daepiro-common/src/main/java/com/numberone/backend/properties/TokenPeriodProperties.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/properties/TokenPeriodProperties.java rename to daepiro-common/src/main/java/com/numberone/backend/properties/TokenPeriodProperties.java diff --git a/daepiro-api/src/main/java/com/numberone/backend/support/fcm/dto/FcmNotificationDto.java b/daepiro-common/src/main/java/com/numberone/backend/provider/fcm/dto/FcmNotificationDto.java similarity index 91% rename from daepiro-api/src/main/java/com/numberone/backend/support/fcm/dto/FcmNotificationDto.java rename to daepiro-common/src/main/java/com/numberone/backend/provider/fcm/dto/FcmNotificationDto.java index 2efa4c6a..788433ce 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/support/fcm/dto/FcmNotificationDto.java +++ b/daepiro-common/src/main/java/com/numberone/backend/provider/fcm/dto/FcmNotificationDto.java @@ -1,4 +1,4 @@ -package com.numberone.backend.support.fcm.dto; +package com.numberone.backend.provider.fcm.dto; import lombok.*; diff --git a/daepiro-api/src/main/java/com/numberone/backend/support/fcm/service/FcmMessageProvider.java b/daepiro-common/src/main/java/com/numberone/backend/provider/fcm/service/FcmMessageProvider.java similarity index 80% rename from daepiro-api/src/main/java/com/numberone/backend/support/fcm/service/FcmMessageProvider.java rename to daepiro-common/src/main/java/com/numberone/backend/provider/fcm/service/FcmMessageProvider.java index ade845d5..263bc175 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/support/fcm/service/FcmMessageProvider.java +++ b/daepiro-common/src/main/java/com/numberone/backend/provider/fcm/service/FcmMessageProvider.java @@ -1,18 +1,13 @@ -package com.numberone.backend.support.fcm.service; +package com.numberone.backend.provider.fcm.service; import com.google.firebase.messaging.*; -import com.numberone.backend.domain.member.entity.Member; -import com.numberone.backend.domain.notification.entity.NotificationTag; import lombok.RequiredArgsConstructor; -import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; -import org.checkerframework.checker.units.qual.A; import org.springframework.stereotype.Component; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.stream.IntStream; @Slf4j @@ -20,13 +15,7 @@ @RequiredArgsConstructor public class FcmMessageProvider { - public void sendFcm(Member member, String title, String body, NotificationTag tag) { - String token = member.getFcmToken(); - if (Objects.isNull(token)) { - log.error("ν•΄λ‹Ή νšŒμ›μ˜ fcm 토큰이 μ‘΄μž¬ν•˜μ§€ μ•Šμ•„, ν‘Έμ‹œμ•ŒλžŒμ„ 전솑할 수 μ—†μŠ΅λ‹ˆλ‹€."); - // todo : μ˜ˆμ™Έ 핸듀링 - return; - } + public void sendFcm(String token, String title, String body) { Message message = Message.builder() .putData("time", LocalDateTime.now().toString()) @@ -48,7 +37,7 @@ public void sendFcm(Member member, String title, String body, NotificationTag ta } } - public void sendFcmToMembers(List tokens, String title, String body, NotificationTag tag) { + public void sendFcmToMembers(List tokens, String title, String body) { log.info("{} 건의 ν‘Έμ‹œμ•ŒλžŒμ„ μ „μ†‘ν•©λ‹ˆλ‹€.", tokens.size()); if (tokens.isEmpty()) return; List messages = tokens.stream().map( diff --git a/daepiro-api/src/main/java/com/numberone/backend/support/s3/S3Provider.java b/daepiro-common/src/main/java/com/numberone/backend/provider/s3/S3Provider.java similarity index 98% rename from daepiro-api/src/main/java/com/numberone/backend/support/s3/S3Provider.java rename to daepiro-common/src/main/java/com/numberone/backend/provider/s3/S3Provider.java index c76c82f2..f7fcc78d 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/support/s3/S3Provider.java +++ b/daepiro-common/src/main/java/com/numberone/backend/provider/s3/S3Provider.java @@ -1,4 +1,4 @@ -package com.numberone.backend.support.s3; +package com.numberone.backend.provider.s3; import com.amazonaws.HttpMethod; import com.amazonaws.services.s3.AmazonS3Client; diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/event/DisasterEvent.java b/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/event/DisasterEvent.java similarity index 100% rename from daepiro-api/src/main/java/com/numberone/backend/domain/disaster/event/DisasterEvent.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/disaster/event/DisasterEvent.java diff --git a/daepiro-crawler/build.gradle b/daepiro-crawler/build.gradle new file mode 100644 index 00000000..6f42a35f --- /dev/null +++ b/daepiro-crawler/build.gradle @@ -0,0 +1,27 @@ +plugins { + id 'java' + id "java-library" + id "java-test-fixtures" +} + +dependencies { + implementation project(':daepiro-common') + implementation project(':daepiro-core') + + implementation 'org.springframework.boot:spring-boot-starter-security' + implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-validation' + + // jpa + implementation 'org.springframework.boot:spring-boot-starter-data-jpa' + + //crawling + implementation 'com.squareup.okhttp3:okhttp:4.9.1' + implementation 'org.jsoup:jsoup:1.14.2' + implementation 'net.sourceforge.htmlunit:htmlunit:2.70.0' +} + +tasks.bootJar { + enabled = false +} + diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterDataCollector.java b/daepiro-crawler/src/main/java/com/numberone/backend/domain/disaster/service/DisasterDataCollector.java similarity index 81% rename from daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterDataCollector.java rename to daepiro-crawler/src/main/java/com/numberone/backend/domain/disaster/service/DisasterDataCollector.java index beb14203..422c541d 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterDataCollector.java +++ b/daepiro-crawler/src/main/java/com/numberone/backend/domain/disaster/service/DisasterDataCollector.java @@ -6,17 +6,19 @@ import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.numberone.backend.domain.disaster.dto.request.SaveDisasterRequest; import com.numberone.backend.domain.disaster.dto.response.DisasterDataResponse; +import com.numberone.backend.domain.disaster.entity.Disaster; +import com.numberone.backend.domain.disaster.event.DisasterEvent; import com.numberone.backend.domain.disaster.repository.DisasterRepository; import com.numberone.backend.domain.disaster.util.DisasterType; import com.numberone.backend.exception.notfound.NotFoundApiException; import com.numberone.backend.exception.notfound.NotFoundCrawlingException; import com.numberone.backend.properties.DisasterProperties; -import jakarta.annotation.PostConstruct; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.select.Elements; +import org.springframework.context.ApplicationEventPublisher; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; import org.springframework.web.client.RestTemplate; @@ -24,7 +26,12 @@ import java.io.IOException; import java.net.URI; -import java.util.*; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; @Service @RequiredArgsConstructor @@ -34,19 +41,10 @@ public class DisasterDataCollector { private final DisasterProperties disasterProperties; private final ObjectMapper objectMapper; private final DisasterRepository disasterRepository; - private final DisasterService disasterService; + private final ApplicationEventPublisher eventPublisher; private Long latestDisasterNum = 0L; private Map disasterTypeMap = new HashMap<>(); - @PostConstruct - public void init() { - disasterRepository.findTopByOrderByDisasterNumDesc().ifPresent( - disaster -> { - latestDisasterNum = disaster.getDisasterNum(); - } - ); - log.info("init latestDisasterNum = " + latestDisasterNum); - } @Scheduled(fixedDelay = 60 * 1000) public void collectData() { @@ -84,7 +82,7 @@ public void collectData() { if (disasterTypeMap.get(disasterNum).equals(DisasterType.OTHERS) && (disaster.getMsg().contains("μ‹€μ’…") || disaster.getMsg().contains("λͺ©κ²©") || disaster.getMsg().contains("배회"))) disasterTypeMap.put(disasterNum, DisasterType.MISSING); - disasterService.save(SaveDisasterRequest.of( + convertAndSave(SaveDisasterRequest.of( disasterTypeMap.get(disasterNum), loc.replace(" 전체", ""),//이 뢀뢄은 λ©”μ‹œμ§€ λ‚΄λΆ€ νŒŒμ‹±ν•˜μ—¬ 더 μ •ν™•ν•œ μ£Όμ†Œλ₯Ό μ €μž₯ν•˜λ„λ‘ μˆ˜μ •ν•΄μ•Όν•¨ disaster.getMsg(), @@ -97,6 +95,23 @@ public void collectData() { } } + private void convertAndSave(SaveDisasterRequest saveDisasterRequest) { + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss"); + LocalDateTime dateTime = LocalDateTime.parse(saveDisasterRequest.getCreatedAt(), formatter); + Disaster savedDisaster = + disasterRepository.save( + Disaster.of( + saveDisasterRequest.getDisasterType(), + saveDisasterRequest.getLocation(), + saveDisasterRequest.getMsg(), + saveDisasterRequest.getDisasterNum(), + dateTime + ) + ); + log.info("μž¬λ‚œ λ°œμƒ 이벀트 λ°œν–‰"); + eventPublisher.publishEvent(DisasterEvent.of(savedDisaster)); // μ‹ κ·œ μž¬λ‚œ λ°œμƒ 이벀트 + } + // private void crawlingDisasterType() { // disasterTypeMap.clear(); // WebClient webClient = new WebClient(); diff --git a/daepiro-redis/build.gradle b/daepiro-redis/build.gradle new file mode 100644 index 00000000..4ba0a3ee --- /dev/null +++ b/daepiro-redis/build.gradle @@ -0,0 +1,19 @@ +plugins { + id 'java' + id "java-library" + id "java-test-fixtures" +} + +dependencies { + implementation project(':daepiro-common') + + implementation 'org.springframework.boot:spring-boot-starter-data-redis' + + implementation 'com.fasterxml.jackson.core:jackson-databind' + + testFixturesRuntimeOnly group: 'it.ozimov', name: 'embedded-redis', version: '0.7.1' +} + +tasks.bootJar { + enabled = false +} diff --git a/daepiro-core/src/main/java/com/numberone/backend/config/RedisConfig.java b/daepiro-redis/src/main/java/com/numberone/backend/config/RedisConfig.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/config/RedisConfig.java rename to daepiro-redis/src/main/java/com/numberone/backend/config/RedisConfig.java diff --git a/daepiro-api/src/main/java/com/numberone/backend/support/redis/like/repository/RedisLockRepository.java b/daepiro-redis/src/main/java/com/numberone/backend/domain/like/repository/RedisLockRepository.java similarity index 90% rename from daepiro-api/src/main/java/com/numberone/backend/support/redis/like/repository/RedisLockRepository.java rename to daepiro-redis/src/main/java/com/numberone/backend/domain/like/repository/RedisLockRepository.java index 8344e4ce..6efa6099 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/support/redis/like/repository/RedisLockRepository.java +++ b/daepiro-redis/src/main/java/com/numberone/backend/domain/like/repository/RedisLockRepository.java @@ -1,4 +1,4 @@ -package com.numberone.backend.support.redis.like.repository; +package com.numberone.backend.domain.like.repository; import lombok.RequiredArgsConstructor; import org.springframework.data.redis.core.RedisTemplate; diff --git a/settings.gradle b/settings.gradle index cd114704..6db14775 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,4 +1,7 @@ rootProject.name = 'Backend' include 'daepiro-api' include 'daepiro-core' -include 'daepiro-common' \ No newline at end of file +include 'daepiro-common' +include 'daepiro-redis' +include 'daepiro-auth' +include 'daepiro-crawler' \ No newline at end of file From cab6774bb18ff9e7a01c7387c2c1c478be8a07dd Mon Sep 17 00:00:00 2001 From: Jaehyeon Date: Tue, 9 Jan 2024 20:48:46 +0900 Subject: [PATCH 08/31] Feat: auth module --- .../backend/domain/user/controller/UserAuthController.java | 5 +++++ .../backend/domain/user/service/UserAuthService.java | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 daepiro-auth/src/main/java/com/numberone/backend/domain/user/controller/UserAuthController.java create mode 100644 daepiro-auth/src/main/java/com/numberone/backend/domain/user/service/UserAuthService.java diff --git a/daepiro-auth/src/main/java/com/numberone/backend/domain/user/controller/UserAuthController.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/user/controller/UserAuthController.java new file mode 100644 index 00000000..153b4bf6 --- /dev/null +++ b/daepiro-auth/src/main/java/com/numberone/backend/domain/user/controller/UserAuthController.java @@ -0,0 +1,5 @@ +package com.numberone.backend.domain.user.controller; + +public class UserAuthController { + // todo: api λͺ¨λ“ˆμ˜ token controller λ₯Ό auth λͺ¨λ“ˆλ‘œ 이관 +} diff --git a/daepiro-auth/src/main/java/com/numberone/backend/domain/user/service/UserAuthService.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/user/service/UserAuthService.java new file mode 100644 index 00000000..ebd7a7e1 --- /dev/null +++ b/daepiro-auth/src/main/java/com/numberone/backend/domain/user/service/UserAuthService.java @@ -0,0 +1,5 @@ +package com.numberone.backend.domain.user.service; + +public class UserAuthService { + // todo: api λͺ¨λ“ˆμ˜ token service λ₯Ό auth λͺ¨λ“ˆλ‘œ 이관 +} From befe8cd81c57dc14f4005f354fbafabfbf2818e2 Mon Sep 17 00:00:00 2001 From: Jaehyeon Date: Tue, 9 Jan 2024 20:50:56 +0900 Subject: [PATCH 09/31] Feat: auth module --- daepiro-auth/build.gradle | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 daepiro-auth/build.gradle diff --git a/daepiro-auth/build.gradle b/daepiro-auth/build.gradle new file mode 100644 index 00000000..d95bf493 --- /dev/null +++ b/daepiro-auth/build.gradle @@ -0,0 +1,28 @@ +dependencies { + implementation project(':daepiro-core') + implementation project(':daepiro-redis') + implementation project(':daepiro-common') + + implementation 'org.springframework.boot:spring-boot-starter-web' + compileOnly 'org.projectlombok:lombok' + developmentOnly 'org.springframework.boot:spring-boot-devtools' + + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation group: 'commons-io', name: 'commons-io', version: '2.10.0' + implementation 'com.googlecode.json-simple:json-simple:1.1' + + implementation 'org.springframework.boot:spring-boot-starter-validation' + + implementation group: 'io.jsonwebtoken', name: 'jjwt-api', version: '0.11.5' + runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-impl', version: '0.11.5' + runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: '0.11.5' + + implementation group: 'org.springframework.boot', name: 'spring-boot-starter-thymeleaf', version: '2.7.3' + implementation 'org.springframework.boot:spring-boot-starter-security' + + implementation 'joda-time:joda-time:2.10.10' +} + +tasks.bootJar { + enabled = false +} From 074a37c3b15789e025f636d4b0a629f758fdc468 Mon Sep 17 00:00:00 2001 From: Jaehyeon Date: Tue, 9 Jan 2024 23:26:04 +0900 Subject: [PATCH 10/31] Feat: removed locationProvider to daepiro-common --- daepiro-api/build.gradle | 3 --- .../backend/domain/article/service/ArticleService.java | 2 +- .../backend/domain/disaster/service/DisasterService.java | 2 +- .../backend/domain/member/service/MemberService.java | 2 +- daepiro-common/build.gradle | 3 +++ .../backend/provider/location}/LocationProvider.java | 4 ++-- .../backend/provider/location}/dto/MapApiResponse.java | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) rename {daepiro-api/src/main/java/com/numberone/backend/util => daepiro-common/src/main/java/com/numberone/backend/provider/location}/LocationProvider.java (92%) rename {daepiro-api/src/main/java/com/numberone/backend/util => daepiro-common/src/main/java/com/numberone/backend/provider/location}/dto/MapApiResponse.java (95%) diff --git a/daepiro-api/build.gradle b/daepiro-api/build.gradle index 9a2c53e7..b707812d 100644 --- a/daepiro-api/build.gradle +++ b/daepiro-api/build.gradle @@ -42,9 +42,6 @@ dependencies { // aop implementation 'org.springframework.boot:spring-boot-starter-aop' - //geocoding - implementation 'com.google.code.geocoder-java:geocoder-java:0.16' - // fcm implementation 'com.google.firebase:firebase-admin:9.1.1' diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/article/service/ArticleService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/article/service/ArticleService.java index 67b92dca..039c1e03 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/article/service/ArticleService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/article/service/ArticleService.java @@ -29,7 +29,7 @@ import com.numberone.backend.exception.notfound.NotFoundMemberException; import com.numberone.backend.provider.fcm.service.FcmMessageProvider; import com.numberone.backend.provider.s3.S3Provider; -import com.numberone.backend.util.LocationProvider; +import com.numberone.backend.provider.location.LocationProvider; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.data.domain.Pageable; diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterService.java index b7cae59a..a20bb405 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterService.java @@ -20,7 +20,7 @@ import com.numberone.backend.domain.notificationregion.entity.NotificationRegion; import com.numberone.backend.exception.badrequest.BadRequestConversationSortException; import com.numberone.backend.exception.notfound.NotFoundDisasterException; -import com.numberone.backend.util.LocationProvider; +import com.numberone.backend.provider.location.LocationProvider; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.context.ApplicationEventPublisher; diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/member/service/MemberService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/member/service/MemberService.java index c78924c2..33861b7a 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/member/service/MemberService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/member/service/MemberService.java @@ -15,7 +15,7 @@ import com.numberone.backend.domain.token.util.SecurityContextProvider; import com.numberone.backend.exception.notfound.NotFoundMemberException; import com.numberone.backend.provider.s3.S3Provider; -import com.numberone.backend.util.LocationProvider; +import com.numberone.backend.provider.location.LocationProvider; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; diff --git a/daepiro-common/build.gradle b/daepiro-common/build.gradle index 48f58ad2..4cf3b4be 100644 --- a/daepiro-common/build.gradle +++ b/daepiro-common/build.gradle @@ -19,6 +19,9 @@ dependencies { // fcm implementation 'com.google.firebase:firebase-admin:9.1.1' + + //geocoding + implementation 'com.google.code.geocoder-java:geocoder-java:0.16' } tasks.bootJar { diff --git a/daepiro-api/src/main/java/com/numberone/backend/util/LocationProvider.java b/daepiro-common/src/main/java/com/numberone/backend/provider/location/LocationProvider.java similarity index 92% rename from daepiro-api/src/main/java/com/numberone/backend/util/LocationProvider.java rename to daepiro-common/src/main/java/com/numberone/backend/provider/location/LocationProvider.java index ba0c2efb..0e1f6533 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/util/LocationProvider.java +++ b/daepiro-common/src/main/java/com/numberone/backend/provider/location/LocationProvider.java @@ -1,7 +1,7 @@ -package com.numberone.backend.util; +package com.numberone.backend.provider.location; import com.numberone.backend.properties.KakaoProperties; -import com.numberone.backend.util.dto.MapApiResponse; +import com.numberone.backend.provider.location.dto.MapApiResponse; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpEntity; diff --git a/daepiro-api/src/main/java/com/numberone/backend/util/dto/MapApiResponse.java b/daepiro-common/src/main/java/com/numberone/backend/provider/location/dto/MapApiResponse.java similarity index 95% rename from daepiro-api/src/main/java/com/numberone/backend/util/dto/MapApiResponse.java rename to daepiro-common/src/main/java/com/numberone/backend/provider/location/dto/MapApiResponse.java index f52de2f9..7a37a94c 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/util/dto/MapApiResponse.java +++ b/daepiro-common/src/main/java/com/numberone/backend/provider/location/dto/MapApiResponse.java @@ -1,4 +1,4 @@ -package com.numberone.backend.util.dto; +package com.numberone.backend.provider.location.dto; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; From eae4d1c66fb65ece9c68076978979cb3e837a986 Mon Sep 17 00:00:00 2001 From: Jaehyeon Date: Sun, 14 Jan 2024 19:07:03 +0900 Subject: [PATCH 11/31] Feat: jmx setup --- .github/workflows/jib-build-depoly.yml | 3 +++ daepiro-api/build.gradle | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/jib-build-depoly.yml b/.github/workflows/jib-build-depoly.yml index f21df09a..ccdd9ae5 100644 --- a/.github/workflows/jib-build-depoly.yml +++ b/.github/workflows/jib-build-depoly.yml @@ -62,6 +62,9 @@ jobs: -Djib.to.auth.username=${{ secrets.DOCKER_USERNAME }} \ -Djib.to.auth.password=${{ secrets.DOCKER_PASSWORD }} \ -Djib.to.image="${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_IMAGE }}:latest" + env: + EC2_PUBLIC_IP: ${{ secrets.EC2_PUBLIC_IP }} + JMX_PORT: ${{ secrets.JMX_PORT }} - name: Get current time uses: 1466587594/get-current-time@v2 diff --git a/daepiro-api/build.gradle b/daepiro-api/build.gradle index b707812d..4a04276e 100644 --- a/daepiro-api/build.gradle +++ b/daepiro-api/build.gradle @@ -54,6 +54,16 @@ tasks.named('test') { useJUnitPlatform() } +def serverIP = System.getenv("EC2_PUBLIC_IP") +if(serverIP == null) { + throw new GradleException("SERVER_IP ν™˜κ²½ λ³€μˆ˜κ°€ μ£Όμž…λ˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€.") +} + +def jmxPort = System.getenv("JMX_PORT") +if(jmxPort == null) { + throw new GradleException("JMX_PORT ν™˜κ²½ λ³€μˆ˜κ°€ μ£Όμž…λ˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€.") +} + jib { from { image = "amazoncorretto:17" @@ -65,7 +75,7 @@ jib { container { mainClass = 'com.numberone.backend.BackendApplication' creationTime = "USE_CURRENT_TIMESTAMP" - jvmFlags = ["-Duser.timezone=Asia/Seoul", "-Xms128m", "-Xmx128m"] + jvmFlags = ["-Duser.timezone=Asia/Seoul", "-Xms128m", "-Xmx128m", "-Dcom.sun.management.jmxremote=true", "-Dcom.sun.management.jmxremote.local.only=false", "-Dcom.sun.management.jmxremote.port="+jmxPort.toString(), "-Dcom.sun.management.jmxremote.ssl=false", "-Dcom.sun.management.jmxremote.authenticate=false", "-Djava.rmi.server.hostname=" + serverIP.toString(), "-Dcom.sun.management.jmxremote.rmi.port="+jmxPort.toString()] ports = ['8080'] } } From a6e33413f1465be20de1f9bbe066ff3d8592312c Mon Sep 17 00:00:00 2001 From: Jaehyeon Date: Sun, 14 Jan 2024 19:17:59 +0900 Subject: [PATCH 12/31] Feat: change jdk base image to openjdk --- daepiro-api/build.gradle | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/daepiro-api/build.gradle b/daepiro-api/build.gradle index 4a04276e..d4652740 100644 --- a/daepiro-api/build.gradle +++ b/daepiro-api/build.gradle @@ -55,18 +55,11 @@ tasks.named('test') { } def serverIP = System.getenv("EC2_PUBLIC_IP") -if(serverIP == null) { - throw new GradleException("SERVER_IP ν™˜κ²½ λ³€μˆ˜κ°€ μ£Όμž…λ˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€.") -} - def jmxPort = System.getenv("JMX_PORT") -if(jmxPort == null) { - throw new GradleException("JMX_PORT ν™˜κ²½ λ³€μˆ˜κ°€ μ£Όμž…λ˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€.") -} jib { from { - image = "amazoncorretto:17" + image = "openjdk:17" } to { image = "versatile0010/numberone" From 9572abadcd9ca9f01b6b0b242f5920051cab2461 Mon Sep 17 00:00:00 2001 From: Jaehyeon Date: Sun, 14 Jan 2024 19:48:36 +0900 Subject: [PATCH 13/31] Feat: heap dump set up --- daepiro-api/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daepiro-api/build.gradle b/daepiro-api/build.gradle index d4652740..678d308d 100644 --- a/daepiro-api/build.gradle +++ b/daepiro-api/build.gradle @@ -68,7 +68,7 @@ jib { container { mainClass = 'com.numberone.backend.BackendApplication' creationTime = "USE_CURRENT_TIMESTAMP" - jvmFlags = ["-Duser.timezone=Asia/Seoul", "-Xms128m", "-Xmx128m", "-Dcom.sun.management.jmxremote=true", "-Dcom.sun.management.jmxremote.local.only=false", "-Dcom.sun.management.jmxremote.port="+jmxPort.toString(), "-Dcom.sun.management.jmxremote.ssl=false", "-Dcom.sun.management.jmxremote.authenticate=false", "-Djava.rmi.server.hostname=" + serverIP.toString(), "-Dcom.sun.management.jmxremote.rmi.port="+jmxPort.toString()] + jvmFlags = ["-Duser.timezone=Asia/Seoul", "-Xms128m", "-Xmx128m", "-Dcom.sun.management.jmxremote=true", "-Dcom.sun.management.jmxremote.local.only=false", "-Dcom.sun.management.jmxremote.port="+jmxPort.toString(), "-Dcom.sun.management.jmxremote.ssl=false", "-Dcom.sun.management.jmxremote.authenticate=false", "-Djava.rmi.server.hostname=" + serverIP.toString(), "-Dcom.sun.management.jmxremote.rmi.port="+jmxPort.toString(), "-XX:+HeapDumpOnOutOfMemoryError", "-XX:HeapDumpPath=/heap-dumps/heapdump.hprof"] ports = ['8080'] } } From a59c8a813bb05698ca9b1040eb155252414e1591 Mon Sep 17 00:00:00 2001 From: Jaehyeon Date: Sun, 14 Jan 2024 19:53:55 +0900 Subject: [PATCH 14/31] Feat: heap dump set up --- daepiro-api/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daepiro-api/build.gradle b/daepiro-api/build.gradle index 678d308d..c7c051e7 100644 --- a/daepiro-api/build.gradle +++ b/daepiro-api/build.gradle @@ -68,7 +68,7 @@ jib { container { mainClass = 'com.numberone.backend.BackendApplication' creationTime = "USE_CURRENT_TIMESTAMP" - jvmFlags = ["-Duser.timezone=Asia/Seoul", "-Xms128m", "-Xmx128m", "-Dcom.sun.management.jmxremote=true", "-Dcom.sun.management.jmxremote.local.only=false", "-Dcom.sun.management.jmxremote.port="+jmxPort.toString(), "-Dcom.sun.management.jmxremote.ssl=false", "-Dcom.sun.management.jmxremote.authenticate=false", "-Djava.rmi.server.hostname=" + serverIP.toString(), "-Dcom.sun.management.jmxremote.rmi.port="+jmxPort.toString(), "-XX:+HeapDumpOnOutOfMemoryError", "-XX:HeapDumpPath=/heap-dumps/heapdump.hprof"] + jvmFlags = ["-Duser.timezone=Asia/Seoul", "-Xms128m", "-Xmx128m", "-Dcom.sun.management.jmxremote=true", "-Dcom.sun.management.jmxremote.local.only=false", "-Dcom.sun.management.jmxremote.port="+jmxPort.toString(), "-Dcom.sun.management.jmxremote.ssl=false", "-Dcom.sun.management.jmxremote.authenticate=false", "-Djava.rmi.server.hostname=" + serverIP.toString(), "-Dcom.sun.management.jmxremote.rmi.port="+jmxPort.toString(), "-XX:+HeapDumpOnOutOfMemoryError", "-XX:HeapDumpPath=./heap-dumps/heapdump.hprof"] ports = ['8080'] } } From 43b808a6f0769c91ae4d4010fe9d67685ff97bed Mon Sep 17 00:00:00 2001 From: Jaehyeon Date: Sun, 14 Jan 2024 20:14:36 +0900 Subject: [PATCH 15/31] Feat: heap dump dir fix --- daepiro-api/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daepiro-api/build.gradle b/daepiro-api/build.gradle index c7c051e7..678d308d 100644 --- a/daepiro-api/build.gradle +++ b/daepiro-api/build.gradle @@ -68,7 +68,7 @@ jib { container { mainClass = 'com.numberone.backend.BackendApplication' creationTime = "USE_CURRENT_TIMESTAMP" - jvmFlags = ["-Duser.timezone=Asia/Seoul", "-Xms128m", "-Xmx128m", "-Dcom.sun.management.jmxremote=true", "-Dcom.sun.management.jmxremote.local.only=false", "-Dcom.sun.management.jmxremote.port="+jmxPort.toString(), "-Dcom.sun.management.jmxremote.ssl=false", "-Dcom.sun.management.jmxremote.authenticate=false", "-Djava.rmi.server.hostname=" + serverIP.toString(), "-Dcom.sun.management.jmxremote.rmi.port="+jmxPort.toString(), "-XX:+HeapDumpOnOutOfMemoryError", "-XX:HeapDumpPath=./heap-dumps/heapdump.hprof"] + jvmFlags = ["-Duser.timezone=Asia/Seoul", "-Xms128m", "-Xmx128m", "-Dcom.sun.management.jmxremote=true", "-Dcom.sun.management.jmxremote.local.only=false", "-Dcom.sun.management.jmxremote.port="+jmxPort.toString(), "-Dcom.sun.management.jmxremote.ssl=false", "-Dcom.sun.management.jmxremote.authenticate=false", "-Djava.rmi.server.hostname=" + serverIP.toString(), "-Dcom.sun.management.jmxremote.rmi.port="+jmxPort.toString(), "-XX:+HeapDumpOnOutOfMemoryError", "-XX:HeapDumpPath=/heap-dumps/heapdump.hprof"] ports = ['8080'] } } From 4d2ab31a14ccf7cf43e80cb0637bdc5af3c8e687 Mon Sep 17 00:00:00 2001 From: Jaehyeon Date: Sat, 3 Feb 2024 12:30:29 +0900 Subject: [PATCH 16/31] Feat: custom slack noti --- .github/workflows/jib-build-depoly.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/jib-build-depoly.yml b/.github/workflows/jib-build-depoly.yml index ccdd9ae5..ea8ac048 100644 --- a/.github/workflows/jib-build-depoly.yml +++ b/.github/workflows/jib-build-depoly.yml @@ -96,8 +96,24 @@ jobs: - name: πŸ”” Send Slack Message uses: 8398a7/action-slack@v3 with: - status: ${{ job.status }} - fields: repo, message, commit, author, action, eventName, ref, workflow, pullRequest + status: custom + custom_payload: | + { + "attachments": [{ + "color": "${{ job.status == 'success' ? '#36a64f' : '#ff4d4d' }}", + "pretext": "Workflow ${{{ job.status == 'success' ? 'Succeeded' : 'Failed' }}} :tada:", + "fields": [{ + "title": "Repository", + "value": "${{ github.repository }}", + "short": true + }, { + "title": "Actor", + "value": "${{ github.actor }}", + "short": true + }] + }] + } + fields: repo, message, author env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} if: always() \ No newline at end of file From d7726c02a79ecde12a19745c4db1723e7edf46ca Mon Sep 17 00:00:00 2001 From: Jaehyeon Date: Sat, 3 Feb 2024 12:35:20 +0900 Subject: [PATCH 17/31] Revert "Feat: custom slack noti" This reverts commit 4d2ab31a14ccf7cf43e80cb0637bdc5af3c8e687. --- .github/workflows/jib-build-depoly.yml | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/.github/workflows/jib-build-depoly.yml b/.github/workflows/jib-build-depoly.yml index ea8ac048..ccdd9ae5 100644 --- a/.github/workflows/jib-build-depoly.yml +++ b/.github/workflows/jib-build-depoly.yml @@ -96,24 +96,8 @@ jobs: - name: πŸ”” Send Slack Message uses: 8398a7/action-slack@v3 with: - status: custom - custom_payload: | - { - "attachments": [{ - "color": "${{ job.status == 'success' ? '#36a64f' : '#ff4d4d' }}", - "pretext": "Workflow ${{{ job.status == 'success' ? 'Succeeded' : 'Failed' }}} :tada:", - "fields": [{ - "title": "Repository", - "value": "${{ github.repository }}", - "short": true - }, { - "title": "Actor", - "value": "${{ github.actor }}", - "short": true - }] - }] - } - fields: repo, message, author + status: ${{ job.status }} + fields: repo, message, commit, author, action, eventName, ref, workflow, pullRequest env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} if: always() \ No newline at end of file From e6ad6417901db13e7c2b721343c5658f088fb294 Mon Sep 17 00:00:00 2001 From: Jaehyeon Date: Sat, 3 Feb 2024 12:43:23 +0900 Subject: [PATCH 18/31] Feat: custom slack noti --- .github/workflows/jib-build-depoly.yml | 39 ++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/.github/workflows/jib-build-depoly.yml b/.github/workflows/jib-build-depoly.yml index ccdd9ae5..c51b647b 100644 --- a/.github/workflows/jib-build-depoly.yml +++ b/.github/workflows/jib-build-depoly.yml @@ -92,12 +92,47 @@ jobs: docker-compose up -d docker image prune -f + + - name: Set deployment status + if: always() + run: | + if [ "${{ steps.deploy.outcome }}" == "success" ]; then + echo "DEPLOY_MESSAGE=Deployment Succeeded :tada:" >> $GITHUB_ENV + else + echo "DEPLOY_MESSAGE=Deployment Failed :x:" >> $GITHUB_ENV + fi + ## notify at Slack - name: πŸ”” Send Slack Message uses: 8398a7/action-slack@v3 with: - status: ${{ job.status }} - fields: repo, message, commit, author, action, eventName, ref, workflow, pullRequest + status: custom + custom_payload: | + { + "attachments": [ + { + "color": "#36a64f", + "pretext": "{{ env.DEPLOY_MESSAGE }}", + "fields": [ + { + "title": "Repository", + "value": "${{ github.repository }}", + "short": true + }, + { + "title": "Commit", + "value": "${{ github.sha }}", + "short": true, + }, + { + "title": "Author", + "value": "${{ github.actor }}", + "short": true + }, + ] + } + ] + } env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} if: always() \ No newline at end of file From 3826d7ec7a0344860ee8e9a75633e34ff7f76d57 Mon Sep 17 00:00:00 2001 From: Jaehyeon Date: Sat, 3 Feb 2024 12:47:07 +0900 Subject: [PATCH 19/31] Feat: custom slack noti --- .github/workflows/jib-build-depoly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/jib-build-depoly.yml b/.github/workflows/jib-build-depoly.yml index c51b647b..ceca6fff 100644 --- a/.github/workflows/jib-build-depoly.yml +++ b/.github/workflows/jib-build-depoly.yml @@ -112,7 +112,7 @@ jobs: "attachments": [ { "color": "#36a64f", - "pretext": "{{ env.DEPLOY_MESSAGE }}", + "pretext": "${{ env.DEPLOY_MESSAGE }}", "fields": [ { "title": "Repository", From 5f4507d318d28ab975ef2ee710c4200e029c5a25 Mon Sep 17 00:00:00 2001 From: Jaehyeon Date: Sat, 3 Feb 2024 12:48:50 +0900 Subject: [PATCH 20/31] Revert "Feat: custom slack noti" This reverts commit 3826d7ec7a0344860ee8e9a75633e34ff7f76d57. --- .github/workflows/jib-build-depoly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/jib-build-depoly.yml b/.github/workflows/jib-build-depoly.yml index ceca6fff..c51b647b 100644 --- a/.github/workflows/jib-build-depoly.yml +++ b/.github/workflows/jib-build-depoly.yml @@ -112,7 +112,7 @@ jobs: "attachments": [ { "color": "#36a64f", - "pretext": "${{ env.DEPLOY_MESSAGE }}", + "pretext": "{{ env.DEPLOY_MESSAGE }}", "fields": [ { "title": "Repository", From 695ee79a03c1ff1903d55ee33288c87181092418 Mon Sep 17 00:00:00 2001 From: Jaehyeon Date: Sat, 3 Feb 2024 12:48:50 +0900 Subject: [PATCH 21/31] Revert "Feat: custom slack noti" This reverts commit e6ad6417901db13e7c2b721343c5658f088fb294. --- .github/workflows/jib-build-depoly.yml | 39 ++------------------------ 1 file changed, 2 insertions(+), 37 deletions(-) diff --git a/.github/workflows/jib-build-depoly.yml b/.github/workflows/jib-build-depoly.yml index c51b647b..ccdd9ae5 100644 --- a/.github/workflows/jib-build-depoly.yml +++ b/.github/workflows/jib-build-depoly.yml @@ -92,47 +92,12 @@ jobs: docker-compose up -d docker image prune -f - - - name: Set deployment status - if: always() - run: | - if [ "${{ steps.deploy.outcome }}" == "success" ]; then - echo "DEPLOY_MESSAGE=Deployment Succeeded :tada:" >> $GITHUB_ENV - else - echo "DEPLOY_MESSAGE=Deployment Failed :x:" >> $GITHUB_ENV - fi - ## notify at Slack - name: πŸ”” Send Slack Message uses: 8398a7/action-slack@v3 with: - status: custom - custom_payload: | - { - "attachments": [ - { - "color": "#36a64f", - "pretext": "{{ env.DEPLOY_MESSAGE }}", - "fields": [ - { - "title": "Repository", - "value": "${{ github.repository }}", - "short": true - }, - { - "title": "Commit", - "value": "${{ github.sha }}", - "short": true, - }, - { - "title": "Author", - "value": "${{ github.actor }}", - "short": true - }, - ] - } - ] - } + status: ${{ job.status }} + fields: repo, message, commit, author, action, eventName, ref, workflow, pullRequest env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} if: always() \ No newline at end of file From 95e968bbcbbad08bd31421c7b651625ab73671ae Mon Sep 17 00:00:00 2001 From: Jaehyeon Date: Sat, 3 Feb 2024 12:51:30 +0900 Subject: [PATCH 22/31] Feat: custom slack noti --- .github/workflows/jib-build-depoly.yml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/jib-build-depoly.yml b/.github/workflows/jib-build-depoly.yml index ccdd9ae5..bfa7d71b 100644 --- a/.github/workflows/jib-build-depoly.yml +++ b/.github/workflows/jib-build-depoly.yml @@ -33,6 +33,30 @@ jobs: - name: 🐧 Grant execute permission for gradlew run: chmod +x gradlew + - name: πŸ”” Send Slack Message when deploy started + uses: 8398a7/action-slack@v3 + with: + status: custom + custom_payload: | + { + "attachments": [ + { + "color": "#36a64f", + "pretext": "λŒ€ν”Όλ‘œ λ°±μ—”λ“œ 배포 μ‹œμž‘!", + "fields": [ + { + "title": "Author", + "value": "${{ github.actor }}", + "short": true + }, + ] + } + ] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + if: always() + - name: πŸ”‘ Login to Docker Hub uses: docker/login-action@v2.1.0 with: @@ -97,7 +121,7 @@ jobs: uses: 8398a7/action-slack@v3 with: status: ${{ job.status }} - fields: repo, message, commit, author, action, eventName, ref, workflow, pullRequest + fields: repo, message, commit, author, workflow env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} if: always() \ No newline at end of file From c0f7dafa28435e1fafd080bdbaa3dcb818100af9 Mon Sep 17 00:00:00 2001 From: Jaehyeon Date: Sat, 3 Feb 2024 12:56:00 +0900 Subject: [PATCH 23/31] Feat: custom slack noti --- .github/workflows/jib-build-depoly.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/jib-build-depoly.yml b/.github/workflows/jib-build-depoly.yml index bfa7d71b..ea573264 100644 --- a/.github/workflows/jib-build-depoly.yml +++ b/.github/workflows/jib-build-depoly.yml @@ -33,6 +33,10 @@ jobs: - name: 🐧 Grant execute permission for gradlew run: chmod +x gradlew + + - name: get Current Time + run: echo "CURRENT_TIME=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_ENV + - name: πŸ”” Send Slack Message when deploy started uses: 8398a7/action-slack@v3 with: @@ -41,14 +45,17 @@ jobs: { "attachments": [ { - "color": "#36a64f", - "pretext": "λŒ€ν”Όλ‘œ λ°±μ—”λ“œ 배포 μ‹œμž‘!", + "pretext": "λŒ€ν”Όλ‘œ λ°±μ—”λ“œ 배포 μ‹œμž‘ πŸ‘»", "fields": [ { - "title": "Author", + "title": "Author πŸ§‘β€πŸ’»", "value": "${{ github.actor }}", "short": true }, + { + "title": "Deploy time πŸ•š", + "value": "${{ env.CURRENT_TIME }}", + "short": true ] } ] From d48ef04214ebe19fc8ad87307a5e4e807759e0df Mon Sep 17 00:00:00 2001 From: Jaehyeon Date: Sat, 3 Feb 2024 12:56:43 +0900 Subject: [PATCH 24/31] Feat: custom slack noti --- .github/workflows/jib-build-depoly.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/jib-build-depoly.yml b/.github/workflows/jib-build-depoly.yml index ea573264..cb48b544 100644 --- a/.github/workflows/jib-build-depoly.yml +++ b/.github/workflows/jib-build-depoly.yml @@ -56,6 +56,7 @@ jobs: "title": "Deploy time πŸ•š", "value": "${{ env.CURRENT_TIME }}", "short": true + } ] } ] From ed5397980d8d062167d4fbffa1aeaf888a69b220 Mon Sep 17 00:00:00 2001 From: Jaehyeon Date: Sat, 3 Feb 2024 13:02:05 +0900 Subject: [PATCH 25/31] Feat: custom slack noti --- .github/workflows/jib-build-depoly.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/jib-build-depoly.yml b/.github/workflows/jib-build-depoly.yml index cb48b544..21e690ec 100644 --- a/.github/workflows/jib-build-depoly.yml +++ b/.github/workflows/jib-build-depoly.yml @@ -45,10 +45,12 @@ jobs: { "attachments": [ { + "title": "Slack Noti", + "text": "Slack text", "pretext": "λŒ€ν”Όλ‘œ λ°±μ—”λ“œ 배포 μ‹œμž‘ πŸ‘»", "fields": [ { - "title": "Author πŸ§‘β€πŸ’»", + "title": "Author πŸ’»", "value": "${{ github.actor }}", "short": true }, From a91371c63c40b0f2c55f8e8ab317111a79123b93 Mon Sep 17 00:00:00 2001 From: Jaehyeon Date: Sat, 3 Feb 2024 13:08:52 +0900 Subject: [PATCH 26/31] Feat: custom slack noti --- .github/workflows/jib-build-depoly.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/jib-build-depoly.yml b/.github/workflows/jib-build-depoly.yml index 21e690ec..a87b7836 100644 --- a/.github/workflows/jib-build-depoly.yml +++ b/.github/workflows/jib-build-depoly.yml @@ -45,9 +45,8 @@ jobs: { "attachments": [ { - "title": "Slack Noti", - "text": "Slack text", - "pretext": "λŒ€ν”Όλ‘œ λ°±μ—”λ“œ 배포 μ‹œμž‘ πŸ‘»", + "title": "λŒ€ν”Όλ‘œ λ°±μ—”λ“œ 배포λ₯Ό μ‹œμž‘ν•©λ‹ˆλ‹€. πŸ‘»", + "pretext": "Daepiro backend is deploying...", "fields": [ { "title": "Author πŸ’»", From 86dc067a077e317710828d22be8e7881df96b0f2 Mon Sep 17 00:00:00 2001 From: Jaehyeon Date: Sat, 3 Feb 2024 13:23:46 +0900 Subject: [PATCH 27/31] Feat: set up bootJar disabled, jar enabled at core module --- daepiro-core/build.gradle | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/daepiro-core/build.gradle b/daepiro-core/build.gradle index 54d3ff24..af2ded62 100644 --- a/daepiro-core/build.gradle +++ b/daepiro-core/build.gradle @@ -21,6 +21,14 @@ repositories { mavenCentral() } +bootJar { + enabled = false +} + +jar { + enabled = true +} + dependencies { implementation project(':daepiro-common') From a60edad362c13f91ae38fd0a55cfc4353253b7c3 Mon Sep 17 00:00:00 2001 From: Jaehyeon Date: Sat, 3 Feb 2024 13:25:10 +0900 Subject: [PATCH 28/31] Feat: exclude deploy target branch - main - feat/multi-module --- .github/workflows/jib-build-depoly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/jib-build-depoly.yml b/.github/workflows/jib-build-depoly.yml index a87b7836..9acee022 100644 --- a/.github/workflows/jib-build-depoly.yml +++ b/.github/workflows/jib-build-depoly.yml @@ -3,7 +3,7 @@ name: NumberOne-Backend-JIB-BUILD-DEPLOY # event trigger on: push: - branches: [ "main", "dev", "dev-check", "feat/multi-module" ] + branches: [ "dev", "dev-check" ] permissions: write-all From f51c13a0afe4250919a8289bff2e5da42081deb4 Mon Sep 17 00:00:00 2001 From: Jaehyeon Date: Sun, 18 Feb 2024 13:39:09 +0900 Subject: [PATCH 29/31] Feat: module architecture renewed --- .github/workflows/jib-build-depoly.yml | 8 +- daepiro-api/build.gradle | 29 +------- .../admin/controller/AdminController.java | 40 +++++----- .../admin/dto/SaveAdminDisasterRequest.java | 10 +-- .../domain/admin/service/AdminService.java | 2 +- .../article/controller/ArticleController.java | 19 +++-- .../parameter/ArticleSearchParameterDto.java | 27 +++++++ .../dto/request/ModifyArticleRequest.java | 0 .../dto/request/UploadArticleRequest.java | 0 .../dto/response/DeleteArticleResponse.java | 0 .../response/GetArticleDetailResponse.java | 0 .../dto/response/ModifyArticleResponse.java | 0 .../dto/response/UploadArticleResponse.java | 0 .../article/service/ArticleService.java | 5 +- .../comment/controller/CommentController.java | 3 +- .../request/CreateChildCommentRequest.java | 0 .../dto/request/CreateCommentRequest.java | 0 .../response/CreateChildCommentResponse.java | 0 .../dto/response/CreateCommentResponse.java | 0 .../dto/response/DeleteCommentResponse.java | 0 .../comment/service/CommentService.java | 4 +- .../controller/ConversationController.java | 2 - .../CreateChildConversationRequest.java | 0 .../request/CreateConversationRequest.java | 0 .../dto/response/GetConversationResponse.java | 0 .../dto/request/LatestDisasterRequest.java | 0 .../dto/response/LatestDisasterResponse.java | 2 +- .../dto/response/SituationDetailResponse.java | 0 .../dto/response/SituationHomeResponse.java | 0 .../dto/response/SituationResponse.java | 2 +- .../service/DisasterEventHandler.java | 2 +- .../disaster/service/DisasterService.java | 6 +- .../dto/response/FriendResponse.java | 0 .../dto/response/InviteFriendResponse.java | 0 .../dto/response/SendFcmFriendResponse.java | 0 .../friendship/service/FriendshipService.java | 2 +- .../like/controller/LikeController.java | 4 +- .../dto}/response/ArticleLikeResponse.java | 2 +- .../dto}/response/CommentLikeResponse.java | 2 +- .../domain/like/service/LikeService.java | 2 +- .../like/service/RedisLockLikeFacade.java | 5 +- .../member/controller/MemberController.java | 3 - .../member/dto/request/BuyHeartRequest.java | 0 .../member/dto/request/OnboardingAddress.java | 0 .../dto/request/OnboardingDisasterType.java | 0 .../member/dto/request/OnboardingRequest.java | 0 .../member/dto/request/UpdateGpsRequest.java | 0 .../dto/request/UpdateSafetyRequest.java | 0 .../GetNotificationRegionResponse.java | 0 .../member/dto/response/HeartCntResponse.java | 0 .../member/dto/response/MemberIdResponse.java | 0 .../response/UploadProfileImageResponse.java | 0 .../domain/member/service/MemberService.java | 8 +- .../controller/NotificationController.java | 13 ++-- .../NotificationSearchParameterDto.java | 21 ++++++ .../service/NotificationService.java | 4 +- .../dto/request/NearbyShelterRequest.java | 0 .../GetShelterDatabaseUrlResponse.java | 0 .../response/NearbyShelterListResponse.java | 1 + .../dto/response/NearestShelterResponse.java | 1 + .../shelter/service/ShelterService.java | 3 +- .../dto/response/SponsorHomeResponse.java | 0 .../sponsor/dto/response/SponsorResponse.java | 0 .../support/controller/SupportController.java | 1 - .../dto/request/CreateSupportRequest.java | 0 .../dto/request/EditMessageRequest.java | 0 .../dto/response/CreateSupportResponse.java | 0 .../backend/BackendApplicationTests.java | 13 ---- daepiro-app/build.gradle | 74 +++++++++++++++++++ .../numberone/backend/BackendApplication.java | 0 .../numberone/backend/HelloController.java | 0 .../backend/LoginTestController.java | 0 .../numberone/backend/LoginTestResponse.java | 0 daepiro-auth/build.gradle | 24 +++--- .../domain}/config/SecurityConfig.java | 4 +- .../backend/domain/filter}/JwtFilter.java | 16 ++-- .../domain}/properties/JwtProperties.java | 2 +- .../domain}/properties/KakaoProperties.java | 2 +- .../domain}/properties/NaverProperties.java | 2 +- .../properties/TokenPeriodProperties.java | 2 +- .../backend/domain/service/JwtProvider.java | 6 +- .../backend/domain}/service/TokenService.java | 23 +++--- .../{user => }/service/UserAuthService.java | 2 +- .../token/controller/TokenController.java | 34 ++++----- .../token/dto/request/GetTokenRequest.java | 0 .../dto/request/RefreshTokenRequest.java | 0 .../token/dto/response/GetTokenResponse.java | 0 .../token/dto/response/KakaoInfoResponse.java | 0 .../dto/response/KakaoTokenResponse.java | 0 .../token/dto/response/NaverInfoResponse.java | 0 .../dto/response/NaverTokenResponse.java | 0 .../dto/response/RefreshTokenResponse.java | 0 .../user/controller/UserAuthController.java | 5 -- .../backend/config/SwaggerConfig.java | 2 +- .../properties/KakaoMapProperties.java | 13 ++++ .../provider/location/LocationProvider.java | 4 +- .../security}/SecurityContextProvider.java | 2 +- .../dto/response/GetAddressResponse.java | 2 +- .../CreateDisasterEventDto.java | 4 +- .../ArticleSearchParameter.java | 2 +- .../custom/ArticleRepositoryCustom.java | 2 +- .../custom/ArticleRepositoryCustomImpl.java | 2 +- .../dto/{response => }/GetCommentDto.java | 2 +- .../custom/CommentRepositoryCustom.java | 2 +- .../custom/CommentRepositoryCustomImpl.java | 4 +- .../disaster/{util => }/DisasterType.java | 2 +- .../domain/disaster/entity/Disaster.java | 2 +- .../domain/disaster/event/DisasterEvent.java | 2 +- .../NotificationSearchParameter.java | 3 +- .../entity/NotificationEntity.java | 2 +- .../custom/NotificationRepositoryCustom.java | 2 +- .../NotificationRepositoryCustomImpl.java | 6 +- .../entity/NotificationDisaster.java | 2 +- .../domain/shelter/{util => }/Address.java | 2 +- .../shelter/{util => }/ShelterStatus.java | 2 +- .../shelter/{util => }/ShelterType.java | 2 +- .../GetAllSheltersResponse.java | 2 +- .../dto/{response => }/ShelterMapper.java | 2 +- .../domain/shelter/entity/Shelter.java | 6 +- .../shelter/repository/ShelterRepository.java | 2 +- .../custom/CustomShelterRepository.java | 2 +- .../custom/CustomShelterRepositoryImpl.java | 10 +-- .../domain/sponsor/entity/Sponsor.java | 2 +- .../service/DisasterDataCollector.java | 6 +- .../service/dto}/DisasterDataResponse.java | 2 +- .../service/dto/SaveDisasterRequest.java | 27 +++++++ .../backend/domain/token/entity/Token.java | 0 .../token/repository/TokenRepository.java | 0 settings.gradle | 1 + 129 files changed, 344 insertions(+), 228 deletions(-) rename daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/request/SaveDisasterRequest.java => daepiro-api/src/main/java/com/numberone/backend/domain/admin/dto/SaveAdminDisasterRequest.java (74%) create mode 100644 daepiro-api/src/main/java/com/numberone/backend/domain/article/dto/parameter/ArticleSearchParameterDto.java rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/article/dto/request/ModifyArticleRequest.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/article/dto/request/UploadArticleRequest.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/article/dto/response/DeleteArticleResponse.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/article/dto/response/GetArticleDetailResponse.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/article/dto/response/ModifyArticleResponse.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/article/dto/response/UploadArticleResponse.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/comment/dto/request/CreateChildCommentRequest.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/comment/dto/request/CreateCommentRequest.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/comment/dto/response/CreateChildCommentResponse.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/comment/dto/response/CreateCommentResponse.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/comment/dto/response/DeleteCommentResponse.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/conversation/dto/request/CreateChildConversationRequest.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/conversation/dto/request/CreateConversationRequest.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/conversation/dto/response/GetConversationResponse.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/disaster/dto/request/LatestDisasterRequest.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/disaster/dto/response/LatestDisasterResponse.java (96%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationDetailResponse.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationHomeResponse.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationResponse.java (97%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/friendship/dto/response/FriendResponse.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/friendship/dto/response/InviteFriendResponse.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/friendship/dto/response/SendFcmFriendResponse.java (100%) rename {daepiro-core/src/main/java/com/numberone/backend/domain/like/dto/response => daepiro-api/src/main/java/com/numberone/backend/domain/like/dto}/response/ArticleLikeResponse.java (77%) rename {daepiro-core/src/main/java/com/numberone/backend/domain/like/dto/response => daepiro-api/src/main/java/com/numberone/backend/domain/like/dto}/response/CommentLikeResponse.java (77%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/member/dto/request/BuyHeartRequest.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingAddress.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingDisasterType.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingRequest.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/member/dto/request/UpdateGpsRequest.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/member/dto/request/UpdateSafetyRequest.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/member/dto/response/GetNotificationRegionResponse.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/member/dto/response/HeartCntResponse.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/member/dto/response/MemberIdResponse.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/member/dto/response/UploadProfileImageResponse.java (100%) create mode 100644 daepiro-api/src/main/java/com/numberone/backend/domain/notification/dto/request/NotificationSearchParameterDto.java rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/shelter/dto/request/NearbyShelterRequest.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/shelter/dto/response/GetShelterDatabaseUrlResponse.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/shelter/dto/response/NearbyShelterListResponse.java (95%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/shelter/dto/response/NearestShelterResponse.java (92%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/sponsor/dto/response/SponsorHomeResponse.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/sponsor/dto/response/SponsorResponse.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/support/dto/request/CreateSupportRequest.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/support/dto/request/EditMessageRequest.java (100%) rename {daepiro-core => daepiro-api}/src/main/java/com/numberone/backend/domain/support/dto/response/CreateSupportResponse.java (100%) delete mode 100644 daepiro-api/src/test/java/com/numberone/backend/BackendApplicationTests.java create mode 100644 daepiro-app/build.gradle rename {daepiro-api => daepiro-app}/src/main/java/com/numberone/backend/BackendApplication.java (100%) rename {daepiro-api => daepiro-app}/src/main/java/com/numberone/backend/HelloController.java (100%) rename {daepiro-api => daepiro-app}/src/main/java/com/numberone/backend/LoginTestController.java (100%) rename {daepiro-api => daepiro-app}/src/main/java/com/numberone/backend/LoginTestResponse.java (100%) rename {daepiro-api/src/main/java/com/numberone/backend/auth => daepiro-auth/src/main/java/com/numberone/backend/domain}/config/SecurityConfig.java (96%) rename {daepiro-api/src/main/java/com/numberone/backend/auth/global => daepiro-auth/src/main/java/com/numberone/backend/domain/filter}/JwtFilter.java (90%) rename {daepiro-common/src/main/java/com/numberone/backend => daepiro-auth/src/main/java/com/numberone/backend/domain}/properties/JwtProperties.java (84%) rename {daepiro-common/src/main/java/com/numberone/backend => daepiro-auth/src/main/java/com/numberone/backend/domain}/properties/KakaoProperties.java (89%) rename {daepiro-common/src/main/java/com/numberone/backend => daepiro-auth/src/main/java/com/numberone/backend/domain}/properties/NaverProperties.java (89%) rename {daepiro-common/src/main/java/com/numberone/backend => daepiro-auth/src/main/java/com/numberone/backend/domain}/properties/TokenPeriodProperties.java (86%) rename daepiro-core/src/main/java/com/numberone/backend/domain/token/util/JwtUtil.java => daepiro-auth/src/main/java/com/numberone/backend/domain/service/JwtProvider.java (92%) rename {daepiro-api/src/main/java/com/numberone/backend/domain/token => daepiro-auth/src/main/java/com/numberone/backend/domain}/service/TokenService.java (85%) rename daepiro-auth/src/main/java/com/numberone/backend/domain/{user => }/service/UserAuthService.java (66%) rename {daepiro-api => daepiro-auth}/src/main/java/com/numberone/backend/domain/token/controller/TokenController.java (62%) rename {daepiro-core => daepiro-auth}/src/main/java/com/numberone/backend/domain/token/dto/request/GetTokenRequest.java (100%) rename {daepiro-core => daepiro-auth}/src/main/java/com/numberone/backend/domain/token/dto/request/RefreshTokenRequest.java (100%) rename {daepiro-core => daepiro-auth}/src/main/java/com/numberone/backend/domain/token/dto/response/GetTokenResponse.java (100%) rename {daepiro-core => daepiro-auth}/src/main/java/com/numberone/backend/domain/token/dto/response/KakaoInfoResponse.java (100%) rename {daepiro-core => daepiro-auth}/src/main/java/com/numberone/backend/domain/token/dto/response/KakaoTokenResponse.java (100%) rename {daepiro-core => daepiro-auth}/src/main/java/com/numberone/backend/domain/token/dto/response/NaverInfoResponse.java (100%) rename {daepiro-core => daepiro-auth}/src/main/java/com/numberone/backend/domain/token/dto/response/NaverTokenResponse.java (100%) rename {daepiro-core => daepiro-auth}/src/main/java/com/numberone/backend/domain/token/dto/response/RefreshTokenResponse.java (100%) delete mode 100644 daepiro-auth/src/main/java/com/numberone/backend/domain/user/controller/UserAuthController.java create mode 100644 daepiro-common/src/main/java/com/numberone/backend/properties/KakaoMapProperties.java rename {daepiro-core/src/main/java/com/numberone/backend/domain/token/util => daepiro-common/src/main/java/com/numberone/backend/provider/security}/SecurityContextProvider.java (92%) rename daepiro-core/src/main/java/com/numberone/backend/domain/admin/{dto/request => event}/CreateDisasterEventDto.java (71%) rename daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/{response => parameter}/ArticleSearchParameter.java (86%) rename daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/{response => }/GetCommentDto.java (97%) rename daepiro-core/src/main/java/com/numberone/backend/domain/disaster/{util => }/DisasterType.java (98%) rename daepiro-core/src/main/java/com/numberone/backend/domain/notification/dto/{request => parameter}/NotificationSearchParameter.java (76%) rename daepiro-core/src/main/java/com/numberone/backend/domain/shelter/{util => }/Address.java (94%) rename daepiro-core/src/main/java/com/numberone/backend/domain/shelter/{util => }/ShelterStatus.java (76%) rename daepiro-core/src/main/java/com/numberone/backend/domain/shelter/{util => }/ShelterType.java (92%) rename daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/{response => }/GetAllSheltersResponse.java (96%) rename daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/{response => }/ShelterMapper.java (72%) rename {daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/response => daepiro-crawler/src/main/java/com/numberone/backend/domain/disaster/service/dto}/DisasterDataResponse.java (97%) create mode 100644 daepiro-crawler/src/main/java/com/numberone/backend/domain/disaster/service/dto/SaveDisasterRequest.java rename {daepiro-core => daepiro-redis}/src/main/java/com/numberone/backend/domain/token/entity/Token.java (100%) rename {daepiro-core => daepiro-redis}/src/main/java/com/numberone/backend/domain/token/repository/TokenRepository.java (100%) diff --git a/.github/workflows/jib-build-depoly.yml b/.github/workflows/jib-build-depoly.yml index 9acee022..0f0f6b5a 100644 --- a/.github/workflows/jib-build-depoly.yml +++ b/.github/workflows/jib-build-depoly.yml @@ -3,7 +3,7 @@ name: NumberOne-Backend-JIB-BUILD-DEPLOY # event trigger on: push: - branches: [ "dev", "dev-check" ] + branches: [ "dev", "dev-check", "feat/multi-module" ] permissions: write-all @@ -74,8 +74,8 @@ jobs: - name: 🐧 create application.yml run: | - mkdir -p ./daepiro-api/src/main/resources - cd ./daepiro-api/src/main/resources + mkdir -p ./daepiro-app/src/main/resources + cd ./daepiro-app/src/main/resources touch ./application.yml echo "${{ secrets.PROPERTIES_PROD }}" | base64 --decode > ./application.yml ls -la @@ -91,7 +91,7 @@ jobs: - name: Build with jib run: | - ./gradlew :daepiro-api:jib -x test \ + ./gradlew :daepiro-app:jib -x test \ -Djib.to.auth.username=${{ secrets.DOCKER_USERNAME }} \ -Djib.to.auth.password=${{ secrets.DOCKER_PASSWORD }} \ -Djib.to.image="${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_IMAGE }}:latest" diff --git a/daepiro-api/build.gradle b/daepiro-api/build.gradle index 678d308d..8013ab3a 100644 --- a/daepiro-api/build.gradle +++ b/daepiro-api/build.gradle @@ -1,7 +1,3 @@ -plugins { - id 'com.google.cloud.tools.jib' version '3.4.0' -} - dependencies { implementation project(':daepiro-core') implementation project(':daepiro-common') @@ -15,7 +11,7 @@ dependencies { implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2' // jpa - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' + api 'org.springframework.boot:spring-boot-starter-data-jpa' annotationProcessor 'org.projectlombok:lombok' @@ -52,27 +48,4 @@ dependencies { tasks.named('test') { useJUnitPlatform() -} - -def serverIP = System.getenv("EC2_PUBLIC_IP") -def jmxPort = System.getenv("JMX_PORT") - -jib { - from { - image = "openjdk:17" - } - to { - image = "versatile0010/numberone" - tags = ["latest"] - } - container { - mainClass = 'com.numberone.backend.BackendApplication' - creationTime = "USE_CURRENT_TIMESTAMP" - jvmFlags = ["-Duser.timezone=Asia/Seoul", "-Xms128m", "-Xmx128m", "-Dcom.sun.management.jmxremote=true", "-Dcom.sun.management.jmxremote.local.only=false", "-Dcom.sun.management.jmxremote.port="+jmxPort.toString(), "-Dcom.sun.management.jmxremote.ssl=false", "-Dcom.sun.management.jmxremote.authenticate=false", "-Djava.rmi.server.hostname=" + serverIP.toString(), "-Dcom.sun.management.jmxremote.rmi.port="+jmxPort.toString(), "-XX:+HeapDumpOnOutOfMemoryError", "-XX:HeapDumpPath=/heap-dumps/heapdump.hprof"] - ports = ['8080'] - } -} - -tasks.bootJar { - enabled = true } \ No newline at end of file diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/admin/controller/AdminController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/admin/controller/AdminController.java index a997dd00..70daf5c5 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/admin/controller/AdminController.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/admin/controller/AdminController.java @@ -1,8 +1,8 @@ package com.numberone.backend.domain.admin.controller; +import com.numberone.backend.domain.admin.dto.SaveAdminDisasterRequest; import com.numberone.backend.domain.admin.dto.response.GetAddressResponse; import com.numberone.backend.domain.admin.service.AdminService; -import com.numberone.backend.domain.disaster.dto.request.SaveDisasterRequest; import com.numberone.backend.domain.disaster.service.DisasterService; import io.swagger.v3.oas.annotations.Operation; import lombok.RequiredArgsConstructor; @@ -22,16 +22,16 @@ public class AdminController { @Operation(summary = "μ„œλ²„μ— 지역별 λŒ€ν”Όμ†Œ 정보 Json 파일둜 μ—…λ‘œλ“œν•˜κΈ°", description = """ - - πŸ”₯ (주의) Shelter Database 정보λ₯Ό json ν˜•νƒœλ‘œ μ„œλ²„ μŠ€ν† λ¦¬μ§€μ— μ €μž₯ν•˜λŠ” κΈ°λŠ₯으둜, 10 λΆ„ 이상 μ†Œμš”λ©λ‹ˆλ‹€. - - μš”μ²­ μ‹œ, ν˜„μž¬ μ €μž₯된 λŒ€ν”Όμ†Œ db λ₯Ό 기반으둜 - - 지역 별 λŒ€ν”Όμ†Œ 정보λ₯Ό Json ν˜•νƒœλ‘œ μ •λ¦¬ν•˜μ—¬ μ„œλ²„ μŠ€ν† λ¦¬μ§€μ— μ €μž₯ν•©λ‹ˆλ‹€. - - λŒ€ν”Όμ†Œ db λ₯Ό μ—…λ°μ΄νŠΈ ν•œ κ²½μš°μ—, μ‹€ν–‰ν•˜λŠ” api μž…λ‹ˆλ‹€. - - """) + + πŸ”₯ (주의) Shelter Database 정보λ₯Ό json ν˜•νƒœλ‘œ μ„œλ²„ μŠ€ν† λ¦¬μ§€μ— μ €μž₯ν•˜λŠ” κΈ°λŠ₯으둜, 10 λΆ„ 이상 μ†Œμš”λ©λ‹ˆλ‹€. + + μš”μ²­ μ‹œ, ν˜„μž¬ μ €μž₯된 λŒ€ν”Όμ†Œ db λ₯Ό 기반으둜 + + 지역 별 λŒ€ν”Όμ†Œ 정보λ₯Ό Json ν˜•νƒœλ‘œ μ •λ¦¬ν•˜μ—¬ μ„œλ²„ μŠ€ν† λ¦¬μ§€μ— μ €μž₯ν•©λ‹ˆλ‹€. + + λŒ€ν”Όμ†Œ db λ₯Ό μ—…λ°μ΄νŠΈ ν•œ κ²½μš°μ—, μ‹€ν–‰ν•˜λŠ” api μž…λ‹ˆλ‹€. + + """) @PostMapping("/shelter-init") public ResponseEntity uploadAllShelterInfo() { return ResponseEntity.created(URI.create("/api/admin/shelter-init")) @@ -40,12 +40,12 @@ public ResponseEntity uploadAllShelterInfo() { @Operation(summary = "μ„œλ²„μ— λŒ€ν”Όμ†Œ μ£Όμ†Œ 정보 Json 파일둜 μ—…λ‘œλ“œν•˜κΈ°", description = """ - - πŸ”₯ (주의) Shelter Database 정보λ₯Ό 기반으둜 μ£Όμ†Œ 정보λ₯Ό json ν˜•νƒœλ‘œ μ„œλ²„ μŠ€ν† λ¦¬μ§€μ— μ €μž₯ν•˜λŠ” κΈ°λŠ₯μž…λ‹ˆλ‹€. - - λŒ€ν”Όμ†Œ db λ₯Ό μ—…λ°μ΄νŠΈ ν•œ κ²½μš°μ—, μ‹€ν–‰ν•˜λŠ” api μž…λ‹ˆλ‹€. - - """) + + πŸ”₯ (주의) Shelter Database 정보λ₯Ό 기반으둜 μ£Όμ†Œ 정보λ₯Ό json ν˜•νƒœλ‘œ μ„œλ²„ μŠ€ν† λ¦¬μ§€μ— μ €μž₯ν•˜λŠ” κΈ°λŠ₯μž…λ‹ˆλ‹€. + + λŒ€ν”Όμ†Œ db λ₯Ό μ—…λ°μ΄νŠΈ ν•œ κ²½μš°μ—, μ‹€ν–‰ν•˜λŠ” api μž…λ‹ˆλ‹€. + + """) @PostMapping("/address-info") public ResponseEntity uploadAllAddressInfo() { return ResponseEntity.created(URI.create("/api/admin/address-info")) @@ -60,8 +60,8 @@ public ResponseEntity> getAllAddressInfo() { @Operation(summary = "(ν…ŒμŠ€νŠΈμš©) μž¬λ‚œ λ°œμƒμ‹œν‚€κΈ°", description = """ μ§€μ›λ˜λŠ” μž¬λ‚œ μœ ν˜•: - - + + DROUGHT("κ°€λ­„"), STRONG_WIND("강풍"), DRYNESS("건쑰"), @@ -102,7 +102,7 @@ public ResponseEntity> getAllAddressInfo() { OTHERS("기타"), """) @PostMapping("/disaster") - public ResponseEntity createDisaster(@RequestBody SaveDisasterRequest request){ + public ResponseEntity createDisaster(@RequestBody SaveAdminDisasterRequest request) { disasterService.save(request); return ResponseEntity.ok(request); } diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/request/SaveDisasterRequest.java b/daepiro-api/src/main/java/com/numberone/backend/domain/admin/dto/SaveAdminDisasterRequest.java similarity index 74% rename from daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/request/SaveDisasterRequest.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/admin/dto/SaveAdminDisasterRequest.java index 73df95d0..bf48420d 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/request/SaveDisasterRequest.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/admin/dto/SaveAdminDisasterRequest.java @@ -1,6 +1,6 @@ -package com.numberone.backend.domain.disaster.dto.request; +package com.numberone.backend.domain.admin.dto; -import com.numberone.backend.domain.disaster.util.DisasterType; +import com.numberone.backend.domain.disaster.DisasterType; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; @@ -8,7 +8,7 @@ @NoArgsConstructor(access = AccessLevel.PROTECTED) @AllArgsConstructor @Builder -public class SaveDisasterRequest { +public class SaveAdminDisasterRequest { @Schema(defaultValue = "HEAVY_RAIN") private DisasterType disasterType; @Schema(defaultValue = "μ„œμšΈνŠΉλ³„μ‹œ 성동ꡬ μ„±μˆ˜λ™") @@ -22,8 +22,8 @@ public class SaveDisasterRequest { @Schema(defaultValue = "2023/11/25 15:40:00") private String createdAt; - public static SaveDisasterRequest of(DisasterType disasterType, String location, String msg, Long disasterNum, String createdAt) { - return SaveDisasterRequest.builder() + public static SaveAdminDisasterRequest of(DisasterType disasterType, String location, String msg, Long disasterNum, String createdAt) { + return SaveAdminDisasterRequest.builder() .disasterType(disasterType) .location(location) .msg(msg) diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/admin/service/AdminService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/admin/service/AdminService.java index abb4893a..db05c6a8 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/admin/service/AdminService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/admin/service/AdminService.java @@ -2,7 +2,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.numberone.backend.domain.admin.dto.response.GetAddressResponse; -import com.numberone.backend.domain.shelter.dto.response.GetAllSheltersResponse; +import com.numberone.backend.domain.shelter.dto.GetAllSheltersResponse; import com.numberone.backend.domain.shelter.repository.ShelterRepository; import com.numberone.backend.provider.s3.S3Provider; import lombok.RequiredArgsConstructor; diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/article/controller/ArticleController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/article/controller/ArticleController.java index 080eae06..313f6a0f 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/article/controller/ArticleController.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/article/controller/ArticleController.java @@ -1,12 +1,12 @@ package com.numberone.backend.domain.article.controller; +import com.numberone.backend.domain.article.dto.parameter.ArticleSearchParameterDto; import com.numberone.backend.domain.article.dto.request.ModifyArticleRequest; import com.numberone.backend.domain.article.dto.request.UploadArticleRequest; import com.numberone.backend.domain.article.dto.response.*; import com.numberone.backend.domain.article.service.ArticleService; import com.numberone.backend.domain.comment.dto.request.CreateCommentRequest; import com.numberone.backend.domain.comment.dto.response.CreateCommentResponse; -import com.numberone.backend.domain.like.service.RedisLockLikeFacade; import io.swagger.v3.oas.annotations.Operation; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; @@ -25,7 +25,6 @@ public class ArticleController { private final ArticleService articleService; - private final RedisLockLikeFacade redisLockLikeFacade; @Operation(summary = "κ²Œμ‹œκΈ€ μž‘μ„± API", description = """ @@ -87,37 +86,37 @@ public ResponseEntity getArticleDetails(@PathVariable( @GetMapping public ResponseEntity> getArticlePages( Pageable pageable, - @ModelAttribute ArticleSearchParameter param) { - return ResponseEntity.ok(articleService.getArticleListPaging(param, pageable)); + @ModelAttribute ArticleSearchParameterDto paramDto) { + return ResponseEntity.ok(articleService.getArticleListPaging(paramDto.toParameter(), pageable)); } @Operation(summary = "κ²Œμ‹œκΈ€μ— λŒ“κΈ€ μž‘μ„±ν•˜κΈ°", description = """ κ²Œμ‹œκΈ€μ— λŒ“κΈ€μ„ μž‘μ„±ν•˜λŠ” API μž…λ‹ˆλ‹€. - + κ²Œμ‹œκΈ€ μ•„μ΄λ””λŠ” Path variable 으둜 λ„˜κ²¨μ£Όμ„Έμš” (article-id) - + """) @PostMapping("comments/{article-id}") public ResponseEntity createComment( @PathVariable("article-id") Long articleId, @RequestBody @Valid CreateCommentRequest request) { return ResponseEntity.created( - URI.create(String.format("/api/articles/comment/%s", articleId))) + URI.create(String.format("/api/articles/comment/%s", articleId))) .body(articleService.createComment(articleId, request)); } @Operation(summary = "κ²Œμ‹œκΈ€ μˆ˜μ •ν•˜κΈ°", description = """ κ²Œμ‹œκΈ€ λ‚΄μš©μ„ μˆ˜μ •ν•˜λŠ” API μž…λ‹ˆλ‹€. - + λ°˜λ“œμ‹œ access token 을 헀더에 ν¬ν•¨ν•΄μ„œ μš”μ²­ν•΄μ£Όμ„Έμš”. - + article-id λŠ” path variable 으둜 λ„˜κ²¨μ£Όμ„Έμš”. """) @PutMapping("{article-id}/modify") public ResponseEntity modifyArticle( @PathVariable("article-id") Long articleId, - @RequestBody @Valid ModifyArticleRequest request ){ + @RequestBody @Valid ModifyArticleRequest request) { return ResponseEntity.ok(articleService.modifyArticle(articleId, request)); } diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/article/dto/parameter/ArticleSearchParameterDto.java b/daepiro-api/src/main/java/com/numberone/backend/domain/article/dto/parameter/ArticleSearchParameterDto.java new file mode 100644 index 00000000..fcffe3f3 --- /dev/null +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/article/dto/parameter/ArticleSearchParameterDto.java @@ -0,0 +1,27 @@ +package com.numberone.backend.domain.article.dto.parameter; + +import com.numberone.backend.domain.article.entity.ArticleTag; +import lombok.*; + +@ToString +@Builder +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor +public class ArticleSearchParameterDto { + private ArticleTag tag; + private Long lastArticleId; + private Double longitude; + private Double latitude; + private String regionLv2; // ꡬ + + public ArticleSearchParameter toParameter () { + return ArticleSearchParameter.builder() + .tag(tag) + .lastArticleId(lastArticleId) + .longitude(longitude) + .latitude(latitude) + .regionLv2(regionLv2) + .build(); + } +} diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/request/ModifyArticleRequest.java b/daepiro-api/src/main/java/com/numberone/backend/domain/article/dto/request/ModifyArticleRequest.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/request/ModifyArticleRequest.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/article/dto/request/ModifyArticleRequest.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/request/UploadArticleRequest.java b/daepiro-api/src/main/java/com/numberone/backend/domain/article/dto/request/UploadArticleRequest.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/request/UploadArticleRequest.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/article/dto/request/UploadArticleRequest.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/response/DeleteArticleResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/article/dto/response/DeleteArticleResponse.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/response/DeleteArticleResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/article/dto/response/DeleteArticleResponse.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/response/GetArticleDetailResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/article/dto/response/GetArticleDetailResponse.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/response/GetArticleDetailResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/article/dto/response/GetArticleDetailResponse.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/response/ModifyArticleResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/article/dto/response/ModifyArticleResponse.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/response/ModifyArticleResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/article/dto/response/ModifyArticleResponse.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/response/UploadArticleResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/article/dto/response/UploadArticleResponse.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/response/UploadArticleResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/article/dto/response/UploadArticleResponse.java diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/article/service/ArticleService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/article/service/ArticleService.java index 039c1e03..b60d83ee 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/article/service/ArticleService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/article/service/ArticleService.java @@ -1,5 +1,6 @@ package com.numberone.backend.domain.article.service; +import com.numberone.backend.domain.article.dto.parameter.ArticleSearchParameter; import com.numberone.backend.domain.article.dto.request.ModifyArticleRequest; import com.numberone.backend.domain.article.dto.request.UploadArticleRequest; import com.numberone.backend.domain.article.dto.response.*; @@ -23,13 +24,13 @@ import com.numberone.backend.domain.notification.repository.NotificationRepository; import com.numberone.backend.domain.notificationregion.entity.NotificationRegion; import com.numberone.backend.domain.notificationregion.repository.NotificationRegionRepository; -import com.numberone.backend.domain.token.util.SecurityContextProvider; import com.numberone.backend.exception.conflict.UnauthorizedLocationException; import com.numberone.backend.exception.notfound.NotFoundArticleException; import com.numberone.backend.exception.notfound.NotFoundMemberException; import com.numberone.backend.provider.fcm.service.FcmMessageProvider; -import com.numberone.backend.provider.s3.S3Provider; import com.numberone.backend.provider.location.LocationProvider; +import com.numberone.backend.provider.s3.S3Provider; +import com.numberone.backend.provider.security.SecurityContextProvider; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.data.domain.Pageable; diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/comment/controller/CommentController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/comment/controller/CommentController.java index be571887..9c2efae9 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/comment/controller/CommentController.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/comment/controller/CommentController.java @@ -3,13 +3,12 @@ import com.numberone.backend.domain.comment.dto.request.CreateChildCommentRequest; import com.numberone.backend.domain.comment.dto.response.CreateChildCommentResponse; import com.numberone.backend.domain.comment.dto.response.DeleteCommentResponse; -import com.numberone.backend.domain.comment.dto.response.GetCommentDto; +import com.numberone.backend.domain.comment.dto.GetCommentDto; import com.numberone.backend.domain.comment.service.CommentService; import io.swagger.v3.oas.annotations.Operation; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.hibernate.sql.Delete; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/request/CreateChildCommentRequest.java b/daepiro-api/src/main/java/com/numberone/backend/domain/comment/dto/request/CreateChildCommentRequest.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/request/CreateChildCommentRequest.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/comment/dto/request/CreateChildCommentRequest.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/request/CreateCommentRequest.java b/daepiro-api/src/main/java/com/numberone/backend/domain/comment/dto/request/CreateCommentRequest.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/request/CreateCommentRequest.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/comment/dto/request/CreateCommentRequest.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/response/CreateChildCommentResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/comment/dto/response/CreateChildCommentResponse.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/response/CreateChildCommentResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/comment/dto/response/CreateChildCommentResponse.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/response/CreateCommentResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/comment/dto/response/CreateCommentResponse.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/response/CreateCommentResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/comment/dto/response/CreateCommentResponse.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/response/DeleteCommentResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/comment/dto/response/DeleteCommentResponse.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/response/DeleteCommentResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/comment/dto/response/DeleteCommentResponse.java diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/comment/service/CommentService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/comment/service/CommentService.java index aa9b1642..2e7ea551 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/comment/service/CommentService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/comment/service/CommentService.java @@ -7,7 +7,7 @@ import com.numberone.backend.domain.comment.dto.request.CreateChildCommentRequest; import com.numberone.backend.domain.comment.dto.response.CreateChildCommentResponse; import com.numberone.backend.domain.comment.dto.response.DeleteCommentResponse; -import com.numberone.backend.domain.comment.dto.response.GetCommentDto; +import com.numberone.backend.domain.comment.dto.GetCommentDto; import com.numberone.backend.domain.comment.entity.CommentEntity; import com.numberone.backend.domain.comment.repository.CommentRepository; import com.numberone.backend.domain.like.entity.CommentLike; @@ -17,7 +17,7 @@ import com.numberone.backend.domain.notification.entity.NotificationEntity; import com.numberone.backend.domain.notification.entity.NotificationTag; import com.numberone.backend.domain.notification.repository.NotificationRepository; -import com.numberone.backend.domain.token.util.SecurityContextProvider; +import com.numberone.backend.provider.security.SecurityContextProvider; import com.numberone.backend.exception.notfound.NotFoundArticleException; import com.numberone.backend.exception.notfound.NotFoundCommentException; import com.numberone.backend.exception.notfound.NotFoundMemberException; diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/conversation/controller/ConversationController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/conversation/controller/ConversationController.java index 3ae92f17..87e9d93b 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/conversation/controller/ConversationController.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/conversation/controller/ConversationController.java @@ -2,13 +2,11 @@ import com.numberone.backend.domain.conversation.dto.request.CreateChildConversationRequest; import com.numberone.backend.domain.conversation.dto.request.CreateConversationRequest; -import com.numberone.backend.domain.conversation.dto.response.GetConversationResponse; import com.numberone.backend.domain.conversation.service.ConversationService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; -import org.springframework.http.ResponseEntity; import org.springframework.security.core.Authentication; import org.springframework.web.bind.annotation.*; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/conversation/dto/request/CreateChildConversationRequest.java b/daepiro-api/src/main/java/com/numberone/backend/domain/conversation/dto/request/CreateChildConversationRequest.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/conversation/dto/request/CreateChildConversationRequest.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/conversation/dto/request/CreateChildConversationRequest.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/conversation/dto/request/CreateConversationRequest.java b/daepiro-api/src/main/java/com/numberone/backend/domain/conversation/dto/request/CreateConversationRequest.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/conversation/dto/request/CreateConversationRequest.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/conversation/dto/request/CreateConversationRequest.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/conversation/dto/response/GetConversationResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/conversation/dto/response/GetConversationResponse.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/conversation/dto/response/GetConversationResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/conversation/dto/response/GetConversationResponse.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/request/LatestDisasterRequest.java b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/dto/request/LatestDisasterRequest.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/request/LatestDisasterRequest.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/disaster/dto/request/LatestDisasterRequest.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/response/LatestDisasterResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/dto/response/LatestDisasterResponse.java similarity index 96% rename from daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/response/LatestDisasterResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/disaster/dto/response/LatestDisasterResponse.java index 4f5c2f0e..af526c6b 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/response/LatestDisasterResponse.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/dto/response/LatestDisasterResponse.java @@ -1,7 +1,7 @@ package com.numberone.backend.domain.disaster.dto.response; import com.numberone.backend.domain.disaster.entity.Disaster; -import com.numberone.backend.domain.disaster.util.DisasterType; +import com.numberone.backend.domain.disaster.DisasterType; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationDetailResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationDetailResponse.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationDetailResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationDetailResponse.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationHomeResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationHomeResponse.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationHomeResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationHomeResponse.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationResponse.java similarity index 97% rename from daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationResponse.java index 6cde2394..06db71f6 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationResponse.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/dto/response/SituationResponse.java @@ -2,7 +2,7 @@ import com.numberone.backend.domain.conversation.dto.response.GetConversationResponse; import com.numberone.backend.domain.disaster.entity.Disaster; -import com.numberone.backend.domain.disaster.util.DisasterType; +import com.numberone.backend.domain.disaster.DisasterType; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterEventHandler.java b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterEventHandler.java index 4bb178b4..230aa21e 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterEventHandler.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterEventHandler.java @@ -1,7 +1,7 @@ package com.numberone.backend.domain.disaster.service; import com.numberone.backend.domain.disaster.event.DisasterEvent; -import com.numberone.backend.domain.disaster.util.DisasterType; +import com.numberone.backend.domain.disaster.DisasterType; import com.numberone.backend.domain.friendship.entity.Friendship; import com.numberone.backend.domain.member.entity.Member; import com.numberone.backend.domain.member.repository.MemberRepository; diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterService.java index a20bb405..b489a151 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/disaster/service/DisasterService.java @@ -1,11 +1,11 @@ package com.numberone.backend.domain.disaster.service; +import com.numberone.backend.domain.admin.dto.SaveAdminDisasterRequest; import com.numberone.backend.domain.conversation.dto.response.GetConversationResponse; import com.numberone.backend.domain.conversation.entity.Conversation; import com.numberone.backend.domain.conversation.repository.ConversationRepository; import com.numberone.backend.domain.conversation.service.ConversationService; import com.numberone.backend.domain.disaster.dto.request.LatestDisasterRequest; -import com.numberone.backend.domain.disaster.dto.request.SaveDisasterRequest; import com.numberone.backend.domain.disaster.dto.response.LatestDisasterResponse; import com.numberone.backend.domain.disaster.dto.response.SituationDetailResponse; import com.numberone.backend.domain.disaster.dto.response.SituationHomeResponse; @@ -13,7 +13,7 @@ import com.numberone.backend.domain.disaster.entity.Disaster; import com.numberone.backend.domain.disaster.event.DisasterEvent; import com.numberone.backend.domain.disaster.repository.DisasterRepository; -import com.numberone.backend.domain.disaster.util.DisasterType; +import com.numberone.backend.domain.disaster.DisasterType; import com.numberone.backend.domain.member.entity.Member; import com.numberone.backend.domain.member.service.MemberService; import com.numberone.backend.domain.notificationdisaster.entity.NotificationDisaster; @@ -84,7 +84,7 @@ public LatestDisasterResponse getLatestDisaster(String email, LatestDisasterRequ } @Transactional - public void save(SaveDisasterRequest saveDisasterRequest) { + public void save(SaveAdminDisasterRequest saveDisasterRequest) { DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss"); LocalDateTime dateTime = LocalDateTime.parse(saveDisasterRequest.getCreatedAt(), formatter); Disaster savedDisaster = diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/friendship/dto/response/FriendResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/friendship/dto/response/FriendResponse.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/friendship/dto/response/FriendResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/friendship/dto/response/FriendResponse.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/friendship/dto/response/InviteFriendResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/friendship/dto/response/InviteFriendResponse.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/friendship/dto/response/InviteFriendResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/friendship/dto/response/InviteFriendResponse.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/friendship/dto/response/SendFcmFriendResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/friendship/dto/response/SendFcmFriendResponse.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/friendship/dto/response/SendFcmFriendResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/friendship/dto/response/SendFcmFriendResponse.java diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/friendship/service/FriendshipService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/friendship/service/FriendshipService.java index 2cce3c58..a55475c6 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/friendship/service/FriendshipService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/friendship/service/FriendshipService.java @@ -10,7 +10,7 @@ import com.numberone.backend.domain.notification.entity.NotificationEntity; import com.numberone.backend.domain.notification.entity.NotificationTag; import com.numberone.backend.domain.notification.repository.NotificationRepository; -import com.numberone.backend.domain.token.util.SecurityContextProvider; +import com.numberone.backend.provider.security.SecurityContextProvider; import com.numberone.backend.exception.badrequest.InvalidInviteTypeException; import com.numberone.backend.exception.notfound.NotFoundFriendshipException; import com.numberone.backend.exception.notfound.NotFoundMemberException; diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/like/controller/LikeController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/like/controller/LikeController.java index a46baf4d..49eb294f 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/like/controller/LikeController.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/like/controller/LikeController.java @@ -1,7 +1,7 @@ package com.numberone.backend.domain.like.controller; -import com.numberone.backend.domain.like.dto.response.response.ArticleLikeResponse; -import com.numberone.backend.domain.like.dto.response.response.CommentLikeResponse; +import com.numberone.backend.domain.like.dto.response.ArticleLikeResponse; +import com.numberone.backend.domain.like.dto.response.CommentLikeResponse; import com.numberone.backend.domain.like.service.RedisLockLikeFacade; import io.swagger.v3.oas.annotations.Operation; import lombok.RequiredArgsConstructor; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/like/dto/response/response/ArticleLikeResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/like/dto/response/ArticleLikeResponse.java similarity index 77% rename from daepiro-core/src/main/java/com/numberone/backend/domain/like/dto/response/response/ArticleLikeResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/like/dto/response/ArticleLikeResponse.java index 6e66a9e2..444ff437 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/like/dto/response/response/ArticleLikeResponse.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/like/dto/response/ArticleLikeResponse.java @@ -1,4 +1,4 @@ -package com.numberone.backend.domain.like.dto.response.response; +package com.numberone.backend.domain.like.dto.response; import lombok.*; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/like/dto/response/response/CommentLikeResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/like/dto/response/CommentLikeResponse.java similarity index 77% rename from daepiro-core/src/main/java/com/numberone/backend/domain/like/dto/response/response/CommentLikeResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/like/dto/response/CommentLikeResponse.java index 2c41c8d2..8f2db0a4 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/like/dto/response/response/CommentLikeResponse.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/like/dto/response/CommentLikeResponse.java @@ -1,4 +1,4 @@ -package com.numberone.backend.domain.like.dto.response.response; +package com.numberone.backend.domain.like.dto.response; import lombok.*; diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/like/service/LikeService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/like/service/LikeService.java index 30fb9290..f8a30c9a 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/like/service/LikeService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/like/service/LikeService.java @@ -13,7 +13,7 @@ import com.numberone.backend.domain.notification.entity.NotificationEntity; import com.numberone.backend.domain.notification.entity.NotificationTag; import com.numberone.backend.domain.notification.repository.NotificationRepository; -import com.numberone.backend.domain.token.util.SecurityContextProvider; +import com.numberone.backend.provider.security.SecurityContextProvider; import com.numberone.backend.exception.conflict.AlreadyLikedException; import com.numberone.backend.exception.conflict.AlreadyUnLikedException; import com.numberone.backend.exception.notfound.NotFoundApiException; diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/like/service/RedisLockLikeFacade.java b/daepiro-api/src/main/java/com/numberone/backend/domain/like/service/RedisLockLikeFacade.java index 94281aec..814bdfe5 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/like/service/RedisLockLikeFacade.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/like/service/RedisLockLikeFacade.java @@ -1,8 +1,7 @@ package com.numberone.backend.domain.like.service; -import com.numberone.backend.domain.like.dto.response.response.ArticleLikeResponse; -import com.numberone.backend.domain.like.dto.response.response.CommentLikeResponse; -import com.numberone.backend.domain.like.service.LikeService; +import com.numberone.backend.domain.like.dto.response.ArticleLikeResponse; +import com.numberone.backend.domain.like.dto.response.CommentLikeResponse; import com.numberone.backend.domain.like.repository.RedisLockRepository; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/member/controller/MemberController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/member/controller/MemberController.java index 489cafab..415a940c 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/member/controller/MemberController.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/member/controller/MemberController.java @@ -10,10 +10,8 @@ import com.numberone.backend.domain.member.dto.response.UploadProfileImageResponse; import com.numberone.backend.domain.member.service.MemberService; import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; -import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.security.core.Authentication; @@ -24,7 +22,6 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -import org.springframework.security.core.Authentication; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/request/BuyHeartRequest.java b/daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/request/BuyHeartRequest.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/request/BuyHeartRequest.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/request/BuyHeartRequest.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingAddress.java b/daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingAddress.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingAddress.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingAddress.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingDisasterType.java b/daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingDisasterType.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingDisasterType.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingDisasterType.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingRequest.java b/daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingRequest.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingRequest.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/request/OnboardingRequest.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/request/UpdateGpsRequest.java b/daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/request/UpdateGpsRequest.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/request/UpdateGpsRequest.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/request/UpdateGpsRequest.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/request/UpdateSafetyRequest.java b/daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/request/UpdateSafetyRequest.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/request/UpdateSafetyRequest.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/request/UpdateSafetyRequest.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/response/GetNotificationRegionResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/response/GetNotificationRegionResponse.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/response/GetNotificationRegionResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/response/GetNotificationRegionResponse.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/response/HeartCntResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/response/HeartCntResponse.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/response/HeartCntResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/response/HeartCntResponse.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/response/MemberIdResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/response/MemberIdResponse.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/response/MemberIdResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/response/MemberIdResponse.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/response/UploadProfileImageResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/response/UploadProfileImageResponse.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/member/dto/response/UploadProfileImageResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/member/dto/response/UploadProfileImageResponse.java diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/member/service/MemberService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/member/service/MemberService.java index 33861b7a..658fd7f1 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/member/service/MemberService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/member/service/MemberService.java @@ -1,6 +1,6 @@ package com.numberone.backend.domain.member.service; -import com.numberone.backend.domain.disaster.util.DisasterType; +import com.numberone.backend.domain.disaster.DisasterType; import com.numberone.backend.domain.member.dto.request.*; import com.numberone.backend.domain.member.dto.response.GetNotificationRegionResponse; import com.numberone.backend.domain.member.dto.response.HeartCntResponse; @@ -12,10 +12,10 @@ import com.numberone.backend.domain.notificationdisaster.repository.NotificationDisasterRepository; import com.numberone.backend.domain.notificationregion.entity.NotificationRegion; import com.numberone.backend.domain.notificationregion.repository.NotificationRegionRepository; -import com.numberone.backend.domain.token.util.SecurityContextProvider; import com.numberone.backend.exception.notfound.NotFoundMemberException; -import com.numberone.backend.provider.s3.S3Provider; import com.numberone.backend.provider.location.LocationProvider; +import com.numberone.backend.provider.s3.S3Provider; +import com.numberone.backend.provider.security.SecurityContextProvider; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -48,7 +48,7 @@ public void initMemberData(String email, OnboardingRequest onboardingRequest) { Member member = memberRepository.findByEmail(email) .orElseThrow(NotFoundMemberException::new); notificationDisasterRepository.deleteAllByMemberId(member.getId()); - member.setOnboardingData(onboardingRequest.getRealname(),onboardingRequest.getNickname(), onboardingRequest.getFcmToken()); + member.setOnboardingData(onboardingRequest.getRealname(), onboardingRequest.getNickname(), onboardingRequest.getFcmToken()); notificationRegionRepository.deleteAllByMemberId(member.getId()); for (OnboardingAddress address : onboardingRequest.getAddresses()) { notificationRegionRepository.save(NotificationRegion.of( diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/notification/controller/NotificationController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/notification/controller/NotificationController.java index c0feb674..50732a11 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/notification/controller/NotificationController.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/notification/controller/NotificationController.java @@ -1,6 +1,6 @@ package com.numberone.backend.domain.notification.controller; -import com.numberone.backend.domain.notification.dto.request.NotificationSearchParameter; +import com.numberone.backend.domain.notification.dto.request.NotificationSearchParameterDto; import com.numberone.backend.domain.notification.dto.response.NotificationTabResponse; import com.numberone.backend.domain.notification.service.NotificationService; import io.swagger.v3.oas.annotations.Operation; @@ -9,9 +9,10 @@ import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Slice; import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.*; - -import java.util.List; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; @Slf4j @RequestMapping("/api/notifications") @@ -33,8 +34,8 @@ public class NotificationController { @GetMapping public ResponseEntity> getNotificationPage( Pageable pageable, - @ModelAttribute NotificationSearchParameter param){ - return ResponseEntity.ok(notificationService.getNotificationTabPagesByMember(param, pageable)); + @ModelAttribute NotificationSearchParameterDto paramDto) { + return ResponseEntity.ok(notificationService.getNotificationTabPagesByMember(paramDto.toParameter(), pageable)); } } diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/notification/dto/request/NotificationSearchParameterDto.java b/daepiro-api/src/main/java/com/numberone/backend/domain/notification/dto/request/NotificationSearchParameterDto.java new file mode 100644 index 00000000..fa2b3699 --- /dev/null +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/notification/dto/request/NotificationSearchParameterDto.java @@ -0,0 +1,21 @@ +package com.numberone.backend.domain.notification.dto.request; + +import com.numberone.backend.domain.notification.dto.parameter.NotificationSearchParameter; +import lombok.*; + +@ToString +@Builder +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor +public class NotificationSearchParameterDto { + Long lastNotificationId; + Boolean isDisaster; + + public NotificationSearchParameter toParameter(){ + return NotificationSearchParameter.builder() + .lastNotificationId(lastNotificationId) + .isDisaster(isDisaster) + .build(); + } +} diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/notification/service/NotificationService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/notification/service/NotificationService.java index 72fdce55..ca724f96 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/notification/service/NotificationService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/notification/service/NotificationService.java @@ -2,11 +2,11 @@ import com.numberone.backend.domain.member.entity.Member; import com.numberone.backend.domain.member.repository.MemberRepository; -import com.numberone.backend.domain.notification.dto.request.NotificationSearchParameter; +import com.numberone.backend.domain.notification.dto.parameter.NotificationSearchParameter; import com.numberone.backend.domain.notification.dto.response.NotificationTabResponse; import com.numberone.backend.domain.notification.repository.NotificationRepository; -import com.numberone.backend.domain.token.util.SecurityContextProvider; import com.numberone.backend.exception.notfound.NotFoundMemberException; +import com.numberone.backend.provider.security.SecurityContextProvider; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.data.domain.Pageable; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/request/NearbyShelterRequest.java b/daepiro-api/src/main/java/com/numberone/backend/domain/shelter/dto/request/NearbyShelterRequest.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/request/NearbyShelterRequest.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/shelter/dto/request/NearbyShelterRequest.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/response/GetShelterDatabaseUrlResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/shelter/dto/response/GetShelterDatabaseUrlResponse.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/response/GetShelterDatabaseUrlResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/shelter/dto/response/GetShelterDatabaseUrlResponse.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/response/NearbyShelterListResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/shelter/dto/response/NearbyShelterListResponse.java similarity index 95% rename from daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/response/NearbyShelterListResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/shelter/dto/response/NearbyShelterListResponse.java index 984e1689..40353d4a 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/response/NearbyShelterListResponse.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/shelter/dto/response/NearbyShelterListResponse.java @@ -1,5 +1,6 @@ package com.numberone.backend.domain.shelter.dto.response; +import com.numberone.backend.domain.shelter.dto.ShelterMapper; import lombok.*; import java.util.List; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/response/NearestShelterResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/shelter/dto/response/NearestShelterResponse.java similarity index 92% rename from daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/response/NearestShelterResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/shelter/dto/response/NearestShelterResponse.java index f8aa6008..d0f71966 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/response/NearestShelterResponse.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/shelter/dto/response/NearestShelterResponse.java @@ -1,5 +1,6 @@ package com.numberone.backend.domain.shelter.dto.response; +import com.numberone.backend.domain.shelter.dto.ShelterMapper; import lombok.*; @ToString diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/shelter/service/ShelterService.java b/daepiro-api/src/main/java/com/numberone/backend/domain/shelter/service/ShelterService.java index ddca0b92..c3c60c44 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/shelter/service/ShelterService.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/shelter/service/ShelterService.java @@ -1,9 +1,10 @@ package com.numberone.backend.domain.shelter.service; +import com.numberone.backend.domain.shelter.dto.ShelterMapper; import com.numberone.backend.domain.shelter.dto.request.NearbyShelterRequest; import com.numberone.backend.domain.shelter.dto.response.*; import com.numberone.backend.domain.shelter.repository.ShelterRepository; -import com.numberone.backend.domain.shelter.util.ShelterType; +import com.numberone.backend.domain.shelter.ShelterType; import com.numberone.backend.exception.notfound.NotFoundShelterException; import com.numberone.backend.provider.s3.S3Provider; import lombok.RequiredArgsConstructor; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/sponsor/dto/response/SponsorHomeResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/sponsor/dto/response/SponsorHomeResponse.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/sponsor/dto/response/SponsorHomeResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/sponsor/dto/response/SponsorHomeResponse.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/sponsor/dto/response/SponsorResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/sponsor/dto/response/SponsorResponse.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/sponsor/dto/response/SponsorResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/sponsor/dto/response/SponsorResponse.java diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/support/controller/SupportController.java b/daepiro-api/src/main/java/com/numberone/backend/domain/support/controller/SupportController.java index aeec522e..a381d747 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/support/controller/SupportController.java +++ b/daepiro-api/src/main/java/com/numberone/backend/domain/support/controller/SupportController.java @@ -8,7 +8,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; -import org.springframework.http.RequestEntity; import org.springframework.http.ResponseEntity; import org.springframework.security.core.Authentication; import org.springframework.web.bind.annotation.*; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/support/dto/request/CreateSupportRequest.java b/daepiro-api/src/main/java/com/numberone/backend/domain/support/dto/request/CreateSupportRequest.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/support/dto/request/CreateSupportRequest.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/support/dto/request/CreateSupportRequest.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/support/dto/request/EditMessageRequest.java b/daepiro-api/src/main/java/com/numberone/backend/domain/support/dto/request/EditMessageRequest.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/support/dto/request/EditMessageRequest.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/support/dto/request/EditMessageRequest.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/support/dto/response/CreateSupportResponse.java b/daepiro-api/src/main/java/com/numberone/backend/domain/support/dto/response/CreateSupportResponse.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/support/dto/response/CreateSupportResponse.java rename to daepiro-api/src/main/java/com/numberone/backend/domain/support/dto/response/CreateSupportResponse.java diff --git a/daepiro-api/src/test/java/com/numberone/backend/BackendApplicationTests.java b/daepiro-api/src/test/java/com/numberone/backend/BackendApplicationTests.java deleted file mode 100644 index 126c3eeb..00000000 --- a/daepiro-api/src/test/java/com/numberone/backend/BackendApplicationTests.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.numberone.backend; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class BackendApplicationTests { - - @Test - void contextLoads() { - } - -} diff --git a/daepiro-app/build.gradle b/daepiro-app/build.gradle new file mode 100644 index 00000000..a150b745 --- /dev/null +++ b/daepiro-app/build.gradle @@ -0,0 +1,74 @@ +plugins { + id 'com.google.cloud.tools.jib' version '3.4.0' +} + +dependencies { + implementation project(':daepiro-core') + implementation project(':daepiro-common') + implementation project(':daepiro-redis') + implementation project(':daepiro-api') + implementation project(':daepiro-crawler') + implementation project(':daepiro-auth') + + implementation 'org.springframework.boot:spring-boot-starter-security' + implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-validation' + + // swagger + implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2' + + // jpa + implementation 'org.springframework.boot:spring-boot-starter-data-jpa' + + annotationProcessor 'org.projectlombok:lombok' + + compileOnly 'org.projectlombok:lombok' + + runtimeOnly 'com.h2database:h2' + runtimeOnly 'com.mysql:mysql-connector-j' + + testImplementation 'org.springframework.boot:spring-boot-starter-test' + + implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' + implementation 'org.springframework.boot:spring-boot-starter-data-redis' + + // cloud + implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE' + + // aop + implementation 'org.springframework.boot:spring-boot-starter-aop' + + // fcm + implementation 'com.google.firebase:firebase-admin:9.1.1' + + implementation 'com.squareup.okhttp3:okhttp:4.9.1' + implementation 'org.jsoup:jsoup:1.14.2' + implementation 'net.sourceforge.htmlunit:htmlunit:2.70.0' +} + +tasks.named('test') { + useJUnitPlatform() +} + +def serverIP = System.getenv("EC2_PUBLIC_IP") +def jmxPort = System.getenv("JMX_PORT") + +jib { + from { + image = "openjdk:17" + } + to { + image = "versatile0010/numberone" + tags = ["latest"] + } + container { + mainClass = 'com.numberone.backend.BackendApplication' + creationTime = "USE_CURRENT_TIMESTAMP" + jvmFlags = ["-Duser.timezone=Asia/Seoul", "-Xms128m", "-Xmx128m", "-Dcom.sun.management.jmxremote=true", "-Dcom.sun.management.jmxremote.local.only=false", "-Dcom.sun.management.jmxremote.port="+jmxPort.toString(), "-Dcom.sun.management.jmxremote.ssl=false", "-Dcom.sun.management.jmxremote.authenticate=false", "-Djava.rmi.server.hostname=" + serverIP.toString(), "-Dcom.sun.management.jmxremote.rmi.port="+jmxPort.toString(), "-XX:+HeapDumpOnOutOfMemoryError", "-XX:HeapDumpPath=/heap-dumps/heapdump.hprof"] + ports = ['8080'] + } +} + +tasks.bootJar { + enabled = true +} \ No newline at end of file diff --git a/daepiro-api/src/main/java/com/numberone/backend/BackendApplication.java b/daepiro-app/src/main/java/com/numberone/backend/BackendApplication.java similarity index 100% rename from daepiro-api/src/main/java/com/numberone/backend/BackendApplication.java rename to daepiro-app/src/main/java/com/numberone/backend/BackendApplication.java diff --git a/daepiro-api/src/main/java/com/numberone/backend/HelloController.java b/daepiro-app/src/main/java/com/numberone/backend/HelloController.java similarity index 100% rename from daepiro-api/src/main/java/com/numberone/backend/HelloController.java rename to daepiro-app/src/main/java/com/numberone/backend/HelloController.java diff --git a/daepiro-api/src/main/java/com/numberone/backend/LoginTestController.java b/daepiro-app/src/main/java/com/numberone/backend/LoginTestController.java similarity index 100% rename from daepiro-api/src/main/java/com/numberone/backend/LoginTestController.java rename to daepiro-app/src/main/java/com/numberone/backend/LoginTestController.java diff --git a/daepiro-api/src/main/java/com/numberone/backend/LoginTestResponse.java b/daepiro-app/src/main/java/com/numberone/backend/LoginTestResponse.java similarity index 100% rename from daepiro-api/src/main/java/com/numberone/backend/LoginTestResponse.java rename to daepiro-app/src/main/java/com/numberone/backend/LoginTestResponse.java diff --git a/daepiro-auth/build.gradle b/daepiro-auth/build.gradle index d95bf493..e3d41550 100644 --- a/daepiro-auth/build.gradle +++ b/daepiro-auth/build.gradle @@ -2,25 +2,27 @@ dependencies { implementation project(':daepiro-core') implementation project(':daepiro-redis') implementation project(':daepiro-common') + implementation project(':daepiro-api') implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-validation' + compileOnly 'org.projectlombok:lombok' - developmentOnly 'org.springframework.boot:spring-boot-devtools' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' - implementation group: 'commons-io', name: 'commons-io', version: '2.10.0' - implementation 'com.googlecode.json-simple:json-simple:1.1' + // swagger + implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2' - implementation 'org.springframework.boot:spring-boot-starter-validation' + // oauth + implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' + implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' - implementation group: 'io.jsonwebtoken', name: 'jjwt-api', version: '0.11.5' - runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-impl', version: '0.11.5' - runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: '0.11.5' - - implementation group: 'org.springframework.boot', name: 'spring-boot-starter-thymeleaf', version: '2.7.3' + // security implementation 'org.springframework.boot:spring-boot-starter-security' - implementation 'joda-time:joda-time:2.10.10' + implementation 'io.jsonwebtoken:jjwt-api:0.11.5' + runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.5' + runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.11.5' + } tasks.bootJar { diff --git a/daepiro-api/src/main/java/com/numberone/backend/auth/config/SecurityConfig.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/config/SecurityConfig.java similarity index 96% rename from daepiro-api/src/main/java/com/numberone/backend/auth/config/SecurityConfig.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/config/SecurityConfig.java index 509bc179..d1d69f54 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/auth/config/SecurityConfig.java +++ b/daepiro-auth/src/main/java/com/numberone/backend/domain/config/SecurityConfig.java @@ -1,6 +1,6 @@ -package com.numberone.backend.auth.config; +package com.numberone.backend.domain.config; -import com.numberone.backend.auth.global.JwtFilter; +import com.numberone.backend.domain.filter.JwtFilter; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.context.annotation.Bean; diff --git a/daepiro-api/src/main/java/com/numberone/backend/auth/global/JwtFilter.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/filter/JwtFilter.java similarity index 90% rename from daepiro-api/src/main/java/com/numberone/backend/auth/global/JwtFilter.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/filter/JwtFilter.java index 133800a0..496c011a 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/auth/global/JwtFilter.java +++ b/daepiro-auth/src/main/java/com/numberone/backend/domain/filter/JwtFilter.java @@ -1,10 +1,9 @@ -package com.numberone.backend.auth.global; +package com.numberone.backend.domain.filter; import com.fasterxml.jackson.databind.ObjectMapper; import com.numberone.backend.domain.member.entity.Member; import com.numberone.backend.domain.member.repository.MemberRepository; -import com.numberone.backend.domain.member.service.MemberService; -import com.numberone.backend.domain.token.util.JwtUtil; +import com.numberone.backend.domain.service.JwtProvider; import com.numberone.backend.exception.context.ExceptionContext; import com.numberone.backend.exception.dto.ErrorResponse; import com.numberone.backend.exception.notfound.NotFoundMemberException; @@ -29,7 +28,8 @@ @RequiredArgsConstructor @Component public class JwtFilter extends OncePerRequestFilter { - private final JwtUtil jwtUtil; + + private final JwtProvider jwtProvider; private final MemberRepository memberRepository; @Override @@ -48,19 +48,19 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse return; } String token = authorizationHeader.split(" ")[1]; - if (!jwtUtil.isValid(token)) { + if (!jwtProvider.isValid(token)) { setErrorResponse(response, WRONG_ACCESS_TOKEN); return; } - if (jwtUtil.isExpired(token)) { + if (jwtProvider.isExpired(token)) { setErrorResponse(response, EXPIRED_ACCESS_TOKEN); return; } - String email = jwtUtil.getEmail(token); + String email = jwtProvider.getEmail(token); try { Member member = memberRepository.findByEmail(email) - .orElseThrow(NotFoundMemberException::new);; + .orElseThrow(NotFoundMemberException::new); UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken( member.getEmail(), null, Collections.emptyList()); authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request)); diff --git a/daepiro-common/src/main/java/com/numberone/backend/properties/JwtProperties.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/properties/JwtProperties.java similarity index 84% rename from daepiro-common/src/main/java/com/numberone/backend/properties/JwtProperties.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/properties/JwtProperties.java index 8e51b032..ed78b8ca 100644 --- a/daepiro-common/src/main/java/com/numberone/backend/properties/JwtProperties.java +++ b/daepiro-auth/src/main/java/com/numberone/backend/domain/properties/JwtProperties.java @@ -1,4 +1,4 @@ -package com.numberone.backend.properties; +package com.numberone.backend.domain.properties; import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; diff --git a/daepiro-common/src/main/java/com/numberone/backend/properties/KakaoProperties.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/properties/KakaoProperties.java similarity index 89% rename from daepiro-common/src/main/java/com/numberone/backend/properties/KakaoProperties.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/properties/KakaoProperties.java index 38d147d6..a05d969b 100644 --- a/daepiro-common/src/main/java/com/numberone/backend/properties/KakaoProperties.java +++ b/daepiro-auth/src/main/java/com/numberone/backend/domain/properties/KakaoProperties.java @@ -1,4 +1,4 @@ -package com.numberone.backend.properties; +package com.numberone.backend.domain.properties; import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; diff --git a/daepiro-common/src/main/java/com/numberone/backend/properties/NaverProperties.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/properties/NaverProperties.java similarity index 89% rename from daepiro-common/src/main/java/com/numberone/backend/properties/NaverProperties.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/properties/NaverProperties.java index 87f22bda..a562af92 100644 --- a/daepiro-common/src/main/java/com/numberone/backend/properties/NaverProperties.java +++ b/daepiro-auth/src/main/java/com/numberone/backend/domain/properties/NaverProperties.java @@ -1,4 +1,4 @@ -package com.numberone.backend.properties; +package com.numberone.backend.domain.properties; import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; diff --git a/daepiro-common/src/main/java/com/numberone/backend/properties/TokenPeriodProperties.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/properties/TokenPeriodProperties.java similarity index 86% rename from daepiro-common/src/main/java/com/numberone/backend/properties/TokenPeriodProperties.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/properties/TokenPeriodProperties.java index cb1473e6..5cb32d67 100644 --- a/daepiro-common/src/main/java/com/numberone/backend/properties/TokenPeriodProperties.java +++ b/daepiro-auth/src/main/java/com/numberone/backend/domain/properties/TokenPeriodProperties.java @@ -1,4 +1,4 @@ -package com.numberone.backend.properties; +package com.numberone.backend.domain.properties; import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/token/util/JwtUtil.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/service/JwtProvider.java similarity index 92% rename from daepiro-core/src/main/java/com/numberone/backend/domain/token/util/JwtUtil.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/service/JwtProvider.java index f8d7e5ef..36cf39af 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/token/util/JwtUtil.java +++ b/daepiro-auth/src/main/java/com/numberone/backend/domain/service/JwtProvider.java @@ -1,6 +1,6 @@ -package com.numberone.backend.domain.token.util; +package com.numberone.backend.domain.service; -import com.numberone.backend.properties.JwtProperties; +import com.numberone.backend.domain.properties.JwtProperties; import io.jsonwebtoken.*; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -11,7 +11,7 @@ @Slf4j @Component @RequiredArgsConstructor -public class JwtUtil { +public class JwtProvider { private final JwtProperties jwtProperties; public String createToken(String email, long period) { diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/token/service/TokenService.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/service/TokenService.java similarity index 85% rename from daepiro-api/src/main/java/com/numberone/backend/domain/token/service/TokenService.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/service/TokenService.java index 323d6623..9a8c89ad 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/token/service/TokenService.java +++ b/daepiro-auth/src/main/java/com/numberone/backend/domain/service/TokenService.java @@ -1,7 +1,10 @@ -package com.numberone.backend.domain.token.service; +package com.numberone.backend.domain.service; import com.numberone.backend.domain.member.repository.MemberRepository; import com.numberone.backend.domain.member.service.MemberService; +import com.numberone.backend.domain.properties.KakaoProperties; +import com.numberone.backend.domain.properties.NaverProperties; +import com.numberone.backend.domain.properties.TokenPeriodProperties; import com.numberone.backend.domain.token.dto.request.GetTokenRequest; import com.numberone.backend.domain.token.dto.request.RefreshTokenRequest; import com.numberone.backend.domain.token.dto.response.GetTokenResponse; @@ -10,13 +13,9 @@ import com.numberone.backend.domain.token.dto.response.RefreshTokenResponse; import com.numberone.backend.domain.token.entity.Token; import com.numberone.backend.domain.token.repository.TokenRepository; -import com.numberone.backend.domain.token.util.JwtUtil; import com.numberone.backend.exception.badrequest.BadRequestSocialTokenException; import com.numberone.backend.exception.forbidden.WrongAccessTokenException; import com.numberone.backend.exception.notfound.NotFoundRefreshTokenException; -import com.numberone.backend.properties.KakaoProperties; -import com.numberone.backend.properties.NaverProperties; -import com.numberone.backend.properties.TokenPeriodProperties; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.http.*; @@ -29,7 +28,7 @@ @Transactional(readOnly = true) @Slf4j public class TokenService { - private final JwtUtil jwtUtil; + private final JwtProvider jwtProvider; private final RestTemplate restTemplate; private final KakaoProperties kakaoProperties; private final NaverProperties naverProperties; @@ -76,13 +75,13 @@ public GetTokenResponse loginNaver(GetTokenRequest tokenRequest) { @Transactional public RefreshTokenResponse refresh(RefreshTokenRequest tokenRequest) { - if (!jwtUtil.isValid(tokenRequest.getToken())) + if (!jwtProvider.isValid(tokenRequest.getToken())) throw new NotFoundRefreshTokenException(); Token token = tokenRepository.findByRefreshToken(tokenRequest.getToken()) .orElseThrow(NotFoundRefreshTokenException::new); - String email = jwtUtil.getEmail(tokenRequest.getToken()); - String newAccessToken = jwtUtil.createToken(email, tokenPeriodProperties.getAccess()); - String newRefreshToken = jwtUtil.createToken(email, tokenPeriodProperties.getRefresh()); + String email = jwtProvider.getEmail(tokenRequest.getToken()); + String newAccessToken = jwtProvider.createToken(email, tokenPeriodProperties.getAccess()); + String newRefreshToken = jwtProvider.createToken(email, tokenPeriodProperties.getRefresh()); token.update(newAccessToken, newRefreshToken); tokenRepository.save(token);//redis의 경우 jpa와 달리 transactional을 μ΄μš©ν•΄λ„ 데이터 μˆ˜μ •μ‹œμ— λͺ…μ‹œμ μœΌλ‘œ saveλ₯Ό ν•΄μ€˜μ•Ό 함 return RefreshTokenResponse.of(newAccessToken, newRefreshToken); @@ -99,8 +98,8 @@ private GetTokenResponse getTokenResponse(String email) { .orElseThrow(WrongAccessTokenException::new); return GetTokenResponse.of(token.getAccessToken(), token.getRefreshToken(), isNewMember); } else { - String refreshToken = jwtUtil.createToken(email, tokenPeriodProperties.getRefresh()); - String accessToken = jwtUtil.createToken(email, tokenPeriodProperties.getAccess()); + String refreshToken = jwtProvider.createToken(email, tokenPeriodProperties.getRefresh()); + String accessToken = jwtProvider.createToken(email, tokenPeriodProperties.getAccess()); Token token = tokenRepository.save(Token.of(email, accessToken, refreshToken)); return GetTokenResponse.of(token.getAccessToken(), token.getRefreshToken(), isNewMember); } diff --git a/daepiro-auth/src/main/java/com/numberone/backend/domain/user/service/UserAuthService.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/service/UserAuthService.java similarity index 66% rename from daepiro-auth/src/main/java/com/numberone/backend/domain/user/service/UserAuthService.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/service/UserAuthService.java index ebd7a7e1..e3531613 100644 --- a/daepiro-auth/src/main/java/com/numberone/backend/domain/user/service/UserAuthService.java +++ b/daepiro-auth/src/main/java/com/numberone/backend/domain/service/UserAuthService.java @@ -1,4 +1,4 @@ -package com.numberone.backend.domain.user.service; +package com.numberone.backend.domain.service; public class UserAuthService { // todo: api λͺ¨λ“ˆμ˜ token service λ₯Ό auth λͺ¨λ“ˆλ‘œ 이관 diff --git a/daepiro-api/src/main/java/com/numberone/backend/domain/token/controller/TokenController.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/token/controller/TokenController.java similarity index 62% rename from daepiro-api/src/main/java/com/numberone/backend/domain/token/controller/TokenController.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/token/controller/TokenController.java index d9eeb6d7..8ff421ba 100644 --- a/daepiro-api/src/main/java/com/numberone/backend/domain/token/controller/TokenController.java +++ b/daepiro-auth/src/main/java/com/numberone/backend/domain/token/controller/TokenController.java @@ -1,10 +1,10 @@ package com.numberone.backend.domain.token.controller; +import com.numberone.backend.domain.service.TokenService; import com.numberone.backend.domain.token.dto.request.GetTokenRequest; import com.numberone.backend.domain.token.dto.request.RefreshTokenRequest; import com.numberone.backend.domain.token.dto.response.GetTokenResponse; import com.numberone.backend.domain.token.dto.response.RefreshTokenResponse; -import com.numberone.backend.domain.token.service.TokenService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; @@ -23,12 +23,12 @@ public class TokenController { @Operation(summary = "카카였 토큰을 μ΄μš©ν•˜μ—¬ μ„œλ²„ JWT 토큰 λ°œκΈ‰λ°›κΈ°", description = """ - 카카였 토큰을 body 에 λ‹΄μ•„μ„œ post μš”μ²­ ν•΄μ£Όμ„Έμš”. - - μ•žμœΌλ‘œ μ„œλ²„ μš”μ²­ μ‹œμ— μ‚¬μš©ν•  수 μžˆλŠ” JWT 토큰이 λ°œκΈ‰λ©λ‹ˆλ‹€. - - 이후 μ„œλ²„μ— API μš”μ²­μ‹œ 이 JWT 토큰을 같이 λ‹΄μ•„μ„œ μš”μ²­ν•΄μ•Ό μ •μƒμ μœΌλ‘œ APIκ°€ 호좜 λ©λ‹ˆλ‹€. - """) + 카카였 토큰을 body 에 λ‹΄μ•„μ„œ post μš”μ²­ ν•΄μ£Όμ„Έμš”. + + μ•žμœΌλ‘œ μ„œλ²„ μš”μ²­ μ‹œμ— μ‚¬μš©ν•  수 μžˆλŠ” JWT 토큰이 λ°œκΈ‰λ©λ‹ˆλ‹€. + + 이후 μ„œλ²„μ— API μš”μ²­μ‹œ 이 JWT 토큰을 같이 λ‹΄μ•„μ„œ μš”μ²­ν•΄μ•Ό μ •μƒμ μœΌλ‘œ APIκ°€ 호좜 λ©λ‹ˆλ‹€. + """) @PostMapping("/kakao") public GetTokenResponse loginKakao(@RequestBody @Valid GetTokenRequest tokenRequest) { return tokenService.loginKakao(tokenRequest); @@ -36,12 +36,12 @@ public GetTokenResponse loginKakao(@RequestBody @Valid GetTokenRequest tokenRequ @Operation(summary = "넀이버 토큰을 μ΄μš©ν•˜μ—¬ μ„œλ²„ JWT 토큰 λ°œκΈ‰λ°›κΈ°", description = """ - 넀이버 토큰을 body 에 λ‹΄μ•„μ„œ post μš”μ²­ ν•΄μ£Όμ„Έμš”. - - μ•žμœΌλ‘œ μ„œλ²„ μš”μ²­ μ‹œμ— μ‚¬μš©ν•  수 μžˆλŠ” JWT 토큰이 λ°œκΈ‰λ©λ‹ˆλ‹€. - - 이후 μ„œλ²„μ— API μš”μ²­μ‹œ 이 JWT 토큰을 같이 λ‹΄μ•„μ„œ μš”μ²­ν•΄μ•Ό μ •μƒμ μœΌλ‘œ APIκ°€ 호좜 λ©λ‹ˆλ‹€. - """) + 넀이버 토큰을 body 에 λ‹΄μ•„μ„œ post μš”μ²­ ν•΄μ£Όμ„Έμš”. + + μ•žμœΌλ‘œ μ„œλ²„ μš”μ²­ μ‹œμ— μ‚¬μš©ν•  수 μžˆλŠ” JWT 토큰이 λ°œκΈ‰λ©λ‹ˆλ‹€. + + 이후 μ„œλ²„μ— API μš”μ²­μ‹œ 이 JWT 토큰을 같이 λ‹΄μ•„μ„œ μš”μ²­ν•΄μ•Ό μ •μƒμ μœΌλ‘œ APIκ°€ 호좜 λ©λ‹ˆλ‹€. + """) @PostMapping("/naver") public GetTokenResponse loginNaver(@RequestBody @Valid GetTokenRequest tokenRequest) { return tokenService.loginNaver(tokenRequest); @@ -49,10 +49,10 @@ public GetTokenResponse loginNaver(@RequestBody @Valid GetTokenRequest tokenRequ @Operation(summary = "만료된 JWT 토큰 κ°±μ‹ ν•˜κΈ°", description = """ - 만료된 JWT 토큰을 body 에 λ‹΄μ•„μ„œ post μš”μ²­ ν•΄μ£Όμ„Έμš”. - - μƒˆλ‘œ μ‚¬μš©ν•  수 μžˆλŠ” JWT 토큰이 λ°œκΈ‰λ©λ‹ˆλ‹€. - """) + 만료된 JWT 토큰을 body 에 λ‹΄μ•„μ„œ post μš”μ²­ ν•΄μ£Όμ„Έμš”. + + μƒˆλ‘œ μ‚¬μš©ν•  수 μžˆλŠ” JWT 토큰이 λ°œκΈ‰λ©λ‹ˆλ‹€. + """) @PostMapping("/refresh") public RefreshTokenResponse refresh(@RequestBody @Valid RefreshTokenRequest tokenRequest) { return tokenService.refresh(tokenRequest); diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/request/GetTokenRequest.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/request/GetTokenRequest.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/request/GetTokenRequest.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/request/GetTokenRequest.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/request/RefreshTokenRequest.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/request/RefreshTokenRequest.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/request/RefreshTokenRequest.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/request/RefreshTokenRequest.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/response/GetTokenResponse.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/response/GetTokenResponse.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/response/GetTokenResponse.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/response/GetTokenResponse.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/response/KakaoInfoResponse.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/response/KakaoInfoResponse.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/response/KakaoInfoResponse.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/response/KakaoInfoResponse.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/response/KakaoTokenResponse.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/response/KakaoTokenResponse.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/response/KakaoTokenResponse.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/response/KakaoTokenResponse.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/response/NaverInfoResponse.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/response/NaverInfoResponse.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/response/NaverInfoResponse.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/response/NaverInfoResponse.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/response/NaverTokenResponse.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/response/NaverTokenResponse.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/response/NaverTokenResponse.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/response/NaverTokenResponse.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/response/RefreshTokenResponse.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/response/RefreshTokenResponse.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/token/dto/response/RefreshTokenResponse.java rename to daepiro-auth/src/main/java/com/numberone/backend/domain/token/dto/response/RefreshTokenResponse.java diff --git a/daepiro-auth/src/main/java/com/numberone/backend/domain/user/controller/UserAuthController.java b/daepiro-auth/src/main/java/com/numberone/backend/domain/user/controller/UserAuthController.java deleted file mode 100644 index 153b4bf6..00000000 --- a/daepiro-auth/src/main/java/com/numberone/backend/domain/user/controller/UserAuthController.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.numberone.backend.domain.user.controller; - -public class UserAuthController { - // todo: api λͺ¨λ“ˆμ˜ token controller λ₯Ό auth λͺ¨λ“ˆλ‘œ 이관 -} diff --git a/daepiro-common/src/main/java/com/numberone/backend/config/SwaggerConfig.java b/daepiro-common/src/main/java/com/numberone/backend/config/SwaggerConfig.java index fbc3c2e2..dd0863c1 100644 --- a/daepiro-common/src/main/java/com/numberone/backend/config/SwaggerConfig.java +++ b/daepiro-common/src/main/java/com/numberone/backend/config/SwaggerConfig.java @@ -15,7 +15,7 @@ @OpenAPIDefinition( servers = @Server(url = "/", description = "${host.url}"), info = @Info( - title = "πŸš€ λŒ€ν”Όλ‘œ λ°±μ—”λ“œ API λͺ…μ„Έμ„œ (multi-module μ „ν™˜:24.01.09)", + title = "πŸš€ λŒ€ν”Όλ‘œ λ°±μ—”λ“œ API λͺ…μ„Έμ„œ (updated at: 2024. 02. 18.)", description = """ spring docs λ₯Ό μ΄μš©ν•œ API λͺ…μ„Έμ„œ μž…λ‹ˆλ‹€.😊 """, diff --git a/daepiro-common/src/main/java/com/numberone/backend/properties/KakaoMapProperties.java b/daepiro-common/src/main/java/com/numberone/backend/properties/KakaoMapProperties.java new file mode 100644 index 00000000..d72125ff --- /dev/null +++ b/daepiro-common/src/main/java/com/numberone/backend/properties/KakaoMapProperties.java @@ -0,0 +1,13 @@ +package com.numberone.backend.properties; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +@Data +@Component +@ConfigurationProperties(prefix = "spring.kakao.map") +public class KakaoMapProperties { + private String client_id; + private String mapApiUrl; +} diff --git a/daepiro-common/src/main/java/com/numberone/backend/provider/location/LocationProvider.java b/daepiro-common/src/main/java/com/numberone/backend/provider/location/LocationProvider.java index 0e1f6533..b622f6f3 100644 --- a/daepiro-common/src/main/java/com/numberone/backend/provider/location/LocationProvider.java +++ b/daepiro-common/src/main/java/com/numberone/backend/provider/location/LocationProvider.java @@ -1,6 +1,6 @@ package com.numberone.backend.provider.location; -import com.numberone.backend.properties.KakaoProperties; +import com.numberone.backend.properties.KakaoMapProperties; import com.numberone.backend.provider.location.dto.MapApiResponse; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -17,7 +17,7 @@ @RequiredArgsConstructor @Slf4j public class LocationProvider { - private final KakaoProperties kakaoProperties; + private final KakaoMapProperties kakaoProperties; private final RestTemplate restTemplate; public String pos2address(double latitude, double longitude) { diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/token/util/SecurityContextProvider.java b/daepiro-common/src/main/java/com/numberone/backend/provider/security/SecurityContextProvider.java similarity index 92% rename from daepiro-core/src/main/java/com/numberone/backend/domain/token/util/SecurityContextProvider.java rename to daepiro-common/src/main/java/com/numberone/backend/provider/security/SecurityContextProvider.java index 42a23e75..2e4697ae 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/token/util/SecurityContextProvider.java +++ b/daepiro-common/src/main/java/com/numberone/backend/provider/security/SecurityContextProvider.java @@ -1,4 +1,4 @@ -package com.numberone.backend.domain.token.util; +package com.numberone.backend.provider.security; import com.numberone.backend.exception.badrequest.BadUserAuthenticationException; import org.springframework.security.core.Authentication; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/admin/dto/response/GetAddressResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/admin/dto/response/GetAddressResponse.java index 9ca386ba..57370d63 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/admin/dto/response/GetAddressResponse.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/admin/dto/response/GetAddressResponse.java @@ -1,6 +1,6 @@ package com.numberone.backend.domain.admin.dto.response; -import com.numberone.backend.domain.shelter.util.ShelterType; +import com.numberone.backend.domain.shelter.ShelterType; import com.querydsl.core.annotations.QueryProjection; import lombok.*; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/admin/dto/request/CreateDisasterEventDto.java b/daepiro-core/src/main/java/com/numberone/backend/domain/admin/event/CreateDisasterEventDto.java similarity index 71% rename from daepiro-core/src/main/java/com/numberone/backend/domain/admin/dto/request/CreateDisasterEventDto.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/admin/event/CreateDisasterEventDto.java index 087097ee..975d634a 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/admin/dto/request/CreateDisasterEventDto.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/admin/event/CreateDisasterEventDto.java @@ -1,6 +1,6 @@ -package com.numberone.backend.domain.admin.dto.request; +package com.numberone.backend.domain.admin.event; -import com.numberone.backend.domain.disaster.util.DisasterType; +import com.numberone.backend.domain.disaster.DisasterType; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/response/ArticleSearchParameter.java b/daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/parameter/ArticleSearchParameter.java similarity index 86% rename from daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/response/ArticleSearchParameter.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/parameter/ArticleSearchParameter.java index 4f0995a3..ed40df71 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/response/ArticleSearchParameter.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/article/dto/parameter/ArticleSearchParameter.java @@ -1,4 +1,4 @@ -package com.numberone.backend.domain.article.dto.response; +package com.numberone.backend.domain.article.dto.parameter; import com.numberone.backend.domain.article.entity.ArticleTag; import lombok.*; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/article/repository/custom/ArticleRepositoryCustom.java b/daepiro-core/src/main/java/com/numberone/backend/domain/article/repository/custom/ArticleRepositoryCustom.java index 7b65f173..298478db 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/article/repository/custom/ArticleRepositoryCustom.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/article/repository/custom/ArticleRepositoryCustom.java @@ -1,6 +1,6 @@ package com.numberone.backend.domain.article.repository.custom; -import com.numberone.backend.domain.article.dto.response.ArticleSearchParameter; +import com.numberone.backend.domain.article.dto.parameter.ArticleSearchParameter; import com.numberone.backend.domain.article.dto.response.GetArticleListResponse; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Slice; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/article/repository/custom/ArticleRepositoryCustomImpl.java b/daepiro-core/src/main/java/com/numberone/backend/domain/article/repository/custom/ArticleRepositoryCustomImpl.java index 41dc34df..a3573351 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/article/repository/custom/ArticleRepositoryCustomImpl.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/article/repository/custom/ArticleRepositoryCustomImpl.java @@ -1,6 +1,6 @@ package com.numberone.backend.domain.article.repository.custom; -import com.numberone.backend.domain.article.dto.response.ArticleSearchParameter; +import com.numberone.backend.domain.article.dto.parameter.ArticleSearchParameter; import com.numberone.backend.domain.article.dto.response.GetArticleListResponse; import com.numberone.backend.domain.article.dto.response.QGetArticleListResponse; import com.numberone.backend.domain.article.entity.ArticleStatus; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/response/GetCommentDto.java b/daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/GetCommentDto.java similarity index 97% rename from daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/response/GetCommentDto.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/GetCommentDto.java index 91cf25fd..73a9a2ea 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/response/GetCommentDto.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/comment/dto/GetCommentDto.java @@ -1,4 +1,4 @@ -package com.numberone.backend.domain.comment.dto.response; +package com.numberone.backend.domain.comment.dto; import com.fasterxml.jackson.annotation.JsonFormat; import com.numberone.backend.domain.comment.entity.CommentEntity; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/comment/repository/custom/CommentRepositoryCustom.java b/daepiro-core/src/main/java/com/numberone/backend/domain/comment/repository/custom/CommentRepositoryCustom.java index 66adfcbf..3cf19e81 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/comment/repository/custom/CommentRepositoryCustom.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/comment/repository/custom/CommentRepositoryCustom.java @@ -1,6 +1,6 @@ package com.numberone.backend.domain.comment.repository.custom; -import com.numberone.backend.domain.comment.dto.response.GetCommentDto; +import com.numberone.backend.domain.comment.dto.GetCommentDto; import java.util.List; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/comment/repository/custom/CommentRepositoryCustomImpl.java b/daepiro-core/src/main/java/com/numberone/backend/domain/comment/repository/custom/CommentRepositoryCustomImpl.java index fdba3981..ffca5f0c 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/comment/repository/custom/CommentRepositoryCustomImpl.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/comment/repository/custom/CommentRepositoryCustomImpl.java @@ -1,7 +1,7 @@ package com.numberone.backend.domain.comment.repository.custom; -import com.numberone.backend.domain.comment.dto.response.GetCommentDto; -import com.numberone.backend.domain.comment.dto.response.QGetCommentDto; +import com.numberone.backend.domain.comment.dto.GetCommentDto; +import com.numberone.backend.domain.comment.dto.QGetCommentDto; import com.querydsl.jpa.impl.JPAQueryFactory; import jakarta.persistence.EntityManager; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/util/DisasterType.java b/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/DisasterType.java similarity index 98% rename from daepiro-core/src/main/java/com/numberone/backend/domain/disaster/util/DisasterType.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/disaster/DisasterType.java index 65c83416..706f7f48 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/util/DisasterType.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/DisasterType.java @@ -1,4 +1,4 @@ -package com.numberone.backend.domain.disaster.util; +package com.numberone.backend.domain.disaster; import com.numberone.backend.exception.badrequest.InvalidDisasterTypeException; import lombok.Getter; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/entity/Disaster.java b/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/entity/Disaster.java index 991de251..189ffded 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/entity/Disaster.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/entity/Disaster.java @@ -2,7 +2,7 @@ import com.numberone.backend.config.basetime.BaseTimeEntity; import com.numberone.backend.domain.conversation.entity.Conversation; -import com.numberone.backend.domain.disaster.util.DisasterType; +import com.numberone.backend.domain.disaster.DisasterType; import jakarta.persistence.*; import lombok.AccessLevel; import lombok.Builder; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/event/DisasterEvent.java b/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/event/DisasterEvent.java index 3ac91e75..d1759514 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/event/DisasterEvent.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/event/DisasterEvent.java @@ -1,7 +1,7 @@ package com.numberone.backend.domain.disaster.event; import com.numberone.backend.domain.disaster.entity.Disaster; -import com.numberone.backend.domain.disaster.util.DisasterType; +import com.numberone.backend.domain.disaster.DisasterType; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/notification/dto/request/NotificationSearchParameter.java b/daepiro-core/src/main/java/com/numberone/backend/domain/notification/dto/parameter/NotificationSearchParameter.java similarity index 76% rename from daepiro-core/src/main/java/com/numberone/backend/domain/notification/dto/request/NotificationSearchParameter.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/notification/dto/parameter/NotificationSearchParameter.java index afff1e7b..2d7267d3 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/notification/dto/request/NotificationSearchParameter.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/notification/dto/parameter/NotificationSearchParameter.java @@ -1,4 +1,4 @@ -package com.numberone.backend.domain.notification.dto.request; +package com.numberone.backend.domain.notification.dto.parameter; import lombok.*; @@ -10,4 +10,5 @@ public class NotificationSearchParameter { Long lastNotificationId; Boolean isDisaster; + } diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/notification/entity/NotificationEntity.java b/daepiro-core/src/main/java/com/numberone/backend/domain/notification/entity/NotificationEntity.java index 078782f8..f3fdf0d8 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/notification/entity/NotificationEntity.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/notification/entity/NotificationEntity.java @@ -1,7 +1,7 @@ package com.numberone.backend.domain.notification.entity; import com.numberone.backend.config.basetime.BaseTimeEntity; -import com.numberone.backend.domain.disaster.util.DisasterType; +import com.numberone.backend.domain.disaster.DisasterType; import com.numberone.backend.domain.member.entity.Member; import jakarta.persistence.*; import lombok.AccessLevel; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/notification/repository/custom/NotificationRepositoryCustom.java b/daepiro-core/src/main/java/com/numberone/backend/domain/notification/repository/custom/NotificationRepositoryCustom.java index 5a889f1d..fbd75028 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/notification/repository/custom/NotificationRepositoryCustom.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/notification/repository/custom/NotificationRepositoryCustom.java @@ -1,6 +1,6 @@ package com.numberone.backend.domain.notification.repository.custom; -import com.numberone.backend.domain.notification.dto.request.NotificationSearchParameter; +import com.numberone.backend.domain.notification.dto.parameter.NotificationSearchParameter; import com.numberone.backend.domain.notification.dto.response.NotificationTabResponse; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Slice; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/notification/repository/custom/NotificationRepositoryCustomImpl.java b/daepiro-core/src/main/java/com/numberone/backend/domain/notification/repository/custom/NotificationRepositoryCustomImpl.java index 547502a2..0a879761 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/notification/repository/custom/NotificationRepositoryCustomImpl.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/notification/repository/custom/NotificationRepositoryCustomImpl.java @@ -1,6 +1,6 @@ package com.numberone.backend.domain.notification.repository.custom; -import com.numberone.backend.domain.notification.dto.request.NotificationSearchParameter; +import com.numberone.backend.domain.notification.dto.parameter.NotificationSearchParameter; import com.numberone.backend.domain.notification.dto.response.NotificationTabResponse; import com.numberone.backend.domain.notification.dto.response.QNotificationTabResponse; import com.numberone.backend.domain.notification.entity.NotificationTag; @@ -41,8 +41,8 @@ public Slice getNotificationTabPagesNoOffSetByMember(No return checkLastPage(pageable, result); } - private BooleanExpression checkDisasterFlag(boolean isDisaster){ - if (!isDisaster){ + private BooleanExpression checkDisasterFlag(boolean isDisaster) { + if (!isDisaster) { return notificationEntity.notificationTag.ne(NotificationTag.DISASTER); } return notificationEntity.notificationTag.eq(NotificationTag.DISASTER); diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/notificationdisaster/entity/NotificationDisaster.java b/daepiro-core/src/main/java/com/numberone/backend/domain/notificationdisaster/entity/NotificationDisaster.java index 650272b6..ccc3dc54 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/notificationdisaster/entity/NotificationDisaster.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/notificationdisaster/entity/NotificationDisaster.java @@ -1,6 +1,6 @@ package com.numberone.backend.domain.notificationdisaster.entity; -import com.numberone.backend.domain.disaster.util.DisasterType; +import com.numberone.backend.domain.disaster.DisasterType; import com.numberone.backend.domain.member.entity.Member; import jakarta.persistence.*; import lombok.AccessLevel; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/util/Address.java b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/Address.java similarity index 94% rename from daepiro-core/src/main/java/com/numberone/backend/domain/shelter/util/Address.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/shelter/Address.java index 08dfd0f4..7759e9a3 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/util/Address.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/Address.java @@ -1,4 +1,4 @@ -package com.numberone.backend.domain.shelter.util; +package com.numberone.backend.domain.shelter; import jakarta.persistence.Embeddable; import lombok.Getter; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/util/ShelterStatus.java b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/ShelterStatus.java similarity index 76% rename from daepiro-core/src/main/java/com/numberone/backend/domain/shelter/util/ShelterStatus.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/shelter/ShelterStatus.java index b7bbe303..8f4a4bde 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/util/ShelterStatus.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/ShelterStatus.java @@ -1,4 +1,4 @@ -package com.numberone.backend.domain.shelter.util; +package com.numberone.backend.domain.shelter; import lombok.RequiredArgsConstructor; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/util/ShelterType.java b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/ShelterType.java similarity index 92% rename from daepiro-core/src/main/java/com/numberone/backend/domain/shelter/util/ShelterType.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/shelter/ShelterType.java index 78d01d07..1bba4f1b 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/util/ShelterType.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/ShelterType.java @@ -1,4 +1,4 @@ -package com.numberone.backend.domain.shelter.util; +package com.numberone.backend.domain.shelter; import com.numberone.backend.exception.badrequest.InvalidShelterTypeException; import lombok.RequiredArgsConstructor; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/response/GetAllSheltersResponse.java b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/GetAllSheltersResponse.java similarity index 96% rename from daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/response/GetAllSheltersResponse.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/GetAllSheltersResponse.java index 28f01767..304aa918 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/response/GetAllSheltersResponse.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/GetAllSheltersResponse.java @@ -1,4 +1,4 @@ -package com.numberone.backend.domain.shelter.dto.response; +package com.numberone.backend.domain.shelter.dto; import com.querydsl.core.annotations.QueryProjection; import lombok.*; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/response/ShelterMapper.java b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/ShelterMapper.java similarity index 72% rename from daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/response/ShelterMapper.java rename to daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/ShelterMapper.java index 82098d25..efca4e4c 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/response/ShelterMapper.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/dto/ShelterMapper.java @@ -1,4 +1,4 @@ -package com.numberone.backend.domain.shelter.dto.response; +package com.numberone.backend.domain.shelter.dto; public interface ShelterMapper { Long getId(); diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/entity/Shelter.java b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/entity/Shelter.java index 83fbec73..0f3460ba 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/entity/Shelter.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/entity/Shelter.java @@ -1,9 +1,9 @@ package com.numberone.backend.domain.shelter.entity; import com.numberone.backend.config.basetime.BaseTimeEntity; -import com.numberone.backend.domain.shelter.util.Address; -import com.numberone.backend.domain.shelter.util.ShelterStatus; -import com.numberone.backend.domain.shelter.util.ShelterType; +import com.numberone.backend.domain.shelter.Address; +import com.numberone.backend.domain.shelter.ShelterStatus; +import com.numberone.backend.domain.shelter.ShelterType; import jakarta.persistence.*; import lombok.AccessLevel; import lombok.Getter; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/repository/ShelterRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/repository/ShelterRepository.java index c344d803..7f19408d 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/repository/ShelterRepository.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/repository/ShelterRepository.java @@ -1,6 +1,6 @@ package com.numberone.backend.domain.shelter.repository; -import com.numberone.backend.domain.shelter.dto.response.ShelterMapper; +import com.numberone.backend.domain.shelter.dto.ShelterMapper; import com.numberone.backend.domain.shelter.entity.Shelter; import com.numberone.backend.domain.shelter.repository.custom.CustomShelterRepository; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/repository/custom/CustomShelterRepository.java b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/repository/custom/CustomShelterRepository.java index ae837a33..0e54f7c5 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/repository/custom/CustomShelterRepository.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/repository/custom/CustomShelterRepository.java @@ -1,7 +1,7 @@ package com.numberone.backend.domain.shelter.repository.custom; import com.numberone.backend.domain.admin.dto.response.GetAddressResponse; -import com.numberone.backend.domain.shelter.dto.response.GetAllSheltersResponse; +import com.numberone.backend.domain.shelter.dto.GetAllSheltersResponse; import java.util.List; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/repository/custom/CustomShelterRepositoryImpl.java b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/repository/custom/CustomShelterRepositoryImpl.java index a4aaae7a..fdf7ce5a 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/repository/custom/CustomShelterRepositoryImpl.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/shelter/repository/custom/CustomShelterRepositoryImpl.java @@ -2,11 +2,11 @@ import com.numberone.backend.domain.admin.dto.response.GetAddressResponse; import com.numberone.backend.domain.admin.dto.response.QGetAddressResponse; -import com.numberone.backend.domain.shelter.dto.response.GetAllSheltersResponse; -import com.numberone.backend.domain.shelter.dto.response.QGetAllSheltersResponse_AddressDetail; -import com.numberone.backend.domain.shelter.dto.response.QGetAllSheltersResponse_ShelterDetail; -import com.numberone.backend.domain.shelter.util.ShelterStatus; -import com.numberone.backend.domain.shelter.util.ShelterType; +import com.numberone.backend.domain.shelter.ShelterStatus; +import com.numberone.backend.domain.shelter.ShelterType; +import com.numberone.backend.domain.shelter.dto.GetAllSheltersResponse; +import com.numberone.backend.domain.shelter.dto.QGetAllSheltersResponse_AddressDetail; +import com.numberone.backend.domain.shelter.dto.QGetAllSheltersResponse_ShelterDetail; import com.querydsl.jpa.impl.JPAQueryFactory; import jakarta.persistence.EntityManager; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/sponsor/entity/Sponsor.java b/daepiro-core/src/main/java/com/numberone/backend/domain/sponsor/entity/Sponsor.java index 3623cd98..0d3e174b 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/sponsor/entity/Sponsor.java +++ b/daepiro-core/src/main/java/com/numberone/backend/domain/sponsor/entity/Sponsor.java @@ -1,6 +1,6 @@ package com.numberone.backend.domain.sponsor.entity; -import com.numberone.backend.domain.disaster.util.DisasterType; +import com.numberone.backend.domain.disaster.DisasterType; import com.numberone.backend.domain.support.entity.Support; import jakarta.persistence.*; import lombok.AccessLevel; diff --git a/daepiro-crawler/src/main/java/com/numberone/backend/domain/disaster/service/DisasterDataCollector.java b/daepiro-crawler/src/main/java/com/numberone/backend/domain/disaster/service/DisasterDataCollector.java index 422c541d..3a2277a6 100644 --- a/daepiro-crawler/src/main/java/com/numberone/backend/domain/disaster/service/DisasterDataCollector.java +++ b/daepiro-crawler/src/main/java/com/numberone/backend/domain/disaster/service/DisasterDataCollector.java @@ -4,12 +4,12 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.HtmlPage; -import com.numberone.backend.domain.disaster.dto.request.SaveDisasterRequest; -import com.numberone.backend.domain.disaster.dto.response.DisasterDataResponse; +import com.numberone.backend.domain.disaster.DisasterType; import com.numberone.backend.domain.disaster.entity.Disaster; import com.numberone.backend.domain.disaster.event.DisasterEvent; import com.numberone.backend.domain.disaster.repository.DisasterRepository; -import com.numberone.backend.domain.disaster.util.DisasterType; +import com.numberone.backend.domain.disaster.service.dto.DisasterDataResponse; +import com.numberone.backend.domain.disaster.service.dto.SaveDisasterRequest; import com.numberone.backend.exception.notfound.NotFoundApiException; import com.numberone.backend.exception.notfound.NotFoundCrawlingException; import com.numberone.backend.properties.DisasterProperties; diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/response/DisasterDataResponse.java b/daepiro-crawler/src/main/java/com/numberone/backend/domain/disaster/service/dto/DisasterDataResponse.java similarity index 97% rename from daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/response/DisasterDataResponse.java rename to daepiro-crawler/src/main/java/com/numberone/backend/domain/disaster/service/dto/DisasterDataResponse.java index 7428451b..58de460c 100644 --- a/daepiro-core/src/main/java/com/numberone/backend/domain/disaster/dto/response/DisasterDataResponse.java +++ b/daepiro-crawler/src/main/java/com/numberone/backend/domain/disaster/service/dto/DisasterDataResponse.java @@ -1,4 +1,4 @@ -package com.numberone.backend.domain.disaster.dto.response; +package com.numberone.backend.domain.disaster.service.dto; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/daepiro-crawler/src/main/java/com/numberone/backend/domain/disaster/service/dto/SaveDisasterRequest.java b/daepiro-crawler/src/main/java/com/numberone/backend/domain/disaster/service/dto/SaveDisasterRequest.java new file mode 100644 index 00000000..9d36135d --- /dev/null +++ b/daepiro-crawler/src/main/java/com/numberone/backend/domain/disaster/service/dto/SaveDisasterRequest.java @@ -0,0 +1,27 @@ +package com.numberone.backend.domain.disaster.service.dto; + +import com.numberone.backend.domain.disaster.DisasterType; +import lombok.*; + +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor +@Builder +public class SaveDisasterRequest { + + private DisasterType disasterType; + private String location; + private String msg; + private Long disasterNum; + private String createdAt; + + public static SaveDisasterRequest of(DisasterType disasterType, String location, String msg, Long disasterNum, String createdAt) { + return SaveDisasterRequest.builder() + .disasterType(disasterType) + .location(location) + .msg(msg) + .disasterNum(disasterNum) + .createdAt(createdAt) + .build(); + } +} diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/token/entity/Token.java b/daepiro-redis/src/main/java/com/numberone/backend/domain/token/entity/Token.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/token/entity/Token.java rename to daepiro-redis/src/main/java/com/numberone/backend/domain/token/entity/Token.java diff --git a/daepiro-core/src/main/java/com/numberone/backend/domain/token/repository/TokenRepository.java b/daepiro-redis/src/main/java/com/numberone/backend/domain/token/repository/TokenRepository.java similarity index 100% rename from daepiro-core/src/main/java/com/numberone/backend/domain/token/repository/TokenRepository.java rename to daepiro-redis/src/main/java/com/numberone/backend/domain/token/repository/TokenRepository.java diff --git a/settings.gradle b/settings.gradle index 6db14775..7cc18856 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,4 +1,5 @@ rootProject.name = 'Backend' +include 'daepiro-app' include 'daepiro-api' include 'daepiro-core' include 'daepiro-common' From 772829a89d9ec2d6de9b84346b083a7d3326f84b Mon Sep 17 00:00:00 2001 From: Jaehyeon Date: Sun, 18 Feb 2024 13:42:35 +0900 Subject: [PATCH 30/31] Feat: fixed time zone --- .github/workflows/jib-build-depoly.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/jib-build-depoly.yml b/.github/workflows/jib-build-depoly.yml index 0f0f6b5a..82cf501e 100644 --- a/.github/workflows/jib-build-depoly.yml +++ b/.github/workflows/jib-build-depoly.yml @@ -35,7 +35,7 @@ jobs: - name: get Current Time - run: echo "CURRENT_TIME=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_ENV + run: echo "CURRENT_TIME=$(date +'%Y-%m-%d %H:%M:%S' -d '+9 hours')" >> $GITHUB_ENV - name: πŸ”” Send Slack Message when deploy started uses: 8398a7/action-slack@v3 @@ -54,7 +54,7 @@ jobs: "short": true }, { - "title": "Deploy time πŸ•š", + "title": "Deploy time (KST) πŸ•š", "value": "${{ env.CURRENT_TIME }}", "short": true } From 48c07c6ad0569731bf97975bad81976f89972155 Mon Sep 17 00:00:00 2001 From: Jaehyeon Date: Sun, 18 Feb 2024 14:00:20 +0900 Subject: [PATCH 31/31] Feat: gradle dependency clean up --- build.gradle | 1 - daepiro-api/build.gradle | 24 +++--------------------- daepiro-app/build.gradle | 29 +++-------------------------- daepiro-auth/build.gradle | 4 +++- daepiro-common/build.gradle | 3 ++- daepiro-core/build.gradle | 23 +++-------------------- daepiro-crawler/build.gradle | 2 +- daepiro-redis/build.gradle | 4 ++-- 8 files changed, 17 insertions(+), 73 deletions(-) diff --git a/build.gradle b/build.gradle index 1bd0e37d..3b562a99 100644 --- a/build.gradle +++ b/build.gradle @@ -58,7 +58,6 @@ subprojects { } dependencies { - //implementation 'org.projectlombok:lombok' compileOnly 'org.projectlombok:lombok' annotationProcessor 'org.projectlombok:lombok' annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor' diff --git a/daepiro-api/build.gradle b/daepiro-api/build.gradle index 8013ab3a..c6dd7b51 100644 --- a/daepiro-api/build.gradle +++ b/daepiro-api/build.gradle @@ -3,6 +3,7 @@ dependencies { implementation project(':daepiro-common') implementation project(':daepiro-redis') + // spring implementation 'org.springframework.boot:spring-boot-starter-security' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-validation' @@ -13,37 +14,18 @@ dependencies { // jpa api 'org.springframework.boot:spring-boot-starter-data-jpa' + // lombok annotationProcessor 'org.projectlombok:lombok' - compileOnly 'org.projectlombok:lombok' - runtimeOnly 'com.h2database:h2' - runtimeOnly 'com.mysql:mysql-connector-j' - + // test testImplementation 'org.springframework.boot:spring-boot-starter-test' - testImplementation 'org.springframework.security:spring-security-test' - - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' - implementation 'org.springframework.boot:spring-boot-starter-data-redis' - - implementation 'io.jsonwebtoken:jjwt:0.9.1' - implementation 'com.sun.xml.bind:jaxb-impl:4.0.1' - implementation 'com.sun.xml.bind:jaxb-core:4.0.1' - implementation 'javax.xml.bind:jaxb-api:2.4.0-b180830.0359' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' - - // cloud - implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE' // aop implementation 'org.springframework.boot:spring-boot-starter-aop' // fcm implementation 'com.google.firebase:firebase-admin:9.1.1' - - implementation 'com.squareup.okhttp3:okhttp:4.9.1' - implementation 'org.jsoup:jsoup:1.14.2' - implementation 'net.sourceforge.htmlunit:htmlunit:2.70.0' } tasks.named('test') { diff --git a/daepiro-app/build.gradle b/daepiro-app/build.gradle index a150b745..4288ad08 100644 --- a/daepiro-app/build.gradle +++ b/daepiro-app/build.gradle @@ -10,40 +10,17 @@ dependencies { implementation project(':daepiro-crawler') implementation project(':daepiro-auth') - implementation 'org.springframework.boot:spring-boot-starter-security' + // spring implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-validation' + implementation 'org.springframework.boot:spring-boot-starter-security' // swagger implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2' - // jpa - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - + // lombok annotationProcessor 'org.projectlombok:lombok' - compileOnly 'org.projectlombok:lombok' - runtimeOnly 'com.h2database:h2' - runtimeOnly 'com.mysql:mysql-connector-j' - - testImplementation 'org.springframework.boot:spring-boot-starter-test' - - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' - implementation 'org.springframework.boot:spring-boot-starter-data-redis' - - // cloud - implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE' - - // aop - implementation 'org.springframework.boot:spring-boot-starter-aop' - - // fcm - implementation 'com.google.firebase:firebase-admin:9.1.1' - - implementation 'com.squareup.okhttp3:okhttp:4.9.1' - implementation 'org.jsoup:jsoup:1.14.2' - implementation 'net.sourceforge.htmlunit:htmlunit:2.70.0' } tasks.named('test') { diff --git a/daepiro-auth/build.gradle b/daepiro-auth/build.gradle index e3d41550..ac024334 100644 --- a/daepiro-auth/build.gradle +++ b/daepiro-auth/build.gradle @@ -2,11 +2,13 @@ dependencies { implementation project(':daepiro-core') implementation project(':daepiro-redis') implementation project(':daepiro-common') - implementation project(':daepiro-api') + implementation project(':daepiro-api') // todo: remove it + // spring implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-validation' + // lombok compileOnly 'org.projectlombok:lombok' // swagger diff --git a/daepiro-common/build.gradle b/daepiro-common/build.gradle index 4cf3b4be..85f609fd 100644 --- a/daepiro-common/build.gradle +++ b/daepiro-common/build.gradle @@ -5,13 +5,14 @@ plugins { } dependencies { + + // spring implementation 'org.springframework.boot:spring-boot-starter-security' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-validation' // swagger implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2' - implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE' // aop diff --git a/daepiro-core/build.gradle b/daepiro-core/build.gradle index af2ded62..7fb37abf 100644 --- a/daepiro-core/build.gradle +++ b/daepiro-core/build.gradle @@ -35,29 +35,15 @@ dependencies { // swagger implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2' - // redis - implementation 'org.springframework.boot:spring-boot-starter-data-redis' - // p6spy implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.5.8' // validation implementation 'org.springframework.boot:spring-boot-starter-validation' - // jwt - implementation 'io.jsonwebtoken:jjwt:0.9.1' - implementation 'com.sun.xml.bind:jaxb-impl:4.0.1' - implementation 'com.sun.xml.bind:jaxb-core:4.0.1' - implementation 'javax.xml.bind:jaxb-api:2.4.0-b180830.0359' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' - - // jpa implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - // web - implementation 'org.springframework.boot:spring-boot-starter-web' - // lombok compileOnly 'org.projectlombok:lombok' annotationProcessor 'org.projectlombok:lombok' @@ -65,22 +51,19 @@ dependencies { // mysql connector runtimeOnly 'com.mysql:mysql-connector-j' - // test - testImplementation 'org.springframework.boot:spring-boot-starter-test' - - // === QueryDsl μ‹œμž‘ === + // === QueryDsl === implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta' annotationProcessor "com.querydsl:querydsl-apt:5.0.0:jakarta" annotationProcessor "jakarta.annotation:jakarta.annotation-api" annotationProcessor "jakarta.persistence:jakarta.persistence-api" - // === QueryDsl 끝 === + // === QueryDsl === } tasks.named('test') { useJUnitPlatform() } -// === Querydsl λΉŒλ“œ μ˜΅μ…˜ (선택사항) === +// === Querydsl λΉŒλ“œ μ˜΅μ…˜ === def querydslDir = "$buildDir/generated/querydsl" sourceSets { diff --git a/daepiro-crawler/build.gradle b/daepiro-crawler/build.gradle index 6f42a35f..72bcdb0d 100644 --- a/daepiro-crawler/build.gradle +++ b/daepiro-crawler/build.gradle @@ -13,7 +13,7 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-validation' // jpa - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' + api 'org.springframework.boot:spring-boot-starter-data-jpa' //crawling implementation 'com.squareup.okhttp3:okhttp:4.9.1' diff --git a/daepiro-redis/build.gradle b/daepiro-redis/build.gradle index 4ba0a3ee..7d95f7a4 100644 --- a/daepiro-redis/build.gradle +++ b/daepiro-redis/build.gradle @@ -7,10 +7,10 @@ plugins { dependencies { implementation project(':daepiro-common') + // redis implementation 'org.springframework.boot:spring-boot-starter-data-redis' - implementation 'com.fasterxml.jackson.core:jackson-databind' - + // test testFixturesRuntimeOnly group: 'it.ozimov', name: 'embedded-redis', version: '0.7.1' }