From 7d925d376df54d8ad358500f99776fdb394fa4fa Mon Sep 17 00:00:00 2001
From: mingmingmon
Date: Sun, 22 Dec 2024 19:06:19 +0900
Subject: [PATCH] =?UTF-8?q?refactor:=20=ED=86=B5=EC=9D=BC=EB=90=9C=20impor?=
=?UTF-8?q?t=EB=AC=B8=20=EC=A0=95=EB=A0=AC=EA=B3=BC=20=EC=BD=94=EB=93=9C?=
=?UTF-8?q?=20=EC=A0=95=EB=A6=AC=20=EB=B0=A9=EC=8B=9D=EC=9D=84=20=ED=99=9C?=
=?UTF-8?q?=EC=9A=A9=ED=95=9C=20=EC=A0=95=EB=A6=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../api/ActivityGroupAdminController.java | 73 +-
.../api/ActivityGroupBoardController.java | 93 ++-
.../api/ActivityGroupMemberController.java | 116 +--
.../api/ActivityGroupReportController.java | 42 +-
.../api/AttendanceController.java | 70 +-
.../ActivityGroupAdminService.java | 128 ++--
.../ActivityGroupBoardService.java | 188 +++--
.../ActivityGroupMemberService.java | 143 ++--
.../ActivityGroupReportService.java | 29 +-
.../application/AttendanceService.java | 75 +-
.../activitygroup/dao/AbsentRepository.java | 6 +-
.../dao/ActivityGroupBoardRepository.java | 9 +-
.../ActivityGroupBoardRepositoryCustom.java | 4 +-
.../dao/ActivityGroupBoardRepositoryImpl.java | 11 +-
.../dao/ActivityGroupDetailsRepository.java | 1 +
.../ActivityGroupDetailsRepositoryImpl.java | 35 +-
.../dao/ActivityGroupRepository.java | 8 +-
.../ActivityGroupRepositoryCustomImpl.java | 23 +-
.../dao/ApplyFormRepository.java | 4 +-
.../dao/AttendanceRepository.java | 6 +-
.../dao/GroupMemberRepository.java | 23 +-
.../dao/GroupMemberRepositoryCustom.java | 3 +-
.../dao/GroupMemberRepositoryImpl.java | 84 +-
.../dao/GroupScheduleRepository.java | 3 +-
.../dao/RedisQRKeyRepository.java | 1 +
.../activity/activitygroup/domain/Absent.java | 3 +-
.../activitygroup/domain/ActivityGroup.java | 5 +-
.../domain/ActivityGroupBoard.java | 15 +-
.../domain/ActivityGroupReport.java | 3 +-
.../activitygroup/domain/Attendance.java | 11 +-
.../activitygroup/domain/GroupMember.java | 13 +-
.../activitygroup/domain/GroupMemberId.java | 3 +-
.../activitygroup/domain/GroupSchedule.java | 3 +-
.../activitygroup/domain/RedisQRKey.java | 4 +-
.../dto/mapper/ActivityGroupDtoMapper.java | 366 ++++-----
.../dto/param/ActivityGroupDetails.java | 3 +-
.../dto/param/GroupScheduleDto.java | 3 +-
.../dto/request/AbsentRequestDto.java | 3 +-
.../request/ActivityGroupBoardRequestDto.java | 5 +-
.../ActivityGroupBoardUpdateRequestDto.java | 5 +-
.../dto/request/ActivityGroupRequestDto.java | 3 +-
.../ActivityGroupUpdateRequestDto.java | 3 +-
.../dto/response/AbsentResponseDto.java | 3 +-
.../ActivityGroupBoardChildResponseDto.java | 5 +-
.../ActivityGroupBoardResponseDto.java | 5 +-
.../ActivityGroupReportResponseDto.java | 3 +-
.../response/ActivityGroupResponseDto.java | 3 +-
.../ActivityGroupStatusResponseDto.java | 5 +-
...mentSubmissionWithFeedbackResponseDto.java | 5 +-
.../dto/response/AttendanceResponseDto.java | 3 +-
.../dto/response/FeedbackResponseDto.java | 5 +-
.../dto/response/LeaderInfo.java | 3 +-
...ySubmittedThisWeekAssignmentException.java | 2 +-
.../SingleLeaderModificationException.java | 2 +-
.../DeletedReviewsRetrievalController.java | 4 +-
.../in/web/MyReviewsRetrievalController.java | 13 +-
.../in/web/ReviewRegisterController.java | 2 +-
.../in/web/ReviewRemoveController.java | 2 +-
.../in/web/ReviewUpdateController.java | 4 +-
...eviewsByConditionsRetrievalController.java | 28 +-
.../persistence/ReviewPersistenceAdapter.java | 17 +-
.../out/persistence/ReviewRepository.java | 3 +-
.../persistence/ReviewRepositoryCustom.java | 4 +-
.../out/persistence/ReviewRepositoryImpl.java | 38 +-
.../dto/mapper/ReviewDtoMapper.java | 36 +-
.../dto/request/ReviewRequestDto.java | 2 +-
.../dto/response/ReviewResponseDto.java | 3 +-
.../port/in/RegisterReviewUseCase.java | 1 +
.../port/in/RemoveReviewUseCase.java | 1 +
.../in/RetrieveDeletedReviewsUseCase.java | 1 +
.../port/in/RetrieveMyReviewsUseCase.java | 1 +
.../RetrieveReviewsByConditionsUseCase.java | 4 +-
.../port/in/UpdateReviewUseCase.java | 1 +
.../port/out/RegisterReviewPort.java | 1 +
.../port/out/RetrieveReviewPort.java | 3 +-
.../service/ReviewRegisterService.java | 10 +-
.../ReviewsByConditionsRetrievalService.java | 6 +-
.../domain/activity/review/domain/Review.java | 5 +-
.../AccountAccessLogJpaEntity.java | 3 +-
.../AccountAccessLogPersistenceAdapter.java | 2 +-
.../AccountAccessLogRepository.java | 1 +
.../out/RegisterAccountAccessLogPort.java | 1 +
.../domain/AccountAccessLog.java | 20 +-
.../in/web/BanMembersRetrievalController.java | 7 +-
.../adapter/in/web/MemberBanController.java | 4 +-
.../adapter/in/web/MemberUnbanController.java | 4 +-
.../persistence/AccountLockInfoJpaEntity.java | 3 +-
.../AccountLockInfoPersistenceAdapter.java | 11 +-
.../AccountLockInfoRepository.java | 5 +-
.../dto/mapper/AccountLockInfoDtoMapper.java | 6 +-
.../application/port/in/BanMemberUseCase.java | 1 +
.../port/in/RetrieveBannedMembersUseCase.java | 1 +
.../port/in/UnbanMemberUseCase.java | 1 +
.../port/out/RegisterAccountLockInfoPort.java | 1 +
.../port/out/RemoveAccountLockInfoPort.java | 1 +
.../port/out/RetrieveAccountLockInfoPort.java | 5 +-
.../service/BanMembersRetrievalService.java | 6 +-
.../application/service/MemberBanService.java | 4 +-
.../service/MemberUnbanService.java | 4 +-
.../domain/AccountLockInfo.java | 13 +-
.../in/web/BlacklistIpRegisterController.java | 4 +-
.../in/web/BlacklistIpRemoveController.java | 4 +-
.../web/BlacklistIpRetrievalController.java | 19 +-
.../in/web/BlacklistResetController.java | 5 +-
.../out/persistence/BlacklistIpJpaEntity.java | 6 +-
.../BlacklistIpPersistenceAdapter.java | 23 +-
.../persistence/BlacklistIpRepository.java | 3 +-
.../dto/mapper/BlacklistIpDtoMapper.java | 16 +-
.../dto/response/BlacklistIpResponseDto.java | 3 +-
.../port/in/RegisterBlacklistIpUseCase.java | 1 +
.../port/in/RemoveBlacklistIpUseCase.java | 1 +
.../port/in/ResetBlacklistIpsUseCase.java | 2 +-
.../port/in/RetrieveBlacklistIpsUseCase.java | 1 +
.../port/out/RegisterBlacklistIpPort.java | 1 +
.../port/out/RetrieveBlacklistIpPort.java | 5 +-
.../service/BlacklistIpRegisterService.java | 20 +-
.../service/BlacklistIpRemoveService.java | 4 +-
.../service/BlacklistIpResetService.java | 10 +-
.../auth/blacklistIp/domain/BlacklistIp.java | 9 +-
.../adapter/in/web/MemberLoginController.java | 14 +-
.../in/web/TokenManagementController.java | 13 +-
.../TwoFactorAuthenticationController.java | 12 +-
.../AuthenticatorPersistenceAdapter.java | 14 +-
.../persistence/AuthenticatorRepository.java | 1 +
.../RedisTokenPersistenceAdapter.java | 11 +-
.../out/persistence/RedisTokenRepository.java | 3 +-
.../application/dto/response/TokenInfo.java | 6 +-
.../port/in/ManageLoginUseCase.java | 9 +-
.../port/in/ManageRedisTokenUseCase.java | 3 +-
.../port/out/RegisterAuthenticatorPort.java | 1 +
.../port/out/RegisterRedisTokenPort.java | 1 +
.../port/out/RemoveAuthenticatorPort.java | 1 +
.../port/out/RetrieveAuthenticatorPort.java | 3 +-
.../port/out/RetrieveRedisTokenPort.java | 3 +-
.../service/RedisTokenManagementService.java | 25 +-
.../service/TokenManagementService.java | 12 +-
.../TwoFactorAuthenticationService.java | 14 +-
.../application/service/UserLoginService.java | 16 +-
.../auth/login/domain/Authenticator.java | 6 +-
.../domain/auth/login/domain/RedisToken.java | 17 +-
.../web/AbnormalAccessIpRemoveController.java | 6 +-
.../web/AbnormalAccessIpsClearController.java | 7 +-
.../AbnormalAccessIpsRetrieveController.java | 9 +-
.../RedisIpAccessMonitorAdapter.java | 21 +-
.../RedisIpAccessMonitorRepository.java | 1 +
.../in/ClearAbnormalAccessIpsUseCase.java | 4 +-
.../in/RemoveAbnormalAccessIpUseCase.java | 1 +
.../in/RetrieveAbnormalAccessIpsUseCase.java | 1 +
.../port/out/ClearIpAccessMonitorPort.java | 1 +
.../port/out/RegisterIpAccessMonitorPort.java | 1 +
.../port/out/RemoveIpAccessMonitorPort.java | 1 +
.../port/out/RetrieveIpAccessMonitorPort.java | 3 +-
.../AbnormalAccessIpRemoveService.java | 4 +-
.../AbnormalAccessIpsClearService.java | 4 +-
.../AbnormalAccessIpsRetrieveService.java | 15 +-
.../domain/RedisIpAccessMonitor.java | 3 +-
.../in/web/AccusationReportController.java | 2 +-
.../in/web/AccusationRetrievalController.java | 28 +-
.../in/web/AccusationStatusController.java | 6 +-
.../in/web/MyAccusationsController.java | 13 +-
.../out/persistence/AccuseJpaEntity.java | 4 +-
.../persistence/AccusePersistenceAdapter.java | 29 +-
.../out/persistence/AccuseRepository.java | 5 +-
.../out/persistence/AccuseTargetId.java | 3 +-
.../AccuseTargetPersistenceAdapter.java | 19 +-
.../persistence/AccuseTargetRepository.java | 3 +-
.../AccuseTargetRepositoryCustom.java | 4 +-
.../AccuseTargetRepositoryImpl.java | 20 +-
.../dto/mapper/AccuseDtoMapper.java | 51 +-
.../dto/response/AccuseMyResponseDto.java | 3 +-
.../dto/response/AccuseResponseDto.java | 5 +-
.../event/AccuseEventProcessor.java | 3 +-
.../in/ChangeAccusationStatusUseCase.java | 1 +
.../port/in/ReportAccusationUseCase.java | 1 +
.../port/in/RetrieveAccusationUseCase.java | 4 +-
.../port/in/RetrieveMyAccusationsUseCase.java | 1 +
.../port/out/RegisterAccusePort.java | 3 +-
.../port/out/RegisterAccuseTargetPort.java | 1 +
.../port/out/RetrieveAccusePort.java | 5 +-
.../port/out/RetrieveAccuseTargetPort.java | 3 +-
.../service/AccusationReportService.java | 21 +-
.../service/AccusationRetrievalService.java | 36 +-
.../service/AccusationStatusService.java | 15 +-
.../community/accuse/domain/Accuse.java | 3 +-
.../community/accuse/domain/AccuseTarget.java | 3 +-
.../web/BoardDetailsRetrievalController.java | 2 +-
.../in/web/BoardEmojiToggleController.java | 4 +-
.../in/web/BoardRegisterController.java | 3 +-
.../adapter/in/web/BoardRemoveController.java | 2 +-
.../adapter/in/web/BoardUpdateController.java | 4 +-
.../BoardsByCategoryRetrievalController.java | 21 +-
.../BoardsByHashtagRetrievalController.java | 20 +-
.../in/web/BoardsRetrievalController.java | 13 +-
.../web/DeletedBoardsRetrievalController.java | 4 +-
.../in/web/MyBoardsRetrievalController.java | 13 +-
.../out/persistence/BoardEmojiJpaEntity.java | 7 +-
.../BoardEmojiPersistenceAdapter.java | 11 +-
.../out/persistence/BoardEmojiRepository.java | 18 +-
.../BoardHashtagPersistenceAdapter.java | 15 +-
.../persistence/BoardHashtagRepository.java | 20 +-
.../out/persistence/BoardJpaEntity.java | 3 +-
.../persistence/BoardPersistenceAdapter.java | 20 +-
.../dto/mapper/BoardDtoMapper.java | 138 ++--
.../dto/mapper/BoardHashtagDtoMapper.java | 24 +-
.../dto/request/BoardRequestDto.java | 3 +-
.../dto/response/BoardDetailsResponseDto.java | 5 +-
.../dto/response/BoardListResponseDto.java | 3 +-
.../dto/response/BoardMyResponseDto.java | 3 +-
.../response/BoardOverviewResponseDto.java | 3 +-
.../event/BoardEventDispatcher.java | 3 +-
.../event/BoardEventProcessorRegistry.java | 5 +-
.../port/in/RegisterBoardHashtagUseCase.java | 1 +
.../port/in/RegisterBoardUseCase.java | 2 +-
.../port/in/RemoveBoardUseCase.java | 1 +
.../port/in/RetrieveBoardDetailsUseCase.java | 1 +
.../in/RetrieveBoardsByCategoryUseCase.java | 1 +
.../in/RetrieveBoardsByHashtagUseCase.java | 1 +
.../port/in/RetrieveDeletedBoardsUseCase.java | 1 +
.../port/in/RetrieveMyBoardsUseCase.java | 1 +
.../port/in/ToggleBoardEmojiUseCase.java | 1 +
.../port/in/UpdateBoardUseCase.java | 1 +
.../port/out/RegisterBoardEmojiPort.java | 1 +
.../port/out/RegisterBoardHashtagPort.java | 1 +
.../port/out/RegisterBoardPort.java | 1 +
.../port/out/RetrieveBoardEmojiPort.java | 3 +-
.../port/out/RetrieveBoardHashtagPort.java | 2 -
.../service/BoardDetailsRetrievalService.java | 21 +-
.../service/BoardEmojiToggleService.java | 12 +-
.../service/BoardHashtagRegisterService.java | 1 -
.../service/BoardHashtagRetrieveService.java | 16 +-
.../service/BoardRegisterService.java | 13 +-
.../service/BoardRetrievalService.java | 7 +-
.../service/BoardUpdateService.java | 93 ++-
.../BoardsByCategoryRetrievalService.java | 10 +-
.../BoardsByHashtagRetrievalService.java | 18 +-
.../DeletedBoardsRetrievalService.java | 5 +-
.../service/MyBoardsRetrievalService.java | 5 +-
.../domain/community/board/domain/Board.java | 11 +-
.../community/board/domain/BoardEmoji.java | 13 +-
.../community/board/domain/BoardHashtag.java | 5 +-
.../in/web/CommentLikeToggleController.java | 2 +-
.../in/web/CommentRegisterController.java | 6 +-
.../in/web/CommentRemoveController.java | 2 +-
.../in/web/CommentRetrievalController.java | 15 +-
.../in/web/CommentUpdateController.java | 4 +-
.../DeletedCommentsRetrievalController.java | 9 +-
.../in/web/MyCommentsRetrievalController.java | 13 +-
.../out/persistence/CommentJpaEntity.java | 5 +-
.../CommentLikePersistenceAdapter.java | 11 +-
.../persistence/CommentLikeRepository.java | 3 +-
.../out/persistence/CommentMapper.java | 59 +-
.../CommentPersistenceAdapter.java | 31 +-
.../out/persistence/CommentRepository.java | 3 +-
.../dto/mapper/CommentDtoMapper.java | 97 +--
.../dto/response/CommentMyResponseDto.java | 3 +-
.../dto/response/CommentResponseDto.java | 5 +-
.../response/DeletedCommentResponseDto.java | 3 +-
.../event/CommentEventProcessor.java | 3 +-
.../port/in/RegisterCommentUseCase.java | 1 +
.../port/in/RemoveCommentUseCase.java | 1 +
.../in/RetrieveDeletedCommentsUseCase.java | 1 +
.../port/in/RetrieveMyCommentsUseCase.java | 1 +
.../port/in/ToggleCommentLikeUseCase.java | 1 +
.../port/in/UpdateCommentUseCase.java | 1 +
.../port/out/RegisterCommentLikePort.java | 1 +
.../port/out/RegisterCommentPort.java | 3 +-
.../port/out/RemoveCommentLikePort.java | 1 +
.../port/out/RetrieveCommentLikePort.java | 4 +-
.../port/out/RetrieveCommentPort.java | 5 +-
.../service/CommentLikeToggleService.java | 25 +-
.../service/CommentRetrievalService.java | 23 +-
.../DeletedCommentsRetrievalService.java | 14 +-
.../service/MyCommentsRetrievalService.java | 14 +-
.../community/comment/domain/Comment.java | 9 +-
.../community/comment/domain/CommentLike.java | 6 +-
.../in/web/HashtagRegisterController.java | 2 +-
.../out/persistence/HashtagJpaEntity.java | 1 -
.../HashtagPersistenceAdapter.java | 12 +-
.../dto/mapper/HashtagDtoMapper.java | 16 +-
.../port/in/RegisterHashtagUseCase.java | 1 +
.../port/out/RegisterHashtagPort.java | 1 +
.../service/HashtagRetrieveService.java | 5 +-
.../community/hashtag/domain/Hashtag.java | 1 -
.../JobPostingDetailsRetrievalController.java | 5 +-
...stingsByConditionsRetrievalController.java | 31 +-
.../JobPostingPersistenceAdapter.java | 12 +-
.../out/persistence/JobPostingRepository.java | 4 +-
.../JobPostingRepositoryCustom.java | 4 +-
.../persistence/JobPostingRepositoryImpl.java | 35 +-
.../dto/mapper/JobPostingDtoMapper.java | 30 +-
.../JobPostingDetailsResponseDto.java | 3 +-
.../dto/response/JobPostingResponseDto.java | 3 +-
.../in/RetrieveJobPostingDetailsUseCase.java | 1 +
...etrieveJobPostingsByConditionsUseCase.java | 4 +-
.../port/out/RetrieveJobPostingPort.java | 3 +-
...bPostingsByConditionsRetrievalService.java | 6 +-
.../jobPosting/domain/JobPosting.java | 3 +-
.../NewsByConditionsRetrievalController.java | 24 +-
.../web/NewsDetailsRetrievalController.java | 2 +-
.../out/persistence/NewsJpaEntity.java | 5 +-
.../persistence/NewsPersistenceAdapter.java | 8 +-
.../out/persistence/NewsRepository.java | 4 +-
.../out/persistence/NewsRepositoryCustom.java | 1 +
.../out/persistence/NewsRepositoryImpl.java | 25 +-
.../application/dto/mapper/NewsDtoMapper.java | 32 +-
.../dto/response/NewsDetailsResponseDto.java | 7 +-
.../dto/response/NewsResponseDto.java | 5 +-
.../in/RetrieveNewsByConditionsUseCase.java | 1 +
.../port/in/RetrieveNewsDetailsUseCase.java | 1 +
.../domain/community/news/domain/News.java | 5 +-
.../in/web/ApplicationApplyController.java | 2 +-
.../in/web/ApplicationApprovalController.java | 12 +-
.../ApplicationMemberRegisterController.java | 9 +-
.../web/ApplicationPassCheckController.java | 4 +-
.../web/ApplicationRetrievalController.java | 29 +-
.../out/persistence/ApplicationId.java | 3 +-
.../out/persistence/ApplicationJpaEntity.java | 3 +-
.../ApplicationPersistenceAdapter.java | 27 +-
.../persistence/ApplicationRepository.java | 8 +-
.../ApplicationRepositoryCustom.java | 4 +-
.../ApplicationRepositoryImpl.java | 32 +-
.../dto/mapper/ApplicationDtoMapper.java | 98 +--
.../request/ApplicationMemberCreationDto.java | 3 +-
.../dto/request/ApplicationRequestDto.java | 3 +-
.../response/ApplicationPassResponseDto.java | 4 +-
.../dto/response/ApplicationResponseDto.java | 5 +-
.../event/ApplicationEventDispatcher.java | 3 +-
.../ApplicationEventProcessorRegistry.java | 5 +-
.../port/in/ApplyForApplicationUseCase.java | 1 +
.../port/in/ApproveApplicationUseCase.java | 1 +
.../in/CheckApplicationPassStatusUseCase.java | 1 +
.../port/in/RejectApplicationUseCase.java | 1 +
.../port/in/RetrieveApplicationsUseCase.java | 4 +-
.../port/out/RegisterApplicationPort.java | 1 +
.../port/out/RetrieveApplicationPort.java | 5 +-
.../service/ApplicationApplyService.java | 4 +-
.../ApplicationMemberRegisterService.java | 28 +-
.../service/ApplicationPassCheckService.java | 4 +-
.../service/ApplicationRetrievalService.java | 6 +-
.../application/domain/Application.java | 5 +-
...RecentRecruitmentsRetrievalController.java | 7 +-
.../in/web/RecruitmentRegisterController.java | 2 +-
.../in/web/RecruitmentUpdateController.java | 4 +-
.../out/persistence/RecruitmentJpaEntity.java | 3 +-
.../RecruitmentPersistenceAdapter.java | 28 +-
.../persistence/RecruitmentRepository.java | 5 +-
.../dto/mapper/RecruitmentDtoMapper.java | 34 +-
.../dto/request/RecruitmentRequestDto.java | 3 +-
.../request/RecruitmentUpdateRequestDto.java | 3 +-
.../dto/response/RecruitmentResponseDto.java | 3 +-
.../port/in/RegisterRecruitmentUseCase.java | 1 +
.../in/RetrieveRecentRecruitmentsUseCase.java | 3 +-
.../port/in/RetrieveRecruitmentUseCase.java | 1 +
.../port/in/UpdateRecruitmentUseCase.java | 1 +
.../port/out/RegisterRecruitmentPort.java | 1 +
.../port/out/RetrieveRecruitmentPort.java | 3 +-
.../port/out/UpdateRecruitmentPort.java | 1 +
.../RecentRecruitmentsRetrievalService.java | 15 +-
.../service/RecruitmentStatusUpdater.java | 5 +-
.../recruitment/domain/Recruitment.java | 7 +-
.../web/BookDetailsRetrievalController.java | 2 +-
.../in/web/BookRegisterController.java | 2 +-
.../adapter/in/web/BookRemoveController.java | 2 +-
.../adapter/in/web/BookUpdateController.java | 4 +-
.../BooksByConditionsRetrievalController.java | 30 +-
.../out/persistence/BookJpaEntity.java | 3 +-
.../persistence/BookPersistenceAdapter.java | 15 +-
.../out/persistence/BookRepository.java | 4 +-
.../out/persistence/BookRepositoryCustom.java | 4 +-
.../out/persistence/BookRepositoryImpl.java | 44 +-
.../application/dto/mapper/BookDtoMapper.java | 71 +-
.../dto/request/BookRequestDto.java | 3 +-
.../dto/request/BookUpdateRequestDto.java | 3 +-
.../dto/response/BookDetailsResponseDto.java | 5 +-
.../dto/response/BookResponseDto.java | 3 +-
.../port/in/RegisterBookUseCase.java | 1 +
.../port/in/RemoveBookUseCase.java | 1 +
.../port/in/RetrieveBookDetailsUseCase.java | 1 +
.../in/RetrieveBooksByConditionsUseCase.java | 4 +-
.../port/in/UpdateBookUseCase.java | 1 +
.../port/out/RegisterBookPort.java | 1 +
.../application/port/out/RemoveBookPort.java | 1 +
.../port/out/RetrieveBookPort.java | 3 +-
.../port/out/RetrieveDeletedBooksPort.java | 1 +
.../service/BookDetailsRetrievalService.java | 3 +-
.../BooksByConditionsRetrievalService.java | 9 +-
.../api/domain/library/book/domain/Book.java | 7 +-
.../in/web/BookLoanApprovalController.java | 2 +-
.../in/web/BookLoanExtensionController.java | 2 +-
...ecordsByConditionsRetrievalController.java | 28 +-
.../in/web/BookLoanRejectionController.java | 2 +-
.../in/web/BookLoanRequestController.java | 2 +-
.../adapter/in/web/BookReturnController.java | 2 +-
...dueBookLoanRecordsRetrievalController.java | 18 +-
.../persistence/BookLoanRecordJpaEntity.java | 3 +-
.../BookLoanRecordPersistenceAdapter.java | 29 +-
.../persistence/BookLoanRecordRepository.java | 12 +-
.../BookLoanRecordRepositoryCustom.java | 3 +-
.../BookLoanRecordRepositoryImpl.java | 124 +--
.../BookLoanRecordOverdueResponseDto.java | 3 +-
.../response/BookLoanRecordResponseDto.java | 3 +-
.../port/in/ApproveBookLoanUseCase.java | 1 +
.../port/in/ExtendBookLoanUseCase.java | 1 +
.../port/in/RejectBookLoanUseCase.java | 1 +
.../port/in/RequestBookLoanUseCase.java | 1 +
...eveBookLoanRecordsByConditionsUseCase.java | 4 +-
...RetrieveOverdueBookLoanRecordsUseCase.java | 1 +
.../port/in/ReturnBookUseCase.java | 1 +
.../port/out/RegisterBookLoanRecordPort.java | 1 +
.../port/out/RetrieveBookLoanRecordPort.java | 9 +-
.../service/BookLoanApprovalService.java | 3 +-
.../service/BookLoanExtensionService.java | 10 +-
...anRecordsByConditionsRetrievalService.java | 6 +-
.../service/BookLoanRequestService.java | 12 +-
.../service/BookReturnService.java | 13 +-
...verdueBookLoanRecordsRetrievalService.java | 3 +-
.../bookLoanRecord/domain/BookLoanRecord.java | 17 +-
.../in/web/AwardRegisterController.java | 2 +-
.../adapter/in/web/AwardRemoveController.java | 4 +-
.../in/web/AwardRetrievalController.java | 21 +-
.../adapter/in/web/AwardUpdateController.java | 6 +-
.../web/DeletedAwardRetrievalController.java | 4 +-
.../in/web/MyAwardRetrievalController.java | 13 +-
.../out/persistence/AwardJpaEntity.java | 3 +-
.../persistence/AwardPersistenceAdapter.java | 27 +-
.../out/persistence/AwardRepository.java | 3 +-
.../persistence/AwardRepositoryCustom.java | 1 +
.../out/persistence/AwardRepositoryImpl.java | 27 +-
.../dto/mapper/AwardDtoMapper.java | 26 +-
.../dto/request/AwardRequestDto.java | 3 +-
.../dto/request/AwardUpdateRequestDto.java | 3 +-
.../dto/response/AwardResponseDto.java | 3 +-
.../event/AwardEventProcessor.java | 3 +-
.../port/in/RegisterAwardUseCase.java | 1 +
.../port/in/RemoveAwardUseCase.java | 1 +
.../port/in/RetrieveAwardsUseCase.java | 1 +
.../port/in/RetrieveDeletedAwardsUseCase.java | 1 +
.../port/in/RetrieveMyAwardsUseCase.java | 1 +
.../port/in/UpdateAwardUseCase.java | 1 +
.../port/out/RegisterAwardPort.java | 3 +-
.../application/port/out/RemoveAwardPort.java | 1 +
.../port/out/RetrieveAwardPort.java | 3 +-
.../memberManagement/award/domain/Award.java | 5 +-
.../web/CloudUsageRetrievalAllController.java | 7 +-
...oudUsageRetrievalByMemberIdController.java | 4 +-
...sInMemberDirectoryRetrievalController.java | 11 +-
.../dto/mapper/CloudDtoMapper.java | 6 +-
.../port/in/RetrieveAllCloudUsageUseCase.java | 1 +
.../RetrieveCloudUsageByMemberIdUseCase.java | 1 +
...RetrieveFilesInMemberDirectoryUseCase.java | 1 +
.../CloudUsageRetrievalAllService.java | 3 +-
.../CloudUsageRetrievalByMemberIdService.java | 3 +-
...ilesInMemberDirectoryRetrievalService.java | 5 +-
...rBirthdayRetrievalThisMonthController.java | 20 +-
.../in/web/MemberInfoUpdateController.java | 6 +-
.../in/web/MemberPasswordController.java | 6 +-
.../in/web/MemberRegisterController.java | 2 +-
.../in/web/MemberRemoveController.java | 2 +-
.../MemberRoleInfoRetrievalController.java | 29 +-
.../web/MemberRoleManagementController.java | 10 +-
...embersByConditionsRetrievalController.java | 20 +-
.../out/persistence/MemberJpaEntity.java | 5 +-
.../persistence/MemberPersistenceAdapter.java | 29 +-
.../out/persistence/MemberRepository.java | 6 +-
.../persistence/MemberRepositoryCustom.java | 3 +-
.../out/persistence/MemberRepositoryImpl.java | 82 +-
.../dto/mapper/MemberDtoMapper.java | 178 ++---
.../dto/request/MemberRequestDto.java | 3 +-
.../dto/request/MemberUpdateRequestDto.java | 3 +-
.../response/MemberBirthdayResponseDto.java | 3 +-
.../dto/response/MemberResponseDto.java | 5 +-
.../dto/response/MyProfileResponseDto.java | 3 +-
.../dto/shared/MemberBorrowerInfoDto.java | 3 +-
.../event/MemberEventDispatcher.java | 3 +-
.../event/MemberEventProcessorRegistry.java | 3 +-
.../port/in/ManageMemberRoleUseCase.java | 1 +
.../port/in/RegisterMemberUseCase.java | 1 +
.../port/in/RemoveMemberUseCase.java | 1 +
...trieveMemberBirthdaysThisMonthUseCase.java | 1 +
.../in/RetrieveMemberRoleInfoUseCase.java | 4 +-
.../port/in/RetrieveMemberUseCase.java | 1 +
.../RetrieveMembersByConditionsUseCase.java | 1 +
.../port/in/RetrieveMyProfileUseCase.java | 1 +
.../port/in/UpdateMemberUseCase.java | 1 +
.../port/out/RegisterMemberPort.java | 1 +
.../port/out/RetrieveMemberPort.java | 5 +-
.../port/out/UpdateMemberPort.java | 1 +
.../MemberPasswordManagementService.java | 4 +-
.../service/MemberRegisterService.java | 24 +-
.../MemberRoleInfoRetrievalService.java | 3 +-
.../service/MemberRoleManagementService.java | 8 +-
.../member/domain/Member.java | 45 +-
.../web/NotificationsRetrievalController.java | 19 +-
.../NotificationPersistenceAdapter.java | 21 +-
.../persistence/NotificationRepository.java | 3 +-
.../dto/mapper/NotificationDtoMapper.java | 8 +-
.../dto/response/NotificationResponseDto.java | 3 +-
.../event/NotificationEventProcessor.java | 3 +-
.../port/in/RetrieveNotificationsUseCase.java | 1 +
.../port/out/RegisterNotificationPort.java | 3 +-
.../port/out/RetrieveNotificationPort.java | 3 +-
.../notification/domain/Notification.java | 11 +-
.../MyPositionsByYearRetrievalController.java | 2 +-
.../in/web/PositionRegisterController.java | 2 +-
.../in/web/PositionRemoveController.java | 2 +-
...itionsByConditionsRetrievalController.java | 24 +-
.../PositionPersistenceAdapter.java | 34 +-
.../out/persistence/PositionRepository.java | 11 +-
.../persistence/PositionRepositoryCustom.java | 1 +
.../persistence/PositionRepositoryImpl.java | 25 +-
.../dto/mapper/PositionDtoMapper.java | 57 +-
.../dto/response/PositionMyResponseDto.java | 5 +-
.../event/PositionEventProcessor.java | 4 +-
.../port/in/RegisterPositionUseCase.java | 1 +
.../port/in/RemovePositionUseCase.java | 1 +
.../in/RetrieveMyPositionsByYearUseCase.java | 1 +
.../RetrievePositionsByConditionsUseCase.java | 1 +
.../port/out/RegisterPositionPort.java | 3 +-
.../port/out/RetrievePositionPort.java | 5 +-
.../port/out/UpdatePositionPort.java | 1 +
.../MyPositionsByYearRetrievalService.java | 5 +-
.../service/PositionRegisterService.java | 12 +-
...PositionsByConditionsRetrievalService.java | 3 +-
.../position/domain/Position.java | 13 +-
...tedWorkExperiencesRetrievalController.java | 6 +-
.../MyWorkExperienceRetrievalController.java | 21 +-
.../web/WorkExperienceRegisterController.java | 2 +-
.../web/WorkExperienceRemoveController.java | 4 +-
.../web/WorkExperienceUpdateController.java | 6 +-
...iencesByConditionsRetrievalController.java | 23 +-
.../persistence/WorkExperienceJpaEntity.java | 3 +-
.../WorkExperiencePersistenceAdapter.java | 29 +-
.../persistence/WorkExperienceRepository.java | 3 +-
.../dto/mapper/WorkExperienceDtoMapper.java | 26 +-
.../dto/request/WorkExperienceRequestDto.java | 3 +-
.../WorkExperienceUpdateRequestDto.java | 3 +-
.../response/WorkExperienceResponseDto.java | 3 +-
.../event/WorkExperienceEventProcessor.java | 3 +-
.../in/RegisterWorkExperienceUseCase.java | 1 +
.../port/in/RemoveWorkExperienceUseCase.java | 1 +
...RetrieveDeletedWorkExperiencesUseCase.java | 1 +
.../in/RetrieveMyWorkExperienceUseCase.java | 1 +
...eveWorkExperiencesByConditionsUseCase.java | 1 +
.../port/in/UpdateWorkExperienceUseCase.java | 4 +-
.../port/out/RegisterWorkExperiencePort.java | 3 +-
.../port/out/RetrieveWorkExperiencePort.java | 3 +-
.../port/out/UpdateWorkExperiencePort.java | 1 +
.../service/WorkExperienceUpdateService.java | 3 +-
.../workExperience/domain/WorkExperience.java | 5 +-
.../web/ActivityPhotoRegisterController.java | 2 +-
.../in/web/ActivityPhotoRemoveController.java | 2 +-
.../web/ActivityPhotoRetrievalController.java | 23 +-
.../ActivityPhotoVisibilityController.java | 2 +-
.../persistence/ActivityPhotoJpaEntity.java | 5 +-
.../ActivityPhotoPersistenceAdapter.java | 11 +-
.../persistence/ActivityPhotoRepository.java | 4 +-
.../ActivityPhotoRepositoryCustom.java | 1 +
.../ActivityPhotoRepositoryImpl.java | 21 +-
.../dto/mapper/ActivityPhotoDtoMapper.java | 29 +-
.../dto/request/ActivityPhotoRequestDto.java | 5 +-
.../response/ActivityPhotoResponseDto.java | 7 +-
.../port/in/RegisterActivityPhotoUseCase.java | 1 +
.../port/in/RemoveActivityPhotoUseCase.java | 1 +
.../port/in/RetrieveActivityPhotoUseCase.java | 1 +
.../ToggleActivityPhotoVisibilityUseCase.java | 1 +
.../port/out/RegisterActivityPhotoPort.java | 1 +
.../service/ActivityPhotoRegisterService.java | 3 +-
.../activityPhoto/domain/ActivityPhoto.java | 5 +-
.../web/BlogDetailsRetrievalController.java | 2 +-
.../in/web/BlogRegisterController.java | 2 +-
.../adapter/in/web/BlogRemoveController.java | 2 +-
.../adapter/in/web/BlogUpdateController.java | 4 +-
.../in/web/BlogsRetrievalController.java | 21 +-
.../web/DeletedBlogsRetrievalController.java | 4 +-
.../persistence/BlogPersistenceAdapter.java | 12 +-
.../out/persistence/BlogRepository.java | 6 +-
.../out/persistence/BlogRepositoryCustom.java | 1 +
.../out/persistence/BlogRepositoryImpl.java | 31 +-
.../application/dto/mapper/BlogDtoMapper.java | 52 +-
.../dto/response/BlogDetailsResponseDto.java | 3 +-
.../dto/response/BlogResponseDto.java | 3 +-
.../port/in/RegisterBlogUseCase.java | 1 +
.../port/in/RemoveBlogUseCase.java | 1 +
.../port/in/RetrieveBlogDetailsUseCase.java | 1 +
.../port/in/RetrieveBlogsUseCase.java | 1 +
.../port/in/RetrieveDeletedBlogsUseCase.java | 1 +
.../port/in/UpdateBlogUseCase.java | 1 +
.../port/out/RegisterBlogPort.java | 1 +
.../service/DeletedBlogsRetrievalService.java | 3 +-
.../api/domain/members/blog/domain/Blog.java | 5 +-
.../DeletedDonationsRetrievalController.java | 7 +-
.../in/web/DonationRegisterController.java | 2 +-
.../in/web/DonationRemoveController.java | 2 +-
.../in/web/DonationUpdateController.java | 4 +-
...ationsByConditionsRetrievalController.java | 30 +-
.../web/MyDonationsRetrievalController.java | 13 +-
.../DonationPersistenceAdapter.java | 20 +-
.../out/persistence/DonationRepository.java | 3 +-
.../persistence/DonationRepositoryCustom.java | 7 +-
.../persistence/DonationRepositoryImpl.java | 46 +-
.../dto/mapper/DonationDtoMapper.java | 24 +-
.../dto/response/DonationResponseDto.java | 3 +-
.../port/in/RegisterDonationUseCase.java | 1 +
.../port/in/RemoveDonationUseCase.java | 1 +
.../in/RetrieveDeletedDonationsUseCase.java | 1 +
.../RetrieveDonationsByConditionsUseCase.java | 7 +-
.../port/in/RetrieveMyDonationsUseCase.java | 1 +
.../port/in/UpdateDonationUseCase.java | 4 +-
.../port/out/RegisterDonationPort.java | 1 +
.../port/out/RetrieveDonationPort.java | 6 +-
.../DeletedDonationsRetrievalService.java | 3 +-
.../service/DonationUpdateService.java | 3 +-
...DonationsByConditionsRetrievalService.java | 9 +-
.../service/MyDonationsRetrievalService.java | 3 +-
.../members/donation/domain/Donation.java | 5 +-
...etedMembershipFeesRetrievalController.java | 6 +-
.../web/MembershipFeeRegisterController.java | 2 +-
.../in/web/MembershipFeeRemoveController.java | 2 +-
.../in/web/MembershipFeeUpdateController.java | 4 +-
...ipFeesByConditionsRetrievalController.java | 33 +-
.../MembershipFeePersistenceAdapter.java | 17 +-
.../persistence/MembershipFeeRepository.java | 2 +-
.../MembershipFeeRepositoryCustom.java | 4 +-
.../MembershipFeeRepositoryImpl.java | 40 +-
.../dto/mapper/MembershipFeeDtoMapper.java | 40 +-
.../response/MembershipFeeResponseDto.java | 3 +-
.../port/in/RegisterMembershipFeeUseCase.java | 1 +
.../port/in/RemoveMembershipFeeUseCase.java | 1 +
.../RetrieveDeletedMembershipFeesUseCase.java | 1 +
...ieveMembershipFeesByConditionsUseCase.java | 4 +-
.../port/in/UpdateMembershipFeeUseCase.java | 4 +-
.../port/out/RegisterMembershipFeePort.java | 1 +
.../port/out/RetrieveMembershipFeePort.java | 3 +-
.../port/out/UpdateMembershipFeePort.java | 1 +
...DeletedMembershipFeesRetrievalService.java | 2 +-
.../service/MembershipFeeRegisterService.java | 4 +-
.../service/MembershipFeeUpdateService.java | 3 +-
...rshipFeesByConditionsRetrievalService.java | 12 +-
.../membershipFee/domain/MembershipFee.java | 5 +-
.../DeletedProductsRetrievalController.java | 7 +-
.../in/web/ProductRegisterController.java | 2 +-
.../in/web/ProductRemoveController.java | 2 +-
.../in/web/ProductUpdateController.java | 4 +-
...oductsByConditionsRetrievalController.java | 20 +-
.../ProductPersistenceAdapter.java | 14 +-
.../out/persistence/ProductRepository.java | 3 +-
.../persistence/ProductRepositoryCustom.java | 1 +
.../persistence/ProductRepositoryImpl.java | 17 +-
.../dto/mapper/ProductDtoMapper.java | 22 +-
.../dto/response/ProductResponseDto.java | 3 +-
.../port/in/RegisterProductUseCase.java | 1 +
.../port/in/RemoveProductUseCase.java | 1 +
.../in/RetrieveDeletedProductsUseCase.java | 1 +
.../RetrieveProductsByConditionsUseCase.java | 1 +
.../port/in/UpdateProductUseCase.java | 1 +
.../port/out/RegisterProductPort.java | 1 +
.../port/out/UpdateProductPort.java | 1 +
.../members/product/domain/Product.java | 5 +-
.../ActivitySchedulesRetrievalController.java | 21 +-
.../in/web/ScheduleRegisterController.java | 2 +-
.../in/web/ScheduleRemoveController.java | 2 +-
...edulesByConditionsRetrievalController.java | 25 +-
...lesWithinDateRangeRetrievalController.java | 21 +-
.../out/persistence/ScheduleJpaEntity.java | 3 +-
.../SchedulePersistenceAdapter.java | 25 +-
.../out/persistence/ScheduleRepository.java | 4 +-
.../persistence/ScheduleRepositoryCustom.java | 11 +-
.../persistence/ScheduleRepositoryImpl.java | 78 +-
.../dto/mapper/ScheduleDtoMapper.java | 42 +-
.../dto/request/ScheduleRequestDto.java | 3 +-
.../dto/response/ScheduleResponseDto.java | 3 +-
.../port/in/RegisterScheduleUseCase.java | 1 +
.../port/in/RemoveScheduleUseCase.java | 1 +
.../in/RetrieveActivitySchedulesUseCase.java | 7 +-
.../in/RetrieveCollectSchedulesUseCase.java | 1 +
.../RetrieveSchedulesByConditionsUseCase.java | 4 +-
...trieveSchedulesWithinDateRangeUseCase.java | 7 +-
.../port/out/RegisterSchedulePort.java | 1 +
.../port/out/RetrieveSchedulePort.java | 11 +-
.../ActivitySchedulesRetrievalService.java | 9 +-
.../service/ScheduleRegisterService.java | 19 +-
...SchedulesByConditionsRetrievalService.java | 3 +-
...edulesWithinDateRangeRetrievalService.java | 17 +-
.../members/schedule/domain/Schedule.java | 3 +-
...ternalRegisterAccountAccessLogUseCase.java | 1 +
...ternalAccountAccessLogRegisterService.java | 6 +-
.../ExternalManageAccountLockUseCase.java | 3 +-
.../ExternalAccountLockManagementService.java | 8 +-
.../ExternalRegisterBlacklistIpUseCase.java | 1 +
.../ExternalRetrieveBlacklistIpUseCase.java | 1 +
.../port/ExternalCheckIpBlockedUseCase.java | 1 +
...xternalRegisterIpAccessMonitorUseCase.java | 1 +
...xternalIpAccessMonitorRegisterService.java | 16 +-
.../port/ExternalRegisterCommentUseCase.java | 1 +
.../ExternalHashtagRetrievalService.java | 1 -
.../ExternalRetrieveRecruitmentUseCase.java | 1 +
.../port/ExternalRegisterBookUseCase.java | 1 +
...xternalBookLoanRecordRetrievalService.java | 7 +-
...alRetrieveCloudUsageByMemberIdUseCase.java | 1 +
.../port/ExternalRegisterMemberUseCase.java | 1 +
.../port/ExternalRetrieveMemberUseCase.java | 5 +-
.../ExternalMemberRetrievalService.java | 33 +-
.../service/ExternalMemberUpdateService.java | 3 +-
.../ExternalSendNotificationService.java | 17 +-
.../port/ExternalRegisterPositionUseCase.java | 1 +
.../port/ExternalRetrievePositionUseCase.java | 4 +-
.../ExternalPositionRetrievalService.java | 6 +-
.../application/CustomUserDetailsService.java | 4 +-
.../CustomBasicAuthenticationFilter.java | 26 +-
.../auth/filter/FileAccessControlFilter.java | 6 +-
.../filter/InvalidEndpointAccessFilter.java | 10 +-
.../auth/filter/IpAuthenticationFilter.java | 13 +-
.../auth/filter/JwtAuthenticationFilter.java | 12 +-
.../api/global/auth/jwt/JwtTokenProvider.java | 69 +-
.../clab/api/global/auth/util/AuthUtil.java | 3 +-
.../auth/util/IpWhitelistValidator.java | 10 +-
.../global/auth/util/WhitelistFileLoader.java | 28 +-
.../api/global/common/domain/BaseEntity.java | 3 +-
.../api/global/common/dto/ApiResponse.java | 22 +-
.../api/global/common/dto/ErrorResponse.java | 6 +-
.../global/common/dto/PagedResponseDto.java | 65 +-
.../email/application/EmailAsyncService.java | 35 +-
.../email/application/EmailService.java | 60 +-
.../global/common/email/domain/EmailTask.java | 5 +-
.../email/dto/mapper/EmailDtoMapper.java | 13 +-
.../common/email/dto/request/EmailDto.java | 6 +-
.../common/file/api/FileController.java | 58 +-
.../file/application/AutoDeleteService.java | 22 +-
.../common/file/application/FileHandler.java | 26 +-
.../common/file/application/FileService.java | 84 +-
.../file/application/UploadedFileService.java | 9 +-
.../common/file/dao/UploadFileRepository.java | 5 +-
.../common/file/domain/UploadedFile.java | 23 +-
.../common/file/dto/mapper/FileDtoMapper.java | 35 +-
.../common/file/dto/response/FileInfo.java | 3 +-
.../dto/response/UploadedFileResponseDto.java | 3 +-
.../NotificationSettingToggleController.java | 2 +-
...NotificationSettingPersistenceAdapter.java | 4 +-
.../out/webhook/AbstractWebhookClient.java | 4 +-
.../webhook/DiscordNotificationSender.java | 2 +-
.../out/webhook/DiscordWebhookClient.java | 96 +--
.../out/webhook/SlackNotificationSender.java | 2 +-
.../out/webhook/SlackWebhookClient.java | 160 ++--
.../mapper/NotificationSettingDtoMapper.java | 6 +-
.../notification/BoardNotificationInfo.java | 10 +-
.../BookLoanRecordNotificationInfo.java | 12 +-
.../MembershipFeeNotificationInfo.java | 12 +-
.../event/ApplicationStartupListener.java | 2 +-
.../event/NotificationListener.java | 32 +-
.../application/port/out/WebhookClient.java | 2 +-
.../ManageNotificationSettingService.java | 2 +-
.../RetrieveNotificationSettingService.java | 4 +-
.../service/WebhookCommonService.java | 14 +-
.../config/NotificationConfigProperties.java | 3 +
.../domain/NotificationSetting.java | 6 +-
.../application/VerificationService.java | 9 +-
.../dao/VerificationRepository.java | 4 +-
.../verification/domain/Verification.java | 6 +-
.../clab/api/global/config/AppConfig.java | 8 +-
.../clab/api/global/config/AsyncConfig.java | 3 +-
.../global/config/AuthenticationConfig.java | 9 +-
.../clab/api/global/config/CorsConfig.java | 5 +-
.../config/EmailTemplateProperties.java | 4 +-
.../clab/api/global/config/IPInfoConfig.java | 10 +-
.../clab/api/global/config/JpaConfig.java | 1 +
.../clab/api/global/config/OpenApiConfig.java | 40 +-
.../global/config/RoleHierarchyConfig.java | 8 +-
.../api/global/config/SecurityConfig.java | 92 +--
.../api/global/config/SecurityConstants.java | 48 +-
.../api/global/config/ThymeleafConfig.java | 6 +-
.../clab/api/global/config/WebConfig.java | 38 +-
.../config/WhitelistPatternsProperties.java | 9 +-
.../api/global/filter/IPinfoSpringFilter.java | 15 +-
.../api/global/filter/PostResponseFilter.java | 9 +-
.../global/handler/ApiLoggingInterceptor.java | 6 +-
.../handler/GlobalExceptionHandler.java | 182 ++---
.../page/clab/api/global/util/ApiLogger.java | 16 +-
.../clab/api/global/util/ColumnValidator.java | 9 +-
.../page/clab/api/global/util/EmojiUtils.java | 11 +-
.../clab/api/global/util/EncryptionUtil.java | 18 +-
.../clab/api/global/util/FileSystemUtil.java | 4 +-
.../page/clab/api/global/util/FileUtil.java | 33 +-
.../api/global/util/HtmlCharacterEscapes.java | 5 +-
.../clab/api/global/util/HttpReqResUtil.java | 147 ++--
.../page/clab/api/global/util/IPInfoUtil.java | 18 +-
.../page/clab/api/global/util/ImageUtil.java | 32 +-
.../clab/api/global/util/IpAddressUtil.java | 3 +-
.../api/global/util/LogSanitizerUtil.java | 7 +-
.../api/global/util/OrderSpecifierUtil.java | 9 +-
.../clab/api/global/util/PageableUtils.java | 20 +-
.../clab/api/global/util/PaginationUtils.java | 51 +-
.../page/clab/api/global/util/QRCodeUtil.java | 4 +-
.../api/global/util/RandomNicknameUtil.java | 25 +-
.../clab/api/global/util/ResponseUtil.java | 6 +-
.../global/util/SecurityPatternChecker.java | 156 ++--
.../api/global/util/StringJsonConverter.java | 3 +-
.../clab/api/global/util/TempFileUtil.java | 2 +-
.../api/global/util/WhitelistPathMatcher.java | 6 +-
src/main/resources/logback-spring.xml | 100 +--
src/main/resources/templates/clabEmail.html | 721 +++++++++++-------
800 files changed, 5409 insertions(+), 4926 deletions(-)
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/api/ActivityGroupAdminController.java b/src/main/java/page/clab/api/domain/activity/activitygroup/api/ActivityGroupAdminController.java
index 1f3c4980e..5fc50e875 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/api/ActivityGroupAdminController.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/api/ActivityGroupAdminController.java
@@ -3,6 +3,7 @@
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
+import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
@@ -33,8 +34,6 @@
import page.clab.api.global.exception.SortingArgumentException;
import page.clab.api.global.util.PageableUtils;
-import java.util.List;
-
@RestController
@RequestMapping("/api/v1/activity-group/admin")
@RequiredArgsConstructor
@@ -48,7 +47,7 @@ public class ActivityGroupAdminController {
@PreAuthorize("hasRole('USER')")
@PostMapping("")
public ApiResponse createActivityGroup(
- @Valid @RequestBody ActivityGroupRequestDto requestDto
+ @Valid @RequestBody ActivityGroupRequestDto requestDto
) {
Long id = activityGroupAdminService.createActivityGroup(requestDto);
return ApiResponse.success(id);
@@ -58,8 +57,8 @@ public ApiResponse createActivityGroup(
@PreAuthorize("hasRole('USER')")
@PatchMapping("/{activityGroupId}")
public ApiResponse updateActivityGroup(
- @PathVariable(name = "activityGroupId") Long activityGroupId,
- @Valid @RequestBody ActivityGroupUpdateRequestDto requestDto
+ @PathVariable(name = "activityGroupId") Long activityGroupId,
+ @Valid @RequestBody ActivityGroupUpdateRequestDto requestDto
) throws PermissionDeniedException {
Long id = activityGroupAdminService.updateActivityGroup(activityGroupId, requestDto);
return ApiResponse.success(id);
@@ -69,10 +68,11 @@ public ApiResponse updateActivityGroup(
@PreAuthorize("hasRole('ADMIN')")
@PatchMapping("manage/{activityGroupId}")
public ApiResponse manageActivityGroupStatus(
- @PathVariable(name = "activityGroupId") Long activityGroupId,
- @RequestParam(name = "activityGroupStatus") ActivityGroupStatus status
+ @PathVariable(name = "activityGroupId") Long activityGroupId,
+ @RequestParam(name = "activityGroupStatus") ActivityGroupStatus status
) {
- ActivityGroupBoardStatusUpdatedResponseDto updatedStatusDto = activityGroupAdminService.manageActivityGroup(activityGroupId, status);
+ ActivityGroupBoardStatusUpdatedResponseDto updatedStatusDto = activityGroupAdminService.manageActivityGroup(
+ activityGroupId, status);
return ApiResponse.success(updatedStatusDto);
}
@@ -80,19 +80,19 @@ public ApiResponse manageActivityGro
@PreAuthorize("hasRole('USER')")
@DeleteMapping("/{activityGroupId}")
public ApiResponse deleteActivityGroup(
- @PathVariable(name = "activityGroupId") Long activityGroupId
+ @PathVariable(name = "activityGroupId") Long activityGroupId
) throws PermissionDeniedException {
Long id = activityGroupAdminService.deleteActivityGroup(activityGroupId);
return ApiResponse.success(id);
}
@Operation(summary = "[U] 프로젝트 진행도 수정", description = "ROLE_USER 이상의 권한이 필요함
" +
- "진행도는 0~100 사이의 값으로 입력해야 함")
+ "진행도는 0~100 사이의 값으로 입력해야 함")
@PreAuthorize("hasRole('USER')")
@PatchMapping("/progress/{activityGroupId}")
public ApiResponse updateProjectProgress(
- @PathVariable(name = "activityGroupId") Long activityGroupId,
- @RequestParam(name = "progress") Long progress
+ @PathVariable(name = "activityGroupId") Long activityGroupId,
+ @RequestParam(name = "progress") Long progress
) throws PermissionDeniedException {
Long id = activityGroupAdminService.updateProjectProgress(activityGroupId, progress);
return ApiResponse.success(id);
@@ -102,27 +102,29 @@ public ApiResponse updateProjectProgress(
@PreAuthorize("hasRole('USER')")
@PostMapping("/schedule")
public ApiResponse addSchedule(
- @RequestParam(name = "activityGroupId") Long activityGroupId,
- @Valid @RequestBody List scheduleDtos
+ @RequestParam(name = "activityGroupId") Long activityGroupId,
+ @Valid @RequestBody List scheduleDtos
) throws PermissionDeniedException {
Long id = activityGroupAdminService.addSchedule(activityGroupId, scheduleDtos);
return ApiResponse.success(id);
}
@Operation(summary = "[U] 활동 멤버 및 지원서 조회", description = "ROLE_USER 이상의 권한이 필요함
" +
- "관리자 또는 리더만 조회 가능
" +
- "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
+ "관리자 또는 리더만 조회 가능
" +
+ "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
@PreAuthorize("hasRole('USER')")
@GetMapping("/members")
public ApiResponse> getApplyGroupMemberList(
- @RequestParam(name = "activityGroupId") Long activityGroupId,
- @RequestParam(name = "page", defaultValue = "0") int page,
- @RequestParam(name = "size", defaultValue = "20") int size,
- @RequestParam(name = "sortBy", defaultValue = "status") List sortBy,
- @RequestParam(name = "sortDirection", defaultValue = "asc") List sortDirection
+ @RequestParam(name = "activityGroupId") Long activityGroupId,
+ @RequestParam(name = "page", defaultValue = "0") int page,
+ @RequestParam(name = "size", defaultValue = "20") int size,
+ @RequestParam(name = "sortBy", defaultValue = "status") List sortBy,
+ @RequestParam(name = "sortDirection", defaultValue = "asc") List sortDirection
) throws SortingArgumentException, PermissionDeniedException, InvalidColumnException {
- Pageable pageable = pageableUtils.createPageable(page, size, sortBy, sortDirection, ActivityGroupMemberWithApplyReasonResponseDto.class);
- PagedResponseDto groupMembers = activityGroupAdminService.getGroupMembersWithApplyReason(activityGroupId, pageable);
+ Pageable pageable = pageableUtils.createPageable(page, size, sortBy, sortDirection,
+ ActivityGroupMemberWithApplyReasonResponseDto.class);
+ PagedResponseDto groupMembers = activityGroupAdminService.getGroupMembersWithApplyReason(
+ activityGroupId, pageable);
return ApiResponse.success(groupMembers);
}
@@ -130,24 +132,24 @@ public ApiResponse acceptGroupMember(
- @RequestParam(name = "activityGroupId") Long activityGroupId,
- @RequestParam(name = "memberId") List memberIds,
- @RequestParam(name = "status") GroupMemberStatus status
+ @RequestParam(name = "activityGroupId") Long activityGroupId,
+ @RequestParam(name = "memberId") List memberIds,
+ @RequestParam(name = "status") GroupMemberStatus status
) throws PermissionDeniedException {
Long id = activityGroupAdminService.manageGroupMemberStatus(activityGroupId, memberIds, status);
return ApiResponse.success(id);
}
@Operation(summary = "[U] 활동 멤버 직책 변경", description = "ROLE_USER 이상의 권한이 필요함
" +
- "직책은 팀장만 변경 가능
" +
- "LEADER: 팀장, MEMBER: 팀원, NONE: 없음
" +
- "LEADER -> MEMBER, MEMBER -> LEADER 변경만 허용함")
+ "직책은 팀장만 변경 가능
" +
+ "LEADER: 팀장, MEMBER: 팀원, NONE: 없음
" +
+ "LEADER -> MEMBER, MEMBER -> LEADER 변경만 허용함")
@PreAuthorize("hasRole('USER')")
@PatchMapping("/position")
public ApiResponse changeGroupMemberPosition(
- @RequestParam(name = "activityGroupId") Long activityGroupId,
- @RequestParam(name = "memberId") String memberId,
- @RequestParam(name = "position") ActivityGroupRole position
+ @RequestParam(name = "activityGroupId") Long activityGroupId,
+ @RequestParam(name = "memberId") String memberId,
+ @RequestParam(name = "position") ActivityGroupRole position
) throws PermissionDeniedException {
Long id = activityGroupAdminService.changeGroupMemberPosition(activityGroupId, memberId, position);
return ApiResponse.success(id);
@@ -157,11 +159,12 @@ public ApiResponse changeGroupMemberPosition(
@Operation(summary = "[S] 삭제된 활동그룹 조회하기", description = "ROLE_SUPER 이상의 권한이 필요함")
@PreAuthorize("hasRole('SUPER')")
public ApiResponse> getDeletedActivityGroups(
- @RequestParam(name = "page", defaultValue = "0") int page,
- @RequestParam(name = "size", defaultValue = "20") int size
+ @RequestParam(name = "page", defaultValue = "0") int page,
+ @RequestParam(name = "size", defaultValue = "20") int size
) {
Pageable pageable = PageRequest.of(page, size);
- PagedResponseDto activityGroups = activityGroupAdminService.getDeletedActivityGroups(pageable);
+ PagedResponseDto activityGroups = activityGroupAdminService.getDeletedActivityGroups(
+ pageable);
return ApiResponse.success(activityGroups);
}
}
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/api/ActivityGroupBoardController.java b/src/main/java/page/clab/api/domain/activity/activitygroup/api/ActivityGroupBoardController.java
index 1f2e65903..6903cc040 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/api/ActivityGroupBoardController.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/api/ActivityGroupBoardController.java
@@ -3,6 +3,7 @@
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
+import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
@@ -30,8 +31,6 @@
import page.clab.api.global.exception.SortingArgumentException;
import page.clab.api.global.util.PageableUtils;
-import java.util.List;
-
@RestController
@RequestMapping("/api/v1/activity-group/boards")
@RequiredArgsConstructor
@@ -42,35 +41,38 @@ public class ActivityGroupBoardController {
private final PageableUtils pageableUtils;
@Operation(summary = "[U] 활동 그룹 게시판 생성", description = "ROLE_USER 이상의 권한이 필요함
" +
- "활동 그룹 게시판 카테고리별 requestDto에 들어가야 할 필수내용입니다.
" +
- "공지사항, 주차별활동 : 카테고리
" +
- "과제 : 부모 게시판(주차별활동), 카테고리, 마감일자
" +
- "제출 : 부모 게시판(과제), 카테고리
" +
- "피드백 : 부모 게시판(제출), 카테고리"
+ "활동 그룹 게시판 카테고리별 requestDto에 들어가야 할 필수내용입니다.
" +
+ "공지사항, 주차별활동 : 카테고리
" +
+ "과제 : 부모 게시판(주차별활동), 카테고리, 마감일자
" +
+ "제출 : 부모 게시판(과제), 카테고리
" +
+ "피드백 : 부모 게시판(제출), 카테고리"
)
@PreAuthorize("hasRole('USER')")
@PostMapping("")
public ApiResponse createActivityGroupBoard(
- @RequestParam(name = "parentId", required = false) Long parentId,
- @RequestParam(name = "activityGroupId") Long activityGroupId,
- @Valid @RequestBody ActivityGroupBoardRequestDto requestDto
+ @RequestParam(name = "parentId", required = false) Long parentId,
+ @RequestParam(name = "activityGroupId") Long activityGroupId,
+ @Valid @RequestBody ActivityGroupBoardRequestDto requestDto
) throws PermissionDeniedException {
- ActivityGroupBoardReferenceDto referenceDto = activityGroupBoardService.createActivityGroupBoard(parentId, activityGroupId, requestDto);
+ ActivityGroupBoardReferenceDto referenceDto = activityGroupBoardService.createActivityGroupBoard(parentId,
+ activityGroupId, requestDto);
return ApiResponse.success(referenceDto);
}
@Operation(summary = "[U] 활동 그룹 게시판 조회", description = "ROLE_USER 이상의 권한이 필요함
" +
- "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
+ "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
@PreAuthorize("hasRole('USER')")
@GetMapping("/list")
public ApiResponse> getActivityGroupBoardList(
- @RequestParam(name = "page", defaultValue = "0") int page,
- @RequestParam(name = "size", defaultValue = "20") int size,
- @RequestParam(name = "sortBy", defaultValue = "createdAt") List sortBy,
- @RequestParam(name = "sortDirection", defaultValue = "desc") List sortDirection
+ @RequestParam(name = "page", defaultValue = "0") int page,
+ @RequestParam(name = "size", defaultValue = "20") int size,
+ @RequestParam(name = "sortBy", defaultValue = "createdAt") List sortBy,
+ @RequestParam(name = "sortDirection", defaultValue = "desc") List sortDirection
) throws SortingArgumentException, InvalidColumnException {
- Pageable pageable = pageableUtils.createPageable(page, size, sortBy, sortDirection, ActivityGroupBoardResponseDto.class);
- PagedResponseDto boards = activityGroupBoardService.getAllActivityGroupBoard(pageable);
+ Pageable pageable = pageableUtils.createPageable(page, size, sortBy, sortDirection,
+ ActivityGroupBoardResponseDto.class);
+ PagedResponseDto boards = activityGroupBoardService.getAllActivityGroupBoard(
+ pageable);
return ApiResponse.success(boards);
}
@@ -78,26 +80,28 @@ public ApiResponse> getActivityG
@PreAuthorize("hasRole('USER')")
@GetMapping("")
public ApiResponse getActivityGroupBoardById(
- @RequestParam(name = "activityGroupBoardId") Long activityGroupBoardId
+ @RequestParam(name = "activityGroupBoardId") Long activityGroupBoardId
) throws PermissionDeniedException {
ActivityGroupBoardResponseDto board = activityGroupBoardService.getActivityGroupBoard(activityGroupBoardId);
return ApiResponse.success(board);
}
@Operation(summary = "[U] 활동 그룹 ID에 대한 카테고리별 게시판 조회", description = "ROLE_USER 이상의 권한이 필요함
" +
- "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
+ "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
@PreAuthorize("hasRole('USER')")
@GetMapping("/by-category")
public ApiResponse> getActivityGroupBoardByCategory(
- @RequestParam(name = "activityGroupId") Long activityGroupId,
- @RequestParam(name = "category") ActivityGroupBoardCategory category,
- @RequestParam(name = "page", defaultValue = "0") int page,
- @RequestParam(name = "size", defaultValue = "20") int size,
- @RequestParam(name = "sortBy", defaultValue = "createdAt") List sortBy,
- @RequestParam(name = "sortDirection", defaultValue = "desc") List sortDirection
+ @RequestParam(name = "activityGroupId") Long activityGroupId,
+ @RequestParam(name = "category") ActivityGroupBoardCategory category,
+ @RequestParam(name = "page", defaultValue = "0") int page,
+ @RequestParam(name = "size", defaultValue = "20") int size,
+ @RequestParam(name = "sortBy", defaultValue = "createdAt") List sortBy,
+ @RequestParam(name = "sortDirection", defaultValue = "desc") List sortDirection
) throws SortingArgumentException, InvalidColumnException, PermissionDeniedException {
- Pageable pageable = pageableUtils.createPageable(page, size, sortBy, sortDirection, ActivityGroupBoardResponseDto.class);
- PagedResponseDto boards = activityGroupBoardService.getActivityGroupBoardByCategory(activityGroupId, category, pageable);
+ Pageable pageable = pageableUtils.createPageable(page, size, sortBy, sortDirection,
+ ActivityGroupBoardResponseDto.class);
+ PagedResponseDto boards = activityGroupBoardService.getActivityGroupBoardByCategory(
+ activityGroupId, category, pageable);
return ApiResponse.success(boards);
}
@@ -105,12 +109,13 @@ public ApiResponse> getActivityG
@PreAuthorize("hasRole('USER')")
@GetMapping("/by-parent")
public ApiResponse> getActivityGroupBoardByParent(
- @RequestParam(name = "parentId") Long parentId,
- @RequestParam(name = "page", defaultValue = "0") int page,
- @RequestParam(name = "size", defaultValue = "20") int size
+ @RequestParam(name = "parentId") Long parentId,
+ @RequestParam(name = "page", defaultValue = "0") int page,
+ @RequestParam(name = "size", defaultValue = "20") int size
) throws PermissionDeniedException {
Pageable pageable = PageRequest.of(page, size);
- PagedResponseDto boards = activityGroupBoardService.getActivityGroupBoardByParent(parentId, pageable);
+ PagedResponseDto boards = activityGroupBoardService.getActivityGroupBoardByParent(
+ parentId, pageable);
return ApiResponse.success(boards);
}
@@ -118,9 +123,10 @@ public ApiResponse> getActi
@PreAuthorize("hasRole('USER')")
@GetMapping("/my-assignment")
public ApiResponse> getMyAssignmentBoardWithFeedback(
- @RequestParam(name = "parentId") Long parentId
+ @RequestParam(name = "parentId") Long parentId
) {
- List boards = activityGroupBoardService.getMyAssignmentsWithFeedbacks(parentId);
+ List boards = activityGroupBoardService.getMyAssignmentsWithFeedbacks(
+ parentId);
return ApiResponse.success(boards);
}
@@ -128,10 +134,11 @@ public ApiResponse> getMyAssig
@PreAuthorize("hasRole('USER')")
@PatchMapping("")
public ApiResponse updateActivityGroupBoard(
- @RequestParam(name = "activityGroupBoardId") Long activityGroupBoardId,
- @Valid @RequestBody ActivityGroupBoardUpdateRequestDto requestDto
+ @RequestParam(name = "activityGroupBoardId") Long activityGroupBoardId,
+ @Valid @RequestBody ActivityGroupBoardUpdateRequestDto requestDto
) throws PermissionDeniedException {
- ActivityGroupBoardReferenceDto referenceDto = activityGroupBoardService.updateActivityGroupBoard(activityGroupBoardId, requestDto);
+ ActivityGroupBoardReferenceDto referenceDto = activityGroupBoardService.updateActivityGroupBoard(
+ activityGroupBoardId, requestDto);
return ApiResponse.success(referenceDto);
}
@@ -139,9 +146,10 @@ public ApiResponse updateActivityGroupBoard(
@PreAuthorize("hasRole('USER')")
@DeleteMapping("")
public ApiResponse deleteActivityGroupBoard(
- @RequestParam Long activityGroupBoardId
+ @RequestParam Long activityGroupBoardId
) throws PermissionDeniedException {
- ActivityGroupBoardReferenceDto referenceDto = activityGroupBoardService.deleteActivityGroupBoard(activityGroupBoardId);
+ ActivityGroupBoardReferenceDto referenceDto = activityGroupBoardService.deleteActivityGroupBoard(
+ activityGroupBoardId);
return ApiResponse.success(referenceDto);
}
@@ -149,11 +157,12 @@ public ApiResponse deleteActivityGroupBoard(
@PreAuthorize("hasRole('SUPER')")
@GetMapping("/deleted")
public ApiResponse> getDeletedActivityGroupBoards(
- @RequestParam(name = "page", defaultValue = "0") int page,
- @RequestParam(name = "size", defaultValue = "20") int size
+ @RequestParam(name = "page", defaultValue = "0") int page,
+ @RequestParam(name = "size", defaultValue = "20") int size
) {
Pageable pageable = PageRequest.of(page, size);
- PagedResponseDto activityBoards = activityGroupBoardService.getDeletedActivityGroupBoards(pageable);
+ PagedResponseDto activityBoards = activityGroupBoardService.getDeletedActivityGroupBoards(
+ pageable);
return ApiResponse.success(activityBoards);
}
}
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/api/ActivityGroupMemberController.java b/src/main/java/page/clab/api/domain/activity/activitygroup/api/ActivityGroupMemberController.java
index 4559f449c..75a421c30 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/api/ActivityGroupMemberController.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/api/ActivityGroupMemberController.java
@@ -3,6 +3,7 @@
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
+import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Pageable;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -28,8 +29,6 @@
import page.clab.api.global.exception.SortingArgumentException;
import page.clab.api.global.util.PageableUtils;
-import java.util.List;
-
@RestController
@RequestMapping("/api/v1/activity-group/member")
@RequiredArgsConstructor
@@ -43,90 +42,99 @@ public class ActivityGroupMemberController {
@PreAuthorize("hasRole('USER')")
@GetMapping("/{activityGroupId}")
public ApiResponse getActivityGroup(
- @PathVariable(name = "activityGroupId") Long activityGroupId
+ @PathVariable(name = "activityGroupId") Long activityGroupId
) {
ActivityGroupDetailResponseDto activityGroup = activityGroupMemberService.getActivityGroup(activityGroupId);
return ApiResponse.success(activityGroup);
}
@Operation(summary = "[G] 나의 활동 목록 조회", description = "ROLE_GUEST 이상의 권한이 필요함
" +
- "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
+ "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
@PreAuthorize("hasRole('GUEST')")
@GetMapping("/my")
public ApiResponse> getMyActivityGroups(
- @RequestParam(name = "status", required = false) ActivityGroupStatus status,
- @RequestParam(name = "page", defaultValue = "0") int page,
- @RequestParam(name = "size", defaultValue = "20") int size,
- @RequestParam(name = "sortBy", defaultValue = "createdAt") List sortBy,
- @RequestParam(name = "sortDirection", defaultValue = "desc") List sortDirection
+ @RequestParam(name = "status", required = false) ActivityGroupStatus status,
+ @RequestParam(name = "page", defaultValue = "0") int page,
+ @RequestParam(name = "size", defaultValue = "20") int size,
+ @RequestParam(name = "sortBy", defaultValue = "createdAt") List sortBy,
+ @RequestParam(name = "sortDirection", defaultValue = "desc") List sortDirection
) throws InvalidColumnException, SortingArgumentException {
- Pageable pageable = pageableUtils.createPageable(page, size, sortBy, sortDirection, ActivityGroupStatusResponseDto.class);
- PagedResponseDto activityGroups = activityGroupMemberService.getMyActivityGroups(status, pageable);
+ Pageable pageable = pageableUtils.createPageable(page, size, sortBy, sortDirection,
+ ActivityGroupStatusResponseDto.class);
+ PagedResponseDto activityGroups = activityGroupMemberService.getMyActivityGroups(
+ status, pageable);
return ApiResponse.success(activityGroups);
}
@Operation(summary = "[U] 활동 상태별 조회", description = "ROLE_USER 이상의 권한이 필요함
" +
- "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
+ "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
@PreAuthorize("hasRole('USER')")
@GetMapping("/status")
public ApiResponse> getActivityGroupsByStatus(
- @RequestParam(name = "activityGroupStatus") ActivityGroupStatus status,
- @RequestParam(name = "page", defaultValue = "0") int page,
- @RequestParam(name = "size", defaultValue = "20") int size,
- @RequestParam(name = "sortBy", defaultValue = "createdAt") List sortBy,
- @RequestParam(name = "sortDirection", defaultValue = "desc") List sortDirection
+ @RequestParam(name = "activityGroupStatus") ActivityGroupStatus status,
+ @RequestParam(name = "page", defaultValue = "0") int page,
+ @RequestParam(name = "size", defaultValue = "20") int size,
+ @RequestParam(name = "sortBy", defaultValue = "createdAt") List sortBy,
+ @RequestParam(name = "sortDirection", defaultValue = "desc") List sortDirection
) throws InvalidColumnException, SortingArgumentException {
- Pageable pageable = pageableUtils.createPageable(page, size, sortBy, sortDirection, ActivityGroupStatusResponseDto.class);
- PagedResponseDto activityGroups = activityGroupMemberService.getActivityGroupsByStatus(status, pageable);
+ Pageable pageable = pageableUtils.createPageable(page, size, sortBy, sortDirection,
+ ActivityGroupStatusResponseDto.class);
+ PagedResponseDto activityGroups = activityGroupMemberService.getActivityGroupsByStatus(
+ status, pageable);
return ApiResponse.success(activityGroups);
}
@Operation(summary = "[G] 카테고리별 활동 목록 조회", description = "ROLE_GUEST 이상의 권한이 필요함
" +
- "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
+ "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
@PreAuthorize("hasRole('GUEST')")
@GetMapping("/list")
public ApiResponse> getActivityGroupsByCategory(
- @RequestParam(name = "category") ActivityGroupCategory category,
- @RequestParam(name = "page", defaultValue = "0") int page,
- @RequestParam(name = "size", defaultValue = "20") int size,
- @RequestParam(name = "sortBy", defaultValue = "createdAt") List sortBy,
- @RequestParam(name = "sortDirection", defaultValue = "desc") List sortDirection
+ @RequestParam(name = "category") ActivityGroupCategory category,
+ @RequestParam(name = "page", defaultValue = "0") int page,
+ @RequestParam(name = "size", defaultValue = "20") int size,
+ @RequestParam(name = "sortBy", defaultValue = "createdAt") List sortBy,
+ @RequestParam(name = "sortDirection", defaultValue = "desc") List sortDirection
) throws SortingArgumentException, InvalidColumnException {
- Pageable pageable = pageableUtils.createPageable(page, size, sortBy, sortDirection, ActivityGroupResponseDto.class);
- PagedResponseDto activityGroups = activityGroupMemberService.getActivityGroupsByCategory(category, pageable);
+ Pageable pageable = pageableUtils.createPageable(page, size, sortBy, sortDirection,
+ ActivityGroupResponseDto.class);
+ PagedResponseDto activityGroups = activityGroupMemberService.getActivityGroupsByCategory(
+ category, pageable);
return ApiResponse.success(activityGroups);
}
@Operation(summary = "[G] 활동 일정 조회", description = "ROLE_GUEST 이상의 권한이 필요함
" +
- "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
+ "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
@PreAuthorize("hasRole('GUEST')")
@GetMapping("/schedule")
public ApiResponse> getGroupScheduleList(
- @RequestParam(name = "activityGroupId") Long activityGroupId,
- @RequestParam(name = "page", defaultValue = "0") int page,
- @RequestParam(name = "size", defaultValue = "20") int size,
- @RequestParam(name = "sortBy", defaultValue = "schedule") List sortBy,
- @RequestParam(name = "sortDirection", defaultValue = "desc") List sortDirection
+ @RequestParam(name = "activityGroupId") Long activityGroupId,
+ @RequestParam(name = "page", defaultValue = "0") int page,
+ @RequestParam(name = "size", defaultValue = "20") int size,
+ @RequestParam(name = "sortBy", defaultValue = "schedule") List sortBy,
+ @RequestParam(name = "sortDirection", defaultValue = "desc") List sortDirection
) throws SortingArgumentException, InvalidColumnException {
Pageable pageable = pageableUtils.createPageable(page, size, sortBy, sortDirection, GroupScheduleDto.class);
- PagedResponseDto groupSchedules = activityGroupMemberService.getGroupSchedules(activityGroupId, pageable);
+ PagedResponseDto groupSchedules = activityGroupMemberService.getGroupSchedules(
+ activityGroupId, pageable);
return ApiResponse.success(groupSchedules);
}
@Operation(summary = "[U] 활동 멤버 조회", description = "ROLE_USER 이상의 권한이 필요함
" +
- "활동에 참여(수락)된 멤버만 조회 가능
" +
- "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
+ "활동에 참여(수락)된 멤버만 조회 가능
" +
+ "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
@PreAuthorize("hasRole('USER')")
@GetMapping("/members")
public ApiResponse> getActivityGroupMemberList(
- @RequestParam(name = "activityGroupId") Long activityGroupId,
- @RequestParam(name = "page", defaultValue = "0") int page,
- @RequestParam(name = "size", defaultValue = "20") int size,
- @RequestParam(name = "sortBy", defaultValue = "memberId") List sortBy,
- @RequestParam(name = "sortDirection", defaultValue = "asc") List sortDirection
+ @RequestParam(name = "activityGroupId") Long activityGroupId,
+ @RequestParam(name = "page", defaultValue = "0") int page,
+ @RequestParam(name = "size", defaultValue = "20") int size,
+ @RequestParam(name = "sortBy", defaultValue = "memberId") List sortBy,
+ @RequestParam(name = "sortDirection", defaultValue = "asc") List sortDirection
) throws SortingArgumentException, InvalidColumnException {
- Pageable pageable = pageableUtils.createPageable(page, size, sortBy, sortDirection, GroupMemberResponseDto.class);
- PagedResponseDto activityGroupMembers = activityGroupMemberService.getActivityGroupMembers(activityGroupId, pageable);
+ Pageable pageable = pageableUtils.createPageable(page, size, sortBy, sortDirection,
+ GroupMemberResponseDto.class);
+ PagedResponseDto activityGroupMembers = activityGroupMemberService.getActivityGroupMembers(
+ activityGroupId, pageable);
return ApiResponse.success(activityGroupMembers);
}
@@ -134,25 +142,27 @@ public ApiResponse> getActivityGroupMem
@PreAuthorize("hasRole('USER')")
@PostMapping("/apply")
public ApiResponse applyActivityGroup(
- @RequestParam Long activityGroupId,
- @Valid @RequestBody ApplyFormRequestDto requestDto
+ @RequestParam Long activityGroupId,
+ @Valid @RequestBody ApplyFormRequestDto requestDto
) {
Long id = activityGroupMemberService.applyActivityGroup(activityGroupId, requestDto);
return ApiResponse.success(id);
}
-
+
@Operation(summary = "[U] 내가 지원한 활동 목록 조회", description = "ROLE_USER 이상의 권한이 필요함
" +
- "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
+ "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
@PreAuthorize("hasRole('USER')")
@GetMapping("/applied")
public ApiResponse> getAppliedActivityGroups(
- @RequestParam(name = "page", defaultValue = "0") int page,
- @RequestParam(name = "size", defaultValue = "20") int size,
- @RequestParam(name = "sortBy", defaultValue = "createdAt") List sortBy,
- @RequestParam(name = "sortDirection", defaultValue = "desc") List sortDirection
+ @RequestParam(name = "page", defaultValue = "0") int page,
+ @RequestParam(name = "size", defaultValue = "20") int size,
+ @RequestParam(name = "sortBy", defaultValue = "createdAt") List sortBy,
+ @RequestParam(name = "sortDirection", defaultValue = "desc") List sortDirection
) throws InvalidColumnException, SortingArgumentException {
- Pageable pageable = pageableUtils.createPageable(page, size, sortBy, sortDirection, ActivityGroupStatusResponseDto.class);
- PagedResponseDto activityGroups = activityGroupMemberService.getAppliedActivityGroups(pageable);
+ Pageable pageable = pageableUtils.createPageable(page, size, sortBy, sortDirection,
+ ActivityGroupStatusResponseDto.class);
+ PagedResponseDto activityGroups = activityGroupMemberService.getAppliedActivityGroups(
+ pageable);
return ApiResponse.success(activityGroups);
}
}
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/api/ActivityGroupReportController.java b/src/main/java/page/clab/api/domain/activity/activitygroup/api/ActivityGroupReportController.java
index 5c6978699..bb4ad1b75 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/api/ActivityGroupReportController.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/api/ActivityGroupReportController.java
@@ -3,6 +3,7 @@
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
+import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
@@ -27,8 +28,6 @@
import page.clab.api.global.exception.SortingArgumentException;
import page.clab.api.global.util.PageableUtils;
-import java.util.List;
-
@RestController
@RequestMapping("/api/v1/activity-group/report")
@RequiredArgsConstructor
@@ -42,25 +41,27 @@ public class ActivityGroupReportController {
@PreAuthorize("hasRole('USER')")
@PostMapping("")
public ApiResponse writeReport(
- @Valid @RequestBody ActivityGroupReportRequestDto requestDto
+ @Valid @RequestBody ActivityGroupReportRequestDto requestDto
) throws PermissionDeniedException, IllegalAccessException {
Long id = activityGroupReportService.writeReport(requestDto);
return ApiResponse.success(id);
}
@Operation(summary = "[U] 특정 그룹의 활동 보고서 전체 조회", description = "ROLE_USER 이상의 권한이 필요함
" +
- "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
+ "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
@PreAuthorize("hasRole('USER')")
@GetMapping("")
public ApiResponse> getReports(
- @RequestParam(name = "activityGroupId") Long activityGroupId,
- @RequestParam(name = "page", defaultValue = "0") int page,
- @RequestParam(name = "size", defaultValue = "20") int size,
- @RequestParam(name = "sortBy", defaultValue = "createdAt") List sortBy,
- @RequestParam(name = "sortDirection", defaultValue = "desc") List sortDirection
+ @RequestParam(name = "activityGroupId") Long activityGroupId,
+ @RequestParam(name = "page", defaultValue = "0") int page,
+ @RequestParam(name = "size", defaultValue = "20") int size,
+ @RequestParam(name = "sortBy", defaultValue = "createdAt") List sortBy,
+ @RequestParam(name = "sortDirection", defaultValue = "desc") List sortDirection
) throws SortingArgumentException, InvalidColumnException {
- Pageable pageable = pageableUtils.createPageable(page, size, sortBy, sortDirection, ActivityGroupReportResponseDto.class);
- PagedResponseDto reports = activityGroupReportService.getReports(activityGroupId, pageable);
+ Pageable pageable = pageableUtils.createPageable(page, size, sortBy, sortDirection,
+ ActivityGroupReportResponseDto.class);
+ PagedResponseDto reports = activityGroupReportService.getReports(
+ activityGroupId, pageable);
return ApiResponse.success(reports);
}
@@ -68,8 +69,8 @@ public ApiResponse> getReports(
@PreAuthorize("hasRole('USER')")
@GetMapping("/search")
public ApiResponse searchReport(
- @RequestParam(name = "activityGroupId") Long activityGroupId,
- @RequestParam(name = "turn") Long turn
+ @RequestParam(name = "activityGroupId") Long activityGroupId,
+ @RequestParam(name = "turn") Long turn
) {
ActivityGroupReportResponseDto report = activityGroupReportService.searchReport(activityGroupId, turn);
return ApiResponse.success(report);
@@ -79,9 +80,9 @@ public ApiResponse searchReport(
@PreAuthorize("hasRole('USER')")
@PatchMapping("/{reportId}")
public ApiResponse updateReport(
- @PathVariable(name = "reportId") Long reportId,
- @RequestParam(name = "activityGroupId") Long activityGroupId,
- @Valid @RequestBody ActivityGroupReportUpdateRequestDto requestDto
+ @PathVariable(name = "reportId") Long reportId,
+ @RequestParam(name = "activityGroupId") Long activityGroupId,
+ @Valid @RequestBody ActivityGroupReportUpdateRequestDto requestDto
) throws PermissionDeniedException, IllegalAccessException {
Long id = activityGroupReportService.updateReport(reportId, activityGroupId, requestDto);
return ApiResponse.success(id);
@@ -91,7 +92,7 @@ public ApiResponse updateReport(
@PreAuthorize("hasRole('USER')")
@DeleteMapping("/{reportId}")
public ApiResponse deleteAward(
- @PathVariable(name = "reportId") Long reportId
+ @PathVariable(name = "reportId") Long reportId
) throws PermissionDeniedException {
Long id = activityGroupReportService.deleteReport(reportId);
return ApiResponse.success(id);
@@ -102,11 +103,12 @@ public ApiResponse deleteAward(
@PreAuthorize("hasRole('SUPER')")
@GetMapping("/deleted")
public ApiResponse> getDeletedActivityGroupReports(
- @RequestParam(name = "page", defaultValue = "0") int page,
- @RequestParam(name = "size", defaultValue = "20") int size
+ @RequestParam(name = "page", defaultValue = "0") int page,
+ @RequestParam(name = "size", defaultValue = "20") int size
) {
Pageable pageable = PageRequest.of(page, size);
- PagedResponseDto activityGroupReports = activityGroupReportService.getDeletedActivityGroupReports(pageable);
+ PagedResponseDto activityGroupReports = activityGroupReportService.getDeletedActivityGroupReports(
+ pageable);
return ApiResponse.success(activityGroupReports);
}
}
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/api/AttendanceController.java b/src/main/java/page/clab/api/domain/activity/activitygroup/api/AttendanceController.java
index 3cf425f68..5391c7487 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/api/AttendanceController.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/api/AttendanceController.java
@@ -3,6 +3,8 @@
import com.google.zxing.WriterException;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
+import java.io.IOException;
+import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Pageable;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -26,9 +28,6 @@
import page.clab.api.global.exception.SortingArgumentException;
import page.clab.api.global.util.PageableUtils;
-import java.io.IOException;
-import java.util.List;
-
@RestController
@RequestMapping("/api/v1/attendance")
@RequiredArgsConstructor
@@ -42,7 +41,7 @@ public class AttendanceController {
@PreAuthorize("hasRole('USER')")
@PostMapping(value = "")
public ApiResponse generateAttendanceQRCode(
- @RequestParam(name = "activityGroupId") Long activityGroupId
+ @RequestParam(name = "activityGroupId") Long activityGroupId
) throws IOException, WriterException, PermissionDeniedException, IllegalAccessException {
String QRCodeURL = attendanceService.generateAttendanceQRCode(activityGroupId);
return ApiResponse.success(QRCodeURL);
@@ -52,67 +51,72 @@ public ApiResponse generateAttendanceQRCode(
@PreAuthorize("hasRole('USER')")
@PostMapping("/check-in")
public ApiResponse checkInAttendance(
- @RequestBody AttendanceRequestDto requestDto
+ @RequestBody AttendanceRequestDto requestDto
) throws IllegalAccessException {
Long id = attendanceService.checkMemberAttendance(requestDto);
return ApiResponse.success(id);
}
@Operation(summary = "[G] 내 출석기록 조회", description = "ROLE_GUEST 이상의 권한이 필요함
" +
- "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
+ "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
@PreAuthorize("hasRole('GUEST')")
- @GetMapping({ "/my-attendance" })
+ @GetMapping({"/my-attendance"})
public ApiResponse> searchMyAttendance(
- @RequestParam(name = "activityGroupId", defaultValue = "1") Long activityGroupId,
- @RequestParam(name = "page", defaultValue = "0") int page,
- @RequestParam(name = "size", defaultValue = "20") int size,
- @RequestParam(name = "sortBy", defaultValue = "attendanceDateTime") List sortBy,
- @RequestParam(name = "sortDirection", defaultValue = "desc") List sortDirection
+ @RequestParam(name = "activityGroupId", defaultValue = "1") Long activityGroupId,
+ @RequestParam(name = "page", defaultValue = "0") int page,
+ @RequestParam(name = "size", defaultValue = "20") int size,
+ @RequestParam(name = "sortBy", defaultValue = "attendanceDateTime") List sortBy,
+ @RequestParam(name = "sortDirection", defaultValue = "desc") List sortDirection
) throws SortingArgumentException, IllegalAccessException, InvalidColumnException {
- Pageable pageable = pageableUtils.createPageable(page, size, sortBy, sortDirection, AttendanceResponseDto.class);
- PagedResponseDto myAttendances = attendanceService.getMyAttendances(activityGroupId, pageable);
+ Pageable pageable = pageableUtils.createPageable(page, size, sortBy, sortDirection,
+ AttendanceResponseDto.class);
+ PagedResponseDto myAttendances = attendanceService.getMyAttendances(activityGroupId,
+ pageable);
return ApiResponse.success(myAttendances);
}
@Operation(summary = "[U] 특정 그룹의 출석기록 조회", description = "ROLE_USER 이상의 권한이 필요함
" +
- "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
+ "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
@PreAuthorize("hasRole('USER')")
- @GetMapping({ "/group-attendance" })
+ @GetMapping({"/group-attendance"})
public ApiResponse> searchGroupAttendance(
- @RequestParam(name = "activityGroupId", defaultValue = "1") Long activityGroupId,
- @RequestParam(name = "page", defaultValue = "0") int page,
- @RequestParam(name = "size", defaultValue = "20") int size,
- @RequestParam(name = "sortBy", defaultValue = "memberId") List sortBy,
- @RequestParam(name = "sortDirection", defaultValue = "asc") List sortDirection
+ @RequestParam(name = "activityGroupId", defaultValue = "1") Long activityGroupId,
+ @RequestParam(name = "page", defaultValue = "0") int page,
+ @RequestParam(name = "size", defaultValue = "20") int size,
+ @RequestParam(name = "sortBy", defaultValue = "memberId") List sortBy,
+ @RequestParam(name = "sortDirection", defaultValue = "asc") List sortDirection
) throws SortingArgumentException, PermissionDeniedException, InvalidColumnException {
- Pageable pageable = pageableUtils.createPageable(page, size, sortBy, sortDirection, AttendanceResponseDto.class);
- PagedResponseDto attendances = attendanceService.getGroupAttendances(activityGroupId, pageable);
+ Pageable pageable = pageableUtils.createPageable(page, size, sortBy, sortDirection,
+ AttendanceResponseDto.class);
+ PagedResponseDto attendances = attendanceService.getGroupAttendances(activityGroupId,
+ pageable);
return ApiResponse.success(attendances);
}
@Operation(summary = "[U] 불참 사유서 등록", description = "ROLE_USER 이상의 권한이 필요함")
@PreAuthorize("hasRole('USER')")
- @PostMapping({ "/absent" })
+ @PostMapping({"/absent"})
public ApiResponse writeAbsentExcuse(
- @RequestBody AbsentRequestDto requestDto
+ @RequestBody AbsentRequestDto requestDto
) throws IllegalAccessException, DuplicateAbsentExcuseException {
Long id = attendanceService.writeAbsentExcuse(requestDto);
return ApiResponse.success(id);
}
@Operation(summary = "[U] 그룹의 불참 사유서 열람", description = "ROLE_USER 이상의 권한이 필요함
" +
- "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
+ "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
@PreAuthorize("hasRole('USER')")
- @GetMapping({ "/absent/{activityGroupId}" })
+ @GetMapping({"/absent/{activityGroupId}"})
public ApiResponse> getActivityGroupAbsentExcuses(
- @PathVariable(name = "activityGroupId") Long activityGroupId,
- @RequestParam(name = "page", defaultValue = "0") int page,
- @RequestParam(name = "size", defaultValue = "20") int size,
- @RequestParam(name = "sortBy", defaultValue = "absentDate") List sortBy,
- @RequestParam(name = "sortDirection", defaultValue = "desc") List sortDirection
+ @PathVariable(name = "activityGroupId") Long activityGroupId,
+ @RequestParam(name = "page", defaultValue = "0") int page,
+ @RequestParam(name = "size", defaultValue = "20") int size,
+ @RequestParam(name = "sortBy", defaultValue = "absentDate") List sortBy,
+ @RequestParam(name = "sortDirection", defaultValue = "desc") List sortDirection
) throws SortingArgumentException, PermissionDeniedException, InvalidColumnException {
Pageable pageable = pageableUtils.createPageable(page, size, sortBy, sortDirection, AbsentResponseDto.class);
- PagedResponseDto absentExcuses = attendanceService.getActivityGroupAbsentExcuses(activityGroupId, pageable);
+ PagedResponseDto absentExcuses = attendanceService.getActivityGroupAbsentExcuses(
+ activityGroupId, pageable);
return ApiResponse.success(absentExcuses);
}
}
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/application/ActivityGroupAdminService.java b/src/main/java/page/clab/api/domain/activity/activitygroup/application/ActivityGroupAdminService.java
index c55a0f1e4..e64d69b97 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/application/ActivityGroupAdminService.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/application/ActivityGroupAdminService.java
@@ -1,5 +1,9 @@
package page.clab.api.domain.activity.activitygroup.application;
+import java.time.LocalDate;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
@@ -36,11 +40,6 @@
import page.clab.api.global.exception.NotFoundException;
import page.clab.api.global.exception.PermissionDeniedException;
-import java.time.LocalDate;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
@Service
@RequiredArgsConstructor
public class ActivityGroupAdminService {
@@ -60,15 +59,18 @@ public Long createActivityGroup(ActivityGroupRequestDto requestDto) {
activityGroup.validateAndSetGithubUrl(activityGroup.getGithubUrl());
activityGroupRepository.save(activityGroup);
- GroupMember groupLeader = GroupMember.create(currentMember.getId(), activityGroup, ActivityGroupRole.LEADER, GroupMemberStatus.ACCEPTED);
+ GroupMember groupLeader = GroupMember.create(currentMember.getId(), activityGroup, ActivityGroupRole.LEADER,
+ GroupMemberStatus.ACCEPTED);
activityGroupMemberService.save(groupLeader);
- externalSendNotificationUseCase.sendNotificationToMember(currentMember.getId(), "활동 그룹 생성이 완료되었습니다. 활동 승인이 완료되면 활동 그룹을 이용할 수 있습니다.");
+ externalSendNotificationUseCase.sendNotificationToMember(currentMember.getId(),
+ "활동 그룹 생성이 완료되었습니다. 활동 승인이 완료되면 활동 그룹을 이용할 수 있습니다.");
return activityGroup.getId();
}
@Transactional
- public Long updateActivityGroup(Long activityGroupId, ActivityGroupUpdateRequestDto requestDto) throws PermissionDeniedException {
+ public Long updateActivityGroup(Long activityGroupId, ActivityGroupUpdateRequestDto requestDto)
+ throws PermissionDeniedException {
Member currentMember = externalRetrieveMemberUseCase.getCurrentMember();
ActivityGroup activityGroup = getActivityGroupById(activityGroupId);
validateLeaderOrAdminPermission(activityGroup, currentMember, "해당 활동을 수정할 권한이 없습니다.");
@@ -78,14 +80,18 @@ public Long updateActivityGroup(Long activityGroupId, ActivityGroupUpdateRequest
// 활동 그룹의 status를 수정합니다.
@Transactional
- public ActivityGroupBoardStatusUpdatedResponseDto manageActivityGroup(Long activityGroupId, ActivityGroupStatus status) {
+ public ActivityGroupBoardStatusUpdatedResponseDto manageActivityGroup(Long activityGroupId,
+ ActivityGroupStatus status) {
ActivityGroup activityGroup = getActivityGroupById(activityGroupId);
activityGroup.updateStatus(status);
activityGroupRepository.save(activityGroup);
- List groupLeaders = activityGroupMemberService.getGroupMemberByActivityGroupIdAndRole(activityGroupId, ActivityGroupRole.LEADER);
+ List groupLeaders = activityGroupMemberService.getGroupMemberByActivityGroupIdAndRole(
+ activityGroupId, ActivityGroupRole.LEADER);
if (!CollectionUtils.isEmpty(groupLeaders)) {
- groupLeaders.forEach(leader -> externalSendNotificationUseCase.sendNotificationToMember(leader.getMemberId(), "활동 그룹이 [" + status.getDescription() + "] 상태로 변경되었습니다."));
+ groupLeaders.forEach(
+ leader -> externalSendNotificationUseCase.sendNotificationToMember(leader.getMemberId(),
+ "활동 그룹이 [" + status.getDescription() + "] 상태로 변경되었습니다."));
}
return mapper.of(activityGroupId, status);
}
@@ -100,8 +106,10 @@ public PagedResponseDto getDeletedActivityGroups(Pagea
public Long deleteActivityGroup(Long activityGroupId) throws PermissionDeniedException {
ActivityGroup activityGroup = getActivityGroupById(activityGroupId);
List groupMembers = activityGroupMemberService.getGroupMemberByActivityGroupId(activityGroupId);
- List groupSchedules = groupScheduleRepository.findAllByActivityGroupIdOrderByIdDesc(activityGroupId);
- List groupLeaders = activityGroupMemberService.getGroupMemberByActivityGroupIdAndRole(activityGroupId, ActivityGroupRole.LEADER);
+ List groupSchedules = groupScheduleRepository.findAllByActivityGroupIdOrderByIdDesc(
+ activityGroupId);
+ List groupLeaders = activityGroupMemberService.getGroupMemberByActivityGroupIdAndRole(
+ activityGroupId, ActivityGroupRole.LEADER);
Member currentMember = externalRetrieveMemberUseCase.getCurrentMember();
validateLeaderOrAdminPermission(activityGroup, currentMember, "해당 활동을 삭제할 권한이 없습니다.");
@@ -111,7 +119,9 @@ public Long deleteActivityGroup(Long activityGroupId) throws PermissionDeniedExc
activityGroupRepository.delete(activityGroup);
if (!CollectionUtils.isEmpty(groupLeaders)) {
- groupLeaders.forEach(leader -> externalSendNotificationUseCase.sendNotificationToMember(leader.getMemberId(), "활동 그룹 [" + activityGroup.getName() + "]이 삭제되었습니다."));
+ groupLeaders.forEach(
+ leader -> externalSendNotificationUseCase.sendNotificationToMember(leader.getMemberId(),
+ "활동 그룹 [" + activityGroup.getName() + "]이 삭제되었습니다."));
}
return activityGroup.getId();
}
@@ -126,46 +136,53 @@ public Long updateProjectProgress(Long activityGroupId, Long progress) throws Pe
}
@Transactional
- public Long addSchedule(Long activityGroupId, List scheduleDtos) throws PermissionDeniedException {
+ public Long addSchedule(Long activityGroupId, List scheduleDtos)
+ throws PermissionDeniedException {
Member currentMember = externalRetrieveMemberUseCase.getCurrentMember();
ActivityGroup activityGroup = getActivityGroupById(activityGroupId);
validateLeaderOrAdminPermission(activityGroup, currentMember, "해당 일정을 등록할 권한이 없습니다.");
List groupSchedules = scheduleDtos.stream()
- .map(scheduleDto -> mapper.fromDto(scheduleDto, activityGroup))
- .toList();
+ .map(scheduleDto -> mapper.fromDto(scheduleDto, activityGroup))
+ .toList();
groupScheduleRepository.saveAll(groupSchedules);
return activityGroup.getId();
}
@Transactional(readOnly = true)
- public PagedResponseDto getGroupMembersWithApplyReason(Long activityGroupId, Pageable pageable) throws PermissionDeniedException {
+ public PagedResponseDto getGroupMembersWithApplyReason(
+ Long activityGroupId, Pageable pageable) throws PermissionDeniedException {
Member currentMember = externalRetrieveMemberUseCase.getCurrentMember();
ActivityGroup activityGroup = getActivityGroupById(activityGroupId);
validateLeaderOrAdminPermission(activityGroup, currentMember, "해당 활동의 멤버를 조회할 권한이 없습니다.");
List applyForms = applyFormRepository.findAllByActivityGroup(activityGroup);
Map memberIdToApplyReasonMap = applyForms.stream()
- .collect(Collectors.toMap(
- ApplyForm::getMemberId,
- ApplyForm::getApplyReason
- ));
-
- Page groupMembers = activityGroupMemberService.getGroupMemberByActivityGroupId(activityGroupId, pageable);
- List groupMembersWithApplyReason = groupMembers.getContent().stream()
- .map(groupMember -> {
- String applyReason = memberIdToApplyReasonMap.getOrDefault(groupMember.getMemberId(), "");
- Member member = externalRetrieveMemberUseCase.getById(groupMember.getMemberId());
- return mapper.toDto(member, groupMember, applyReason);
- })
- .toList();
-
- Page paginatedGroupMembersWithApplyReason = new PageImpl<>(groupMembersWithApplyReason, pageable, groupMembers.getTotalElements());
- return new PagedResponseDto<>(paginatedGroupMembersWithApplyReason, groupMembers.getTotalElements(), groupMembersWithApplyReason.size());
+ .collect(Collectors.toMap(
+ ApplyForm::getMemberId,
+ ApplyForm::getApplyReason
+ ));
+
+ Page groupMembers = activityGroupMemberService.getGroupMemberByActivityGroupId(activityGroupId,
+ pageable);
+ List groupMembersWithApplyReason = groupMembers.getContent()
+ .stream()
+ .map(groupMember -> {
+ String applyReason = memberIdToApplyReasonMap.getOrDefault(groupMember.getMemberId(), "");
+ Member member = externalRetrieveMemberUseCase.getById(groupMember.getMemberId());
+ return mapper.toDto(member, groupMember, applyReason);
+ })
+ .toList();
+
+ Page paginatedGroupMembersWithApplyReason = new PageImpl<>(
+ groupMembersWithApplyReason, pageable, groupMembers.getTotalElements());
+ return new PagedResponseDto<>(paginatedGroupMembersWithApplyReason, groupMembers.getTotalElements(),
+ groupMembersWithApplyReason.size());
}
// 활동 멤버들의 status를 수정합니다.
@Transactional
- public Long manageGroupMemberStatus(Long activityGroupId, List memberIds, GroupMemberStatus status) throws PermissionDeniedException {
+ public Long manageGroupMemberStatus(Long activityGroupId, List memberIds, GroupMemberStatus status)
+ throws PermissionDeniedException {
Member currentMember = externalRetrieveMemberUseCase.getCurrentMember();
ActivityGroup activityGroup = getActivityGroupById(activityGroupId);
validateLeaderOrAdminPermission(activityGroup, currentMember, "해당 활동의 신청 멤버를 조회할 권한이 없습니다.");
@@ -174,9 +191,11 @@ public Long manageGroupMemberStatus(Long activityGroupId, List memberIds
}
@Transactional
- public Long changeGroupMemberPosition(Long activityGroupId, String memberId, ActivityGroupRole position) throws PermissionDeniedException {
+ public Long changeGroupMemberPosition(Long activityGroupId, String memberId, ActivityGroupRole position)
+ throws PermissionDeniedException {
ActivityGroup activityGroup = getActivityGroupById(activityGroupId);
- GroupMember groupMember = activityGroupMemberService.getGroupMemberByActivityGroupAndMember(activityGroup, memberId);
+ GroupMember groupMember = activityGroupMemberService.getGroupMemberByActivityGroupAndMember(activityGroup,
+ memberId);
Member currentMember = externalRetrieveMemberUseCase.getCurrentMember();
validateLeaderOrAdminPermission(activityGroup, currentMember, "해당 활동의 멤버 직책을 변경할 권한이 없습니다.");
@@ -192,8 +211,9 @@ public Long changeGroupMemberPosition(Long activityGroupId, String memberId, Act
@Scheduled(cron = "0 0 0 * * *")
public void updateActivityGroupStatusEnd() {
- List activityGroups = activityGroupRepository.findByEndDateBeforeAndStatusNot(LocalDate.now(), ActivityGroupStatus.END);
- if(!activityGroups.isEmpty()){
+ List activityGroups = activityGroupRepository.findByEndDateBeforeAndStatusNot(LocalDate.now(),
+ ActivityGroupStatus.END);
+ if (!activityGroups.isEmpty()) {
activityGroups.forEach(this::updateActivityGroupStatusEnd);
}
}
@@ -205,24 +225,26 @@ private void updateActivityGroupStatusEnd(ActivityGroup activityGroup) {
private void updateGroupMemberStatus(String memberId, GroupMemberStatus status, ActivityGroup activityGroup) {
Member member = externalRetrieveMemberUseCase.getById(memberId);
- GroupMember groupMember = activityGroupMemberService.getGroupMemberByActivityGroupAndMember(activityGroup, member.getId());
+ GroupMember groupMember = activityGroupMemberService.getGroupMemberByActivityGroupAndMember(activityGroup,
+ member.getId());
groupMember.validateAccessPermission();
groupMember.updateStatus(status);
activityGroupMemberService.save(groupMember);
- externalSendNotificationUseCase.sendNotificationToMember(member.getId(), "[" + activityGroup.getName() + "]" + " 신청이 [" + status.getDescription() + "] 상태로 변경되었습니다.");
+ externalSendNotificationUseCase.sendNotificationToMember(member.getId(),
+ "[" + activityGroup.getName() + "]" + " 신청이 [" + status.getDescription() + "] 상태로 변경되었습니다.");
}
public ActivityGroup getActivityGroupById(Long activityGroupId) {
return activityGroupRepository.findById(activityGroupId)
- .orElseThrow(() -> new NotFoundException("존재하지 않는 활동입니다."));
+ .orElseThrow(() -> new NotFoundException("존재하지 않는 활동입니다."));
}
// 해당 멤버가 특정 활동 그룹의 리더 또는 관리자인지 검증합니다.
// 예외가 발생하지 않고 안전하게 처리됩니다.
public boolean hasLeaderOrAdminRole(ActivityGroup activityGroup, Member member) {
return activityGroupMemberService.findGroupMemberByActivityGroupAndMember(activityGroup, member.getId())
- .map(GroupMember::isLeader)
- .orElseGet(member::isAdminRole);
+ .map(GroupMember::isLeader)
+ .orElseGet(member::isAdminRole);
}
// 해당 멤버가 특정 활동 그룹의 리더 또는 관리자인지 검증합니다.
@@ -230,8 +252,9 @@ public boolean hasLeaderOrAdminRole(ActivityGroup activityGroup, Member member)
public boolean isMemberGroupLeaderRole(Long activityGroupId, String memberId) {
ActivityGroup activityGroup = getActivityGroupById(activityGroupId);
Member member = externalRetrieveMemberUseCase.getById(memberId);
- try{
- GroupMember groupMember = activityGroupMemberService.getGroupMemberByActivityGroupAndMember(activityGroup, member.getId());
+ try {
+ GroupMember groupMember = activityGroupMemberService.getGroupMemberByActivityGroupAndMember(activityGroup,
+ member.getId());
return groupMember.isLeader() || member.isAdminRole();
} catch (NotFoundException e) {
return false;
@@ -242,17 +265,19 @@ public boolean isMemberHasRoleInActivityGroup(Member member, ActivityGroupRole r
List groupMemberList = activityGroupMemberService.getGroupMemberByMemberId(member.getId());
ActivityGroup activityGroup = activityGroupMemberService.getActivityGroupById(activityGroupId);
return groupMemberList.stream()
- .anyMatch(groupMember -> groupMember.isSameRoleAndActivityGroup(role, activityGroup));
+ .anyMatch(groupMember -> groupMember.isSameRoleAndActivityGroup(role, activityGroup));
}
private void validateLeaderRoleChange(ActivityGroup activityGroup, GroupMember groupMember) {
- List groupMembers = activityGroupMemberService.getGroupMemberByActivityGroupIdAndRole(activityGroup.getId(), ActivityGroupRole.LEADER);
- if(groupMembers.size() == 1 && groupMember.isLeader()) {
+ List groupMembers = activityGroupMemberService.getGroupMemberByActivityGroupIdAndRole(
+ activityGroup.getId(), ActivityGroupRole.LEADER);
+ if (groupMembers.size() == 1 && groupMember.isLeader()) {
throw new SingleLeaderModificationException("그룹에는 최소 한 명의 리더가 있어야 하므로, 리더의 역할을 변경할 수 없습니다.");
}
}
- public ActivityGroup validateAndGetActivityGroupForReporting(Long activityGroupId, Member member) throws PermissionDeniedException, IllegalAccessException {
+ public ActivityGroup validateAndGetActivityGroupForReporting(Long activityGroupId, Member member)
+ throws PermissionDeniedException, IllegalAccessException {
ActivityGroup activityGroup = getActivityGroupById(activityGroupId);
if (!isMemberHasRoleInActivityGroup(member, ActivityGroupRole.LEADER, activityGroupId)) {
throw new PermissionDeniedException("해당 그룹의 리더만 보고서를 작성할 수 있습니다.");
@@ -263,7 +288,8 @@ public ActivityGroup validateAndGetActivityGroupForReporting(Long activityGroupI
return activityGroup;
}
- private void validateLeaderOrAdminPermission(ActivityGroup activityGroup, Member member, String message) throws PermissionDeniedException {
+ private void validateLeaderOrAdminPermission(ActivityGroup activityGroup, Member member, String message)
+ throws PermissionDeniedException {
if (!hasLeaderOrAdminRole(activityGroup, member)) {
throw new PermissionDeniedException(message);
}
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/application/ActivityGroupBoardService.java b/src/main/java/page/clab/api/domain/activity/activitygroup/application/ActivityGroupBoardService.java
index cb858d0fb..c990e955c 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/application/ActivityGroupBoardService.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/application/ActivityGroupBoardService.java
@@ -1,5 +1,7 @@
package page.clab.api.domain.activity.activitygroup.application;
+import java.util.Comparator;
+import java.util.List;
import java.util.stream.Collectors;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
@@ -36,9 +38,6 @@
import page.clab.api.global.exception.NotFoundException;
import page.clab.api.global.exception.PermissionDeniedException;
-import java.util.Comparator;
-import java.util.List;
-
@Service
@RequiredArgsConstructor
public class ActivityGroupBoardService {
@@ -55,21 +54,19 @@ public class ActivityGroupBoardService {
* 새로운 활동 그룹 게시판을 생성합니다.
*
* 새 게시판을 생성하기 전 다음 검증이 수행됩니다:
- * - 현재 사용자가 해당 활동 그룹의 멤버인지 확인
- * - 공지, 주차별 활동, 과제, 피드백 카테고리는 관리자 또는 리더 권한 필요
- * - 부모 게시판의 유효성 확인
- * - 이번 주에 이미 과제를 제출했는지 확인
+ * - 현재 사용자가 해당 활동 그룹의 멤버인지 확인 - 공지, 주차별 활동, 과제, 피드백 카테고리는 관리자 또는 리더 권한 필요 - 부모 게시판의 유효성 확인 - 이번 주에 이미 과제를 제출했는지 확인
*
* 부모 게시판이 있을 경우 자식 게시판으로 추가하며, 게시판 생성 후 알림을 전송합니다.
*
- * @param parentId 부모 게시판의 ID (없을 수 있음)
+ * @param parentId 부모 게시판의 ID (없을 수 있음)
* @param activityGroupId 활동 그룹의 ID
- * @param requestDto 게시판 생성 요청 DTO
+ * @param requestDto 게시판 생성 요청 DTO
* @return ActivityGroupBoardReferenceDto
* @throws PermissionDeniedException 권한이 없는 경우 예외 발생
*/
@Transactional
- public ActivityGroupBoardReferenceDto createActivityGroupBoard(Long parentId, Long activityGroupId, ActivityGroupBoardRequestDto requestDto) throws PermissionDeniedException {
+ public ActivityGroupBoardReferenceDto createActivityGroupBoard(Long parentId, Long activityGroupId,
+ ActivityGroupBoardRequestDto requestDto) throws PermissionDeniedException {
Member currentMember = externalRetrieveMemberUseCase.getCurrentMember();
ActivityGroup activityGroup = activityGroupAdminService.getActivityGroupById(activityGroupId);
@@ -94,21 +91,24 @@ public ActivityGroupBoardReferenceDto createActivityGroupBoard(Long parentId, Lo
return mapper.of(board.getId(), activityGroupId, parentId);
}
- private void validateGroupMember(ActivityGroup activityGroup, Member currentMember) throws PermissionDeniedException {
+ private void validateGroupMember(ActivityGroup activityGroup, Member currentMember)
+ throws PermissionDeniedException {
if (!activityGroupMemberService.isGroupMember(activityGroup, currentMember.getId())) {
throw new PermissionDeniedException("해당 활동 그룹의 멤버가 아닙니다.");
}
}
- private void validateCanCreateBoard(ActivityGroup activityGroup, ActivityGroupBoardCategory category, Member currentMember) throws PermissionDeniedException {
+ private void validateCanCreateBoard(ActivityGroup activityGroup, ActivityGroupBoardCategory category,
+ Member currentMember) throws PermissionDeniedException {
Role role = currentMember.getRole();
boolean isRequireAdminOrLeaderCategory = category.isNotice() ||
- category.isWeeklyActivity() ||
- category.isAssignment() ||
- category.isFeedback();
+ category.isWeeklyActivity() ||
+ category.isAssignment() ||
+ category.isFeedback();
// NOTICE, WEEKLY_ACTIVITY, ASSIGNMENT, FEEDBACK 카테고리에서 권한이 ADMIN 이상이 아니거나, 리더가 아니면 예외처리
- if (isRequireAdminOrLeaderCategory && !(role.isHigherThanOrEqual(Role.ADMIN) || activityGroupAdminService.hasLeaderOrAdminRole(activityGroup, currentMember))) {
+ if (isRequireAdminOrLeaderCategory && !(role.isHigherThanOrEqual(Role.ADMIN)
+ || activityGroupAdminService.hasLeaderOrAdminRole(activityGroup, currentMember))) {
throw new PermissionDeniedException("해당 카테고리에서 게시글을 작성할 권한이 없습니다.");
}
}
@@ -128,16 +128,18 @@ private boolean isSubmitterOrLeader(ActivityGroup activityGroup, ActivityGroupBo
if (board.getCategory().isFeedback()) {
ActivityGroupBoard parentBoard = board.getParent();
boolean isParentSubmitter = parentBoard != null
- && parentBoard.getCategory().isSubmit()
- && parentBoard.isOwner(currentMember.getId());
+ && parentBoard.getCategory().isSubmit()
+ && parentBoard.isOwner(currentMember.getId());
return isLeader || isParentSubmitter;
}
return isSubmitter || isLeader;
}
- private void validateAlreadySubmittedAssignmentThisWeek(ActivityGroupBoardCategory category, Long parentId, String memberId) {
+ private void validateAlreadySubmittedAssignmentThisWeek(ActivityGroupBoardCategory category, Long parentId,
+ String memberId) {
if (category.isSubmit()) {
- boolean hasSubmitted = activityGroupBoardRepository.existsByParentIdAndCategoryAndMemberId(parentId, ActivityGroupBoardCategory.SUBMIT, memberId);
+ boolean hasSubmitted = activityGroupBoardRepository.existsByParentIdAndCategoryAndMemberId(parentId,
+ ActivityGroupBoardCategory.SUBMIT, memberId);
if (hasSubmitted) {
throw new AlreadySubmittedThisWeekAssignmentException();
}
@@ -148,56 +150,64 @@ private void validateAlreadySubmittedAssignmentThisWeek(ActivityGroupBoardCatego
public PagedResponseDto getAllActivityGroupBoard(Pageable pageable) {
Page boards = activityGroupBoardRepository.findAll(pageable);
return new PagedResponseDto<>(boards.map(board -> {
- MemberBasicInfoDto memberBasicInfoDto = externalRetrieveMemberUseCase.getMemberBasicInfoById(board.getMemberId());
+ MemberBasicInfoDto memberBasicInfoDto = externalRetrieveMemberUseCase.getMemberBasicInfoById(
+ board.getMemberId());
return mapper.toBoardDto(board, memberBasicInfoDto);
}));
}
@Transactional(readOnly = true)
- public ActivityGroupBoardResponseDto getActivityGroupBoard(Long activityGroupBoardId) throws PermissionDeniedException {
+ public ActivityGroupBoardResponseDto getActivityGroupBoard(Long activityGroupBoardId)
+ throws PermissionDeniedException {
Member currentMember = externalRetrieveMemberUseCase.getCurrentMember();
ActivityGroupBoard board = getActivityGroupBoardById(activityGroupBoardId);
validateGroupMember(board.getActivityGroup(), currentMember);
if (!hasAccessToBoard(board.getActivityGroup(), board, currentMember)) {
throw new PermissionDeniedException("해당 게시물을 조회할 권한이 없습니다.");
}
- MemberBasicInfoDto memberBasicInfoDto = externalRetrieveMemberUseCase.getMemberBasicInfoById(board.getMemberId());
+ MemberBasicInfoDto memberBasicInfoDto = externalRetrieveMemberUseCase.getMemberBasicInfoById(
+ board.getMemberId());
return mapper.toBoardDto(board, memberBasicInfoDto);
}
@Transactional(readOnly = true)
- public PagedResponseDto getActivityGroupBoardByCategory(Long activityGroupId, ActivityGroupBoardCategory category, Pageable pageable) throws PermissionDeniedException {
+ public PagedResponseDto getActivityGroupBoardByCategory(Long activityGroupId,
+ ActivityGroupBoardCategory category, Pageable pageable) throws PermissionDeniedException {
Member currentMember = externalRetrieveMemberUseCase.getCurrentMember();
ActivityGroup activityGroup = activityGroupAdminService.getActivityGroupById(activityGroupId);
validateGroupMember(activityGroup, currentMember);
- Page boards = activityGroupBoardRepository.findAllByActivityGroup_IdAndCategory(activityGroupId, category, pageable);
+ Page boards = activityGroupBoardRepository.findAllByActivityGroup_IdAndCategory(
+ activityGroupId, category, pageable);
// 사용자 권한에 따라 접근 가능한 게시판만 반환합니다.
List filteredBoards = boards.stream()
- .filter(board -> hasAccessToBoard(board.getActivityGroup(), board, currentMember))
- .map(board -> {
- MemberBasicInfoDto memberBasicInfoDto = externalRetrieveMemberUseCase.getMemberBasicInfoById(board.getMemberId());
- return mapper.toBoardDto(board, memberBasicInfoDto);
- })
- .toList();
+ .filter(board -> hasAccessToBoard(board.getActivityGroup(), board, currentMember))
+ .map(board -> {
+ MemberBasicInfoDto memberBasicInfoDto = externalRetrieveMemberUseCase.getMemberBasicInfoById(
+ board.getMemberId());
+ return mapper.toBoardDto(board, memberBasicInfoDto);
+ })
+ .toList();
return new PagedResponseDto<>(new PageImpl<>(filteredBoards, pageable, boards.getTotalElements()));
}
@Transactional(readOnly = true)
- public PagedResponseDto getActivityGroupBoardByParent(Long parentId, Pageable pageable) throws PermissionDeniedException {
+ public PagedResponseDto getActivityGroupBoardByParent(Long parentId,
+ Pageable pageable) throws PermissionDeniedException {
Member currentMember = externalRetrieveMemberUseCase.getCurrentMember();
ActivityGroupBoard parentBoard = getActivityGroupBoardById(parentId);
Long activityGroupId = parentBoard.getActivityGroup().getId();
validateGroupMember(parentBoard.getActivityGroup(), currentMember);
- List groupLeaders = activityGroupMemberService.getGroupMemberByActivityGroupIdAndRole(activityGroupId, ActivityGroupRole.LEADER);
+ List groupLeaders = activityGroupMemberService.getGroupMemberByActivityGroupIdAndRole(
+ activityGroupId, ActivityGroupRole.LEADER);
parentBoard.validateAccessPermission(currentMember, groupLeaders);
List childBoards = getChildBoards(parentId);
// 접근 가능한 자식 게시판만 조회합니다.
List filteredBoards = childBoards.stream()
- .filter(board -> hasAccessToBoard(board.getActivityGroup(), board, currentMember))
- .map(this::toActivityGroupBoardChildResponseDtoWithMemberInfo)
- .toList();
+ .filter(board -> hasAccessToBoard(board.getActivityGroup(), board, currentMember))
+ .map(this::toActivityGroupBoardChildResponseDtoWithMemberInfo)
+ .toList();
return new PagedResponseDto<>(new PageImpl<>(filteredBoards, pageable, filteredBoards.size()));
}
@@ -206,25 +216,29 @@ public PagedResponseDto getActivityGroupBoar
public List getMyAssignmentsWithFeedbacks(Long parentId) {
Member currentMember = externalRetrieveMemberUseCase.getCurrentMember();
- List mySubmissions = activityGroupBoardRepository.findMySubmissionsWithFeedbacks(parentId, currentMember.getId());
+ List mySubmissions = activityGroupBoardRepository.findMySubmissionsWithFeedbacks(parentId,
+ currentMember.getId());
// 해당 과제에 대한 피드백 목록을 조회합니다.
return mySubmissions.stream()
- .map(submission -> {
- List feedbackDtos = submission.getChildren().stream()
- .filter(ActivityGroupBoard::isFeedback)
- .map(board -> {
- MemberBasicInfoDto memberBasicInfoDto = externalRetrieveMemberUseCase.getMemberBasicInfoById(board.getMemberId());
- return mapper.toFeedbackDto(board, memberBasicInfoDto);
- })
- .toList();
- MemberBasicInfoDto memberBasicInfoDto = externalRetrieveMemberUseCase.getMemberBasicInfoById(submission.getMemberId());
- return mapper.toAssignmentDto(submission, memberBasicInfoDto, feedbackDtos);
- })
- .toList();
+ .map(submission -> {
+ List feedbackDtos = submission.getChildren().stream()
+ .filter(ActivityGroupBoard::isFeedback)
+ .map(board -> {
+ MemberBasicInfoDto memberBasicInfoDto = externalRetrieveMemberUseCase.getMemberBasicInfoById(
+ board.getMemberId());
+ return mapper.toFeedbackDto(board, memberBasicInfoDto);
+ })
+ .toList();
+ MemberBasicInfoDto memberBasicInfoDto = externalRetrieveMemberUseCase.getMemberBasicInfoById(
+ submission.getMemberId());
+ return mapper.toAssignmentDto(submission, memberBasicInfoDto, feedbackDtos);
+ })
+ .toList();
}
@Transactional
- public ActivityGroupBoardReferenceDto updateActivityGroupBoard(Long activityGroupBoardId, ActivityGroupBoardUpdateRequestDto requestDto) throws PermissionDeniedException {
+ public ActivityGroupBoardReferenceDto updateActivityGroupBoard(Long activityGroupBoardId,
+ ActivityGroupBoardUpdateRequestDto requestDto) throws PermissionDeniedException {
Member currentMember = externalRetrieveMemberUseCase.getCurrentMember();
ActivityGroupBoard board = getActivityGroupBoardById(activityGroupBoardId);
board.validateAccessPermission(currentMember);
@@ -235,7 +249,8 @@ public ActivityGroupBoardReferenceDto updateActivityGroupBoard(Long activityGrou
return mapper.of(board.getId(), board.getActivityGroup().getId(), parentId);
}
- public ActivityGroupBoardReferenceDto deleteActivityGroupBoard(Long activityGroupBoardId) throws PermissionDeniedException {
+ public ActivityGroupBoardReferenceDto deleteActivityGroupBoard(Long activityGroupBoardId)
+ throws PermissionDeniedException {
Member currentMember = externalRetrieveMemberUseCase.getCurrentMember();
ActivityGroupBoard board = getActivityGroupBoardById(activityGroupBoardId);
board.validateAccessPermission(currentMember);
@@ -248,29 +263,33 @@ public ActivityGroupBoardReferenceDto deleteActivityGroupBoard(Long activityGrou
public PagedResponseDto getDeletedActivityGroupBoards(Pageable pageable) {
Page boards = activityGroupBoardRepository.findAllByIsDeletedTrue(pageable);
return new PagedResponseDto<>(boards.map(board -> {
- MemberBasicInfoDto memberBasicInfoDto = externalRetrieveMemberUseCase.getMemberBasicInfoById(board.getMemberId());
+ MemberBasicInfoDto memberBasicInfoDto = externalRetrieveMemberUseCase.getMemberBasicInfoById(
+ board.getMemberId());
return mapper.toBoardDto(board, memberBasicInfoDto);
}));
}
public ActivityGroupBoard getActivityGroupBoardById(Long activityGroupBoardId) {
return activityGroupBoardRepository.findById(activityGroupBoardId)
- .orElseThrow(() -> new NotFoundException("해당 활동 그룹 게시글을 찾을 수 없습니다."));
+ .orElseThrow(() -> new NotFoundException("해당 활동 그룹 게시글을 찾을 수 없습니다."));
}
private List getChildBoards(Long activityGroupBoardId) {
- List children = activityGroupBoardRepository.findAllChildrenByParentId(activityGroupBoardId);
+ List children = activityGroupBoardRepository.findAllChildrenByParentId(
+ activityGroupBoardId);
children.sort(Comparator.comparing(ActivityGroupBoard::getCreatedAt).reversed());
return children;
}
- public ActivityGroupBoardChildResponseDto toActivityGroupBoardChildResponseDtoWithMemberInfo(ActivityGroupBoard activityGroupBoard) {
+ public ActivityGroupBoardChildResponseDto toActivityGroupBoardChildResponseDtoWithMemberInfo(
+ ActivityGroupBoard activityGroupBoard) {
Member currentMember = externalRetrieveMemberUseCase.getCurrentMember();
- MemberBasicInfoDto memberBasicInfo = externalRetrieveMemberUseCase.getMemberBasicInfoById(activityGroupBoard.getMemberId());
+ MemberBasicInfoDto memberBasicInfo = externalRetrieveMemberUseCase.getMemberBasicInfoById(
+ activityGroupBoard.getMemberId());
List childrenDtos = activityGroupBoard.getChildren().stream()
- .filter(children -> hasAccessToBoard(children.getActivityGroup(), children, currentMember))
- .map(this::toActivityGroupBoardChildResponseDtoWithMemberInfo)
- .toList();
+ .filter(children -> hasAccessToBoard(children.getActivityGroup(), children, currentMember))
+ .map(this::toActivityGroupBoardChildResponseDtoWithMemberInfo)
+ .toList();
return mapper.toChildDto(activityGroupBoard, memberBasicInfo, childrenDtos);
}
@@ -278,17 +297,15 @@ public ActivityGroupBoardChildResponseDto toActivityGroupBoardChildResponseDtoWi
* 주어진 카테고리와 부모 게시판의 유효성을 검증합니다.
*
* 다음 규칙을 따릅니다:
- * - 공지와 주차별 활동 게시판은 부모 게시판을 가질 수 없습니다.
- * - 과제, 제출, 피드백 게시판은 부모 게시판이 반드시 필요합니다.
- * - 과제의 부모는 주차별 활동 게시판이어야 합니다.
- * - 제출의 부모는 과제 게시판이어야 합니다.
- * - 피드백의 부모는 제출 게시판이어야 합니다.
+ * - 공지와 주차별 활동 게시판은 부모 게시판을 가질 수 없습니다. - 과제, 제출, 피드백 게시판은 부모 게시판이 반드시 필요합니다. - 과제의 부모는 주차별 활동 게시판이어야 합니다. - 제출의 부모는
+ * 과제 게시판이어야 합니다. - 피드백의 부모는 제출 게시판이어야 합니다.
*
* @param category 게시판 카테고리
* @param parentId 부모 게시판의 ID
* @throws InvalidParentBoardException 부모 게시판이 유효하지 않은 경우 예외 발생
*/
- private void validateParentBoard(ActivityGroupBoardCategory category, Long parentId) throws InvalidParentBoardException {
+ private void validateParentBoard(ActivityGroupBoardCategory category, Long parentId)
+ throws InvalidParentBoardException {
if ((category.isNotice() || category.isWeeklyActivity())) {
if (parentId != null) {
throw new InvalidParentBoardException(category.getDescription() + " 게시물은 부모 게시판을 가질 수 없습니다.");
@@ -325,33 +342,42 @@ private void validateParentBoard(ActivityGroupBoardCategory category, Long paren
* 새 게시판 생성에 대한 알림을 활동 그룹 멤버들에게 전송합니다.
*
* 이 메서드는 활동 그룹에서 새 게시판이 생성될 때 관련 멤버들에게 알림을 전송합니다.
- * 만약 게시판을 생성한 멤버가 그룹 리더일 경우, 본인을 제외한 다른 모든 멤버들에게 알림이 전송됩니다.
- * 단, 게시판이 피드백 유형일 경우에는 과제 제출한 멤버에게만 알림이 전송됩니다.
- * 만약 게시판을 생성한 멤버가 팀원인 경우, 그룹 리더에게만 알림이 전송됩니다.
+ * 만약 게시판을 생성한 멤버가 그룹 리더일 경우, 본인을 제외한 다른 모든 멤버들에게 알림이 전송됩니다. 단, 게시판이 피드백 유형일 경우에는 과제 제출한 멤버에게만 알림이 전송됩니다. 만약 게시판을
+ * 생성한 멤버가 팀원인 경우, 그룹 리더에게만 알림이 전송됩니다.
*
* @param activityGroupId 게시판이 생성된 활동 그룹의 ID
- * @param activityGroup 게시판이 생성된 활동 그룹
- * @param board 생성된 게시판 객체
- * @param member 게시판을 생성한 멤버 객체
+ * @param activityGroup 게시판이 생성된 활동 그룹
+ * @param board 생성된 게시판 객체
+ * @param member 게시판을 생성한 멤버 객체
*/
- private void notifyMembersAboutNewBoard(Long activityGroupId, ActivityGroup activityGroup, ActivityGroupBoard board, Member member) {
- GroupMember groupMember = activityGroupMemberService.getGroupMemberByActivityGroupAndMember(activityGroup, member.getId());
+ private void notifyMembersAboutNewBoard(Long activityGroupId, ActivityGroup activityGroup, ActivityGroupBoard board,
+ Member member) {
+ GroupMember groupMember = activityGroupMemberService.getGroupMemberByActivityGroupAndMember(activityGroup,
+ member.getId());
if (groupMember.isLeader()) {
if (board.isFeedback()) {
String submitMemberId = board.getParent().getMemberId();
- externalSendNotificationUseCase.sendNotificationToMember(submitMemberId, "[" + activityGroup.getName() + "] " + member.getName() + "님이 새 피드백을 등록하였습니다.");
+ externalSendNotificationUseCase.sendNotificationToMember(submitMemberId,
+ "[" + activityGroup.getName() + "] " + member.getName() + "님이 새 피드백을 등록하였습니다.");
} else {
- List groupMembers = activityGroupMemberService.getGroupMemberByActivityGroupIdAndStatus(activityGroupId, GroupMemberStatus.ACCEPTED);
+ List groupMembers = activityGroupMemberService.getGroupMemberByActivityGroupIdAndStatus(
+ activityGroupId, GroupMemberStatus.ACCEPTED);
List groupMembersId = groupMembers.stream()
- .map(GroupMember::getMemberId)
- .filter(memberId -> !memberId.equals(groupMember.getMemberId()))
- .collect(Collectors.toList());
- externalSendNotificationUseCase.sendNotificationToMembers(groupMembersId, "[" + activityGroup.getName() + "] " + member.getName() + "님이 새 " + board.getCategory().getDescription() + "을(를) 등록하였습니다.");
+ .map(GroupMember::getMemberId)
+ .filter(memberId -> !memberId.equals(groupMember.getMemberId()))
+ .collect(Collectors.toList());
+ externalSendNotificationUseCase.sendNotificationToMembers(groupMembersId,
+ "[" + activityGroup.getName() + "] " + member.getName() + "님이 새 " + board.getCategory()
+ .getDescription() + "을(를) 등록하였습니다.");
}
} else {
- List groupLeaders = activityGroupMemberService.getGroupMemberByActivityGroupIdAndRole(activityGroupId, ActivityGroupRole.LEADER);
+ List groupLeaders = activityGroupMemberService.getGroupMemberByActivityGroupIdAndRole(
+ activityGroupId, ActivityGroupRole.LEADER);
if (!CollectionUtils.isEmpty(groupLeaders)) {
- groupLeaders.forEach(leader -> externalSendNotificationUseCase.sendNotificationToMember(leader.getMemberId(), "[" + activityGroup.getName() + "] " + member.getName() + "님이 새 " + board.getCategory().getDescription() + "을(를) 등록하였습니다."));
+ groupLeaders.forEach(
+ leader -> externalSendNotificationUseCase.sendNotificationToMember(leader.getMemberId(),
+ "[" + activityGroup.getName() + "] " + member.getName() + "님이 새 " + board.getCategory()
+ .getDescription() + "을(를) 등록하였습니다."));
}
}
}
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/application/ActivityGroupMemberService.java b/src/main/java/page/clab/api/domain/activity/activitygroup/application/ActivityGroupMemberService.java
index 06fb731a8..9c072636a 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/application/ActivityGroupMemberService.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/application/ActivityGroupMemberService.java
@@ -1,5 +1,12 @@
package page.clab.api.domain.activity.activitygroup.application;
+import java.time.LocalDateTime;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.function.Function;
+import java.util.stream.Collectors;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
@@ -40,14 +47,6 @@
import page.clab.api.global.exception.NotFoundException;
import page.clab.api.global.util.PaginationUtils;
-import java.time.LocalDateTime;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-
@Service
@RequiredArgsConstructor
public class ActivityGroupMemberService {
@@ -68,56 +67,63 @@ public ActivityGroupDetailResponseDto getActivityGroup(Long activityGroupId) {
Member currentMember = externalRetrieveMemberUseCase.getCurrentMember();
boolean isOwner = details.getGroupMembers().stream()
- .anyMatch(groupMember -> groupMember.isOwnerAndLeader(currentMember));
+ .anyMatch(groupMember -> groupMember.isOwnerAndLeader(currentMember));
// 활동 그룹 멤버를 조회합니다.
List groupMemberResponseDtos = details.getGroupMembers().stream()
- .map(groupMember -> mapper.toDto(externalRetrieveMemberUseCase.getById(groupMember.getMemberId()), groupMember))
- .toList();
+ .map(groupMember -> mapper.toDto(externalRetrieveMemberUseCase.getById(groupMember.getMemberId()),
+ groupMember))
+ .toList();
// 활동 그룹 게시판을 조회합니다.
List activityGroupBoardResponseDtos =
- details.getActivityGroupBoards().stream()
- .map(board -> {
- MemberBasicInfoDto memberBasicInfoDto = externalRetrieveMemberUseCase.getMemberBasicInfoById(board.getMemberId());
- return mapper.toBoardDto(board, memberBasicInfoDto);
- })
- .toList();
-
- return mapper.toDto(details.getActivityGroup(), activityGroupBoardResponseDtos, groupMemberResponseDtos, isOwner);
+ details.getActivityGroupBoards().stream()
+ .map(board -> {
+ MemberBasicInfoDto memberBasicInfoDto = externalRetrieveMemberUseCase.getMemberBasicInfoById(
+ board.getMemberId());
+ return mapper.toBoardDto(board, memberBasicInfoDto);
+ })
+ .toList();
+
+ return mapper.toDto(details.getActivityGroup(), activityGroupBoardResponseDtos, groupMemberResponseDtos,
+ isOwner);
}
@Transactional(readOnly = true)
- public PagedResponseDto getMyActivityGroups(ActivityGroupStatus status, Pageable pageable) {
+ public PagedResponseDto getMyActivityGroups(ActivityGroupStatus status,
+ Pageable pageable) {
String currentMemberId = externalRetrieveMemberUseCase.getCurrentMemberId();
List groupMembers = getGroupMemberByMemberId(currentMemberId);
// 현재 로그인한 멤버가 활동중인 그룹을 조회합니다.
// 상태가 전달되지 않으면 모든 그룹을 조회합니다.
List activityGroups = groupMembers.stream()
- .filter(GroupMember::isAccepted)
- .map(GroupMember::getActivityGroup)
- .filter(activityGroup -> status == null || activityGroup.isSameStatus(status))
- .distinct()
- .toList();
+ .filter(GroupMember::isAccepted)
+ .map(GroupMember::getActivityGroup)
+ .filter(activityGroup -> status == null || activityGroup.isSameStatus(status))
+ .distinct()
+ .toList();
List activityGroupDtos = activityGroups.stream()
- .map(this::getActivityGroupStatusResponseDto)
- .toList();
+ .map(this::getActivityGroupStatusResponseDto)
+ .toList();
- List paginatedActivityGroupDtos = PaginationUtils.applySortingAndSlicing(activityGroupDtos, pageable);
+ List paginatedActivityGroupDtos = PaginationUtils.applySortingAndSlicing(
+ activityGroupDtos, pageable);
return new PagedResponseDto<>(paginatedActivityGroupDtos, activityGroups.size(), pageable);
}
@Transactional(readOnly = true)
- public PagedResponseDto getActivityGroupsByStatus(ActivityGroupStatus status, Pageable pageable) {
+ public PagedResponseDto getActivityGroupsByStatus(ActivityGroupStatus status,
+ Pageable pageable) {
Page activityGroups = activityGroupRepository.findActivityGroupsByStatus(status, pageable);
return new PagedResponseDto<>(activityGroups.map(this::getActivityGroupStatusResponseDto));
}
@Transactional(readOnly = true)
- public PagedResponseDto getActivityGroupsByCategory(ActivityGroupCategory category, Pageable pageable) {
+ public PagedResponseDto getActivityGroupsByCategory(ActivityGroupCategory category,
+ Pageable pageable) {
Page activityGroupList = getActivityGroupByCategory(category, pageable);
return new PagedResponseDto<>(activityGroupList.map(mapper::toDto));
}
@@ -130,7 +136,8 @@ public PagedResponseDto getGroupSchedules(Long activityGroupId
@Transactional(readOnly = true)
public PagedResponseDto getActivityGroupMembers(Long activityGroupId, Pageable pageable) {
- Page groupMembers = getGroupMemberByActivityGroupIdAndStatus(activityGroupId, GroupMemberStatus.ACCEPTED, pageable);
+ Page groupMembers = getGroupMemberByActivityGroupIdAndStatus(activityGroupId,
+ GroupMemberStatus.ACCEPTED, pageable);
return new PagedResponseDto<>(groupMembers.map(groupMember -> {
Member member = externalRetrieveMemberUseCase.getById(groupMember.getMemberId());
return mapper.toDto(member, groupMember);
@@ -149,12 +156,16 @@ public Long applyActivityGroup(Long activityGroupId, ApplyFormRequestDto formReq
ApplyForm form = mapper.fromDto(formRequestDto, activityGroup, currentMember);
applyFormRepository.save(form);
- GroupMember groupMember = GroupMember.create(currentMember.getId(), activityGroup, ActivityGroupRole.NONE, GroupMemberStatus.WAITING);
+ GroupMember groupMember = GroupMember.create(currentMember.getId(), activityGroup, ActivityGroupRole.NONE,
+ GroupMemberStatus.WAITING);
groupMemberRepository.save(groupMember);
- List groupLeaders = getGroupMemberByActivityGroupIdAndRole(activityGroup.getId(), ActivityGroupRole.LEADER);
+ List groupLeaders = getGroupMemberByActivityGroupIdAndRole(activityGroup.getId(),
+ ActivityGroupRole.LEADER);
if (!CollectionUtils.isEmpty(groupLeaders)) {
- groupLeaders.forEach(leader -> externalSendNotificationUseCase.sendNotificationToMember(leader.getMemberId(), "[" + activityGroup.getName() + "] " + currentMember.getName() + "님이 활동 참가 신청을 하였습니다."));
+ groupLeaders.forEach(
+ leader -> externalSendNotificationUseCase.sendNotificationToMember(leader.getMemberId(),
+ "[" + activityGroup.getName() + "] " + currentMember.getName() + "님이 활동 참가 신청을 하였습니다."));
}
return activityGroup.getId();
}
@@ -164,22 +175,23 @@ public PagedResponseDto getAppliedActivityGroups
List groupMembers = getGroupMemberByMemberId(currentMemberId);
List activityGroupIds = groupMembers.stream()
- .map(GroupMember::getActivityGroup)
- .map(ActivityGroup::getId)
- .distinct()
- .toList();
+ .map(GroupMember::getActivityGroup)
+ .map(ActivityGroup::getId)
+ .distinct()
+ .toList();
Map activityGroupOwners = findActivityGroupOwners(activityGroupIds);
List activityGroups = groupMembers.stream()
- .filter(groupMember -> !isActivityGroupOwner(groupMember, activityGroupOwners))
- .map(GroupMember::getActivityGroup)
- .filter(ActivityGroup::isProgressing)
- .distinct()
- .map(this::getActivityGroupStatusResponseDto)
- .toList();
+ .filter(groupMember -> !isActivityGroupOwner(groupMember, activityGroupOwners))
+ .map(GroupMember::getActivityGroup)
+ .filter(ActivityGroup::isProgressing)
+ .distinct()
+ .map(this::getActivityGroupStatusResponseDto)
+ .toList();
- List paginatedActivityGroups = PaginationUtils.applySortingAndSlicing(activityGroups, pageable);
+ List paginatedActivityGroups = PaginationUtils.applySortingAndSlicing(
+ activityGroups, pageable);
return new PagedResponseDto<>(paginatedActivityGroups, activityGroups.size(), pageable);
}
@@ -189,32 +201,33 @@ private ActivityGroupStatusResponseDto getActivityGroupStatusResponseDto(Activit
Long participantCount = groupMemberRepository.countAcceptedMembersByActivityGroupId(activityGroupId);
List leaderMembers = groupMemberRepository.findLeaderByActivityGroupId(activityGroupId)
- .stream()
- .map(leader -> {
- Member member = externalRetrieveMemberUseCase.getById(leader.getMemberId());
- LocalDateTime createdAt = leader.getCreatedAt();
- return mapper.create(member, createdAt);
- })
- // LEADER 직책을 가진 사람 중 가장 먼저 활동에 참여한 사람 순으로 정렬
- .sorted(Comparator.comparing(LeaderInfo::getCreatedAt))
- .toList();
-
- Long weeklyActivityCount = activityGroupBoardRepository.countByActivityGroupIdAndCategory(activityGroupId, ActivityGroupBoardCategory.WEEKLY_ACTIVITY);
+ .stream()
+ .map(leader -> {
+ Member member = externalRetrieveMemberUseCase.getById(leader.getMemberId());
+ LocalDateTime createdAt = leader.getCreatedAt();
+ return mapper.create(member, createdAt);
+ })
+ // LEADER 직책을 가진 사람 중 가장 먼저 활동에 참여한 사람 순으로 정렬
+ .sorted(Comparator.comparing(LeaderInfo::getCreatedAt))
+ .toList();
+
+ Long weeklyActivityCount = activityGroupBoardRepository.countByActivityGroupIdAndCategory(activityGroupId,
+ ActivityGroupBoardCategory.WEEKLY_ACTIVITY);
return mapper.toDto(activityGroup, leaderMembers, participantCount, weeklyActivityCount);
}
public ActivityGroup getActivityGroupById(Long activityGroupId) {
return activityGroupRepository.findById(activityGroupId)
- .orElseThrow(() -> new NotFoundException("해당 활동이 존재하지 않습니다."));
+ .orElseThrow(() -> new NotFoundException("해당 활동이 존재하지 않습니다."));
}
public Map findActivityGroupOwners(List activityGroupIds) {
return groupMemberRepository.findFirstByActivityGroupIdIn(activityGroupIds).stream()
- .collect(Collectors.toMap(
- groupMember -> groupMember.getActivityGroup().getId(),
- Function.identity()
- ));
+ .collect(Collectors.toMap(
+ groupMember -> groupMember.getActivityGroup().getId(),
+ Function.identity()
+ ));
}
public Optional findGroupMemberByActivityGroupAndMember(ActivityGroup activityGroup, String memberId) {
@@ -223,7 +236,7 @@ public Optional findGroupMemberByActivityGroupAndMember(ActivityGro
public GroupMember getGroupMemberByActivityGroupAndMember(ActivityGroup activityGroup, String memberId) {
return groupMemberRepository.findByActivityGroupAndMemberId(activityGroup, memberId)
- .orElseThrow(() -> new NotFoundException("해당 멤버가 활동에 참여하지 않았습니다."));
+ .orElseThrow(() -> new NotFoundException("해당 멤버가 활동에 참여하지 않았습니다."));
}
private Page getActivityGroupByCategory(ActivityGroupCategory category, Pageable pageable) {
@@ -246,7 +259,8 @@ public List getGroupMemberByActivityGroupIdAndStatus(Long activityG
return groupMemberRepository.findAllByActivityGroupIdAndStatus(activityGroupId, status);
}
- public Page getGroupMemberByActivityGroupIdAndStatus(Long activityGroupId, GroupMemberStatus status, Pageable pageable) {
+ public Page getGroupMemberByActivityGroupIdAndStatus(Long activityGroupId, GroupMemberStatus status,
+ Pageable pageable) {
return groupMemberRepository.findAllByActivityGroupIdAndStatus(activityGroupId, status, pageable);
}
@@ -259,7 +273,8 @@ public List getGroupMemberByMemberId(String memberId) {
}
public boolean isGroupMember(ActivityGroup activityGroup, String memberId) {
- return groupMemberRepository.existsByActivityGroupAndMemberIdAndStatus(activityGroup, memberId, GroupMemberStatus.ACCEPTED);
+ return groupMemberRepository.existsByActivityGroupAndMemberIdAndStatus(activityGroup, memberId,
+ GroupMemberStatus.ACCEPTED);
}
private boolean isActivityGroupOwner(GroupMember groupMember, Map activityGroupOwners) {
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/application/ActivityGroupReportService.java b/src/main/java/page/clab/api/domain/activity/activitygroup/application/ActivityGroupReportService.java
index 441beddd8..c17a91a8c 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/application/ActivityGroupReportService.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/application/ActivityGroupReportService.java
@@ -31,10 +31,12 @@ public class ActivityGroupReportService {
private final ActivityGroupDtoMapper mapper;
@Transactional
- public Long writeReport(ActivityGroupReportRequestDto requestDto) throws PermissionDeniedException, IllegalAccessException {
+ public Long writeReport(ActivityGroupReportRequestDto requestDto)
+ throws PermissionDeniedException, IllegalAccessException {
Member currentMember = externalRetrieveMemberUseCase.getCurrentMember();
Long activityGroupId = requestDto.getActivityGroupId();
- ActivityGroup activityGroup = activityGroupAdminService.validateAndGetActivityGroupForReporting(activityGroupId, currentMember);
+ ActivityGroup activityGroup = activityGroupAdminService.validateAndGetActivityGroupForReporting(activityGroupId,
+ currentMember);
ActivityGroupReport report = validateReportCreationPermission(requestDto, activityGroup);
return activityGroupReportRepository.save(report).getId();
}
@@ -42,7 +44,8 @@ public Long writeReport(ActivityGroupReportRequestDto requestDto) throws Permiss
@Transactional(readOnly = true)
public PagedResponseDto getReports(Long activityGroupId, Pageable pageable) {
ActivityGroup activityGroup = activityGroupAdminService.getActivityGroupById(activityGroupId);
- Page reports = activityGroupReportRepository.findAllByActivityGroup(activityGroup, pageable);
+ Page reports = activityGroupReportRepository.findAllByActivityGroup(activityGroup,
+ pageable);
return new PagedResponseDto<>(reports.map(mapper::toDto));
}
@@ -54,7 +57,8 @@ public ActivityGroupReportResponseDto searchReport(Long activityGroupId, Long tu
}
@Transactional
- public Long updateReport(Long reportId, Long activityGroupId, ActivityGroupReportUpdateRequestDto requestDto) throws PermissionDeniedException, IllegalAccessException {
+ public Long updateReport(Long reportId, Long activityGroupId, ActivityGroupReportUpdateRequestDto requestDto)
+ throws PermissionDeniedException, IllegalAccessException {
Member currentMember = externalRetrieveMemberUseCase.getCurrentMember();
ActivityGroup activityGroup = activityGroupAdminService.getActivityGroupById(activityGroupId);
validateReportUpdatePermission(activityGroupId, currentMember, activityGroup);
@@ -78,18 +82,21 @@ public PagedResponseDto getDeletedActivityGroupR
public ActivityGroupReport getReportById(Long reportId) {
return activityGroupReportRepository.findById(reportId)
- .orElseThrow(() -> new NotFoundException("활동 보고서를 찾을 수 없습니다."));
+ .orElseThrow(() -> new NotFoundException("활동 보고서를 찾을 수 없습니다."));
}
- private ActivityGroupReport validateReportCreationPermission(ActivityGroupReportRequestDto requestDto, ActivityGroup activityGroup) {
+ private ActivityGroupReport validateReportCreationPermission(ActivityGroupReportRequestDto requestDto,
+ ActivityGroup activityGroup) {
if (activityGroupReportRepository.existsByActivityGroupAndTurn(activityGroup, requestDto.getTurn())) {
throw new DuplicateReportException("이미 해당 차시의 보고서가 존재합니다.");
}
return mapper.fromDto(requestDto, activityGroup);
}
- private void validateReportUpdatePermission(Long activityGroupId, Member currentMember, ActivityGroup activityGroup) throws PermissionDeniedException, IllegalAccessException {
- if (!activityGroupAdminService.isMemberHasRoleInActivityGroup(currentMember, ActivityGroupRole.LEADER, activityGroupId)) {
+ private void validateReportUpdatePermission(Long activityGroupId, Member currentMember, ActivityGroup activityGroup)
+ throws PermissionDeniedException, IllegalAccessException {
+ if (!activityGroupAdminService.isMemberHasRoleInActivityGroup(currentMember, ActivityGroupRole.LEADER,
+ activityGroupId)) {
throw new PermissionDeniedException("해당 그룹의 리더만 보고서를 수정할 수 있습니다.");
}
if (!activityGroup.isProgressing()) {
@@ -98,9 +105,11 @@ private void validateReportUpdatePermission(Long activityGroupId, Member current
}
@NotNull
- private ActivityGroupReport validateReportDeletionPermission(Long reportId, Member member) throws PermissionDeniedException {
+ private ActivityGroupReport validateReportDeletionPermission(Long reportId, Member member)
+ throws PermissionDeniedException {
ActivityGroupReport report = getReportById(reportId);
- if (!activityGroupAdminService.isMemberHasRoleInActivityGroup(member, ActivityGroupRole.LEADER, report.getActivityGroup().getId())) {
+ if (!activityGroupAdminService.isMemberHasRoleInActivityGroup(member, ActivityGroupRole.LEADER,
+ report.getActivityGroup().getId())) {
throw new PermissionDeniedException("해당 그룹의 리더만 보고서를 삭제할 수 있습니다.");
}
return report;
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/application/AttendanceService.java b/src/main/java/page/clab/api/domain/activity/activitygroup/application/AttendanceService.java
index 53e0f8ae7..79a1516f0 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/application/AttendanceService.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/application/AttendanceService.java
@@ -2,6 +2,11 @@
import com.google.zxing.WriterException;
import com.warrenstrange.googleauth.GoogleAuthenticator;
+import java.io.File;
+import java.io.IOException;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
import lombok.RequiredArgsConstructor;
import org.jetbrains.annotations.NotNull;
import org.springframework.data.domain.Page;
@@ -32,12 +37,6 @@
import page.clab.api.global.exception.PermissionDeniedException;
import page.clab.api.global.util.QRCodeUtil;
-import java.io.File;
-import java.io.IOException;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-
@Service
@RequiredArgsConstructor
public class AttendanceService {
@@ -57,8 +56,8 @@ public class AttendanceService {
@NotNull
private static String buildPathForQRCode(ActivityGroup activityGroup) {
return "attendance" + File.separator
- + activityGroup.getCategory().toString() + File.separator
- + activityGroup.getId().toString();
+ + activityGroup.getCategory().toString() + File.separator
+ + activityGroup.getId().toString();
}
@NotNull
@@ -67,7 +66,8 @@ private static String generateQRCodeURL(Long activityGroupId, String secretKey)
}
@Transactional
- public String generateAttendanceQRCode(Long activityGroupId) throws IOException, WriterException, PermissionDeniedException, IllegalAccessException {
+ public String generateAttendanceQRCode(Long activityGroupId)
+ throws IOException, WriterException, PermissionDeniedException, IllegalAccessException {
Member currentMember = externalRetrieveMemberUseCase.getCurrentMember();
ActivityGroup activityGroup = validateAttendanceQRCodeGeneration(activityGroupId, currentMember);
@@ -77,7 +77,8 @@ public String generateAttendanceQRCode(Long activityGroupId) throws IOException,
redisQRKeyRepository.save(redisQRKey);
String url = generateQRCodeURL(activityGroupId, secretKey);
- Attendance attendance = Attendance.create(currentMember.getId(), activityGroup, LocalDate.parse(nowDateTime.split(" ")[0], dateFormatter));
+ Attendance attendance = Attendance.create(currentMember.getId(), activityGroup,
+ LocalDate.parse(nowDateTime.split(" ")[0], dateFormatter));
attendanceRepository.save(attendance);
byte[] QRCodeImage = QRCodeUtil.encodeQRCode(url);
@@ -95,7 +96,8 @@ public Long checkMemberAttendance(AttendanceRequestDto requestDto) throws Illega
}
@Transactional(readOnly = true)
- public PagedResponseDto getMyAttendances(Long activityGroupId, Pageable pageable) throws IllegalAccessException {
+ public PagedResponseDto getMyAttendances(Long activityGroupId, Pageable pageable)
+ throws IllegalAccessException {
Member currentMember = externalRetrieveMemberUseCase.getCurrentMember();
ActivityGroup activityGroup = validateGroupAndMemberForAttendance(activityGroupId, currentMember);
Page attendances = getAttendanceByMemberId(activityGroup, currentMember.getId(), pageable);
@@ -103,7 +105,8 @@ public PagedResponseDto getMyAttendances(Long activityGro
}
@Transactional(readOnly = true)
- public PagedResponseDto getGroupAttendances(Long activityGroupId, Pageable pageable) throws PermissionDeniedException {
+ public PagedResponseDto getGroupAttendances(Long activityGroupId, Pageable pageable)
+ throws PermissionDeniedException {
Member currentMember = externalRetrieveMemberUseCase.getCurrentMember();
ActivityGroup activityGroup = getActivityGroupWithValidPermissions(activityGroupId, currentMember);
Page attendances = getAttendanceByActivityGroup(activityGroup, pageable);
@@ -111,7 +114,8 @@ public PagedResponseDto getGroupAttendances(Long activity
}
@Transactional
- public Long writeAbsentExcuse(AbsentRequestDto requestDto) throws IllegalAccessException, DuplicateAbsentExcuseException {
+ public Long writeAbsentExcuse(AbsentRequestDto requestDto)
+ throws IllegalAccessException, DuplicateAbsentExcuseException {
Member absentee = externalRetrieveMemberUseCase.getById(requestDto.getAbsenteeId());
ActivityGroup activityGroup = getValidActivityGroup(requestDto.getActivityGroupId());
validateAbsentExcuseConditions(absentee, activityGroup, requestDto.getAbsentDate());
@@ -120,7 +124,8 @@ public Long writeAbsentExcuse(AbsentRequestDto requestDto) throws IllegalAccessE
}
@Transactional(readOnly = true)
- public PagedResponseDto getActivityGroupAbsentExcuses(Long activityGroupId, Pageable pageable) throws PermissionDeniedException {
+ public PagedResponseDto getActivityGroupAbsentExcuses(Long activityGroupId, Pageable pageable)
+ throws PermissionDeniedException {
Member currentMember = externalRetrieveMemberUseCase.getCurrentMember();
ActivityGroup activityGroup = getActivityGroupWithPermissionCheck(activityGroupId, currentMember);
Page absents = absentRepository.findAllByActivityGroup(activityGroup, pageable);
@@ -139,7 +144,8 @@ private Page getAttendanceByActivityGroup(ActivityGroup activityGrou
}
public boolean hasAttendanceHistory(ActivityGroup activityGroup, String memberId, LocalDate activityDate) {
- Attendance attendanceHistory = attendanceRepository.findByActivityGroupAndMemberIdAndActivityDate(activityGroup, memberId, activityDate);
+ Attendance attendanceHistory = attendanceRepository.findByActivityGroupAndMemberIdAndActivityDate(activityGroup,
+ memberId, activityDate);
return attendanceHistory != null;
}
@@ -148,15 +154,18 @@ public boolean isActivityExistedAt(ActivityGroup activityGroup, LocalDate date)
}
public boolean hasAbsentExcuseHistory(ActivityGroup activityGroup, Member absentee, LocalDate absentDate) {
- Absent absentHistory = absentRepository.findByActivityGroupAndMemberIdAndAbsentDate(activityGroup, absentee.getId(), absentDate);
+ Absent absentHistory = absentRepository.findByActivityGroupAndMemberIdAndAbsentDate(activityGroup,
+ absentee.getId(), absentDate);
return absentHistory != null;
}
@NotNull
- private ActivityGroup validateAttendanceQRCodeGeneration(Long activityGroupId, Member member) throws PermissionDeniedException, IllegalAccessException {
+ private ActivityGroup validateAttendanceQRCodeGeneration(Long activityGroupId, Member member)
+ throws PermissionDeniedException, IllegalAccessException {
ActivityGroup activityGroup = activityGroupAdminService.getActivityGroupById(activityGroupId);
- if (!activityGroupAdminService.isMemberHasRoleInActivityGroup(member, ActivityGroupRole.LEADER, activityGroupId)) {
+ if (!activityGroupAdminService.isMemberHasRoleInActivityGroup(member, ActivityGroupRole.LEADER,
+ activityGroupId)) {
throw new PermissionDeniedException("해당 그룹의 LEADER만 출석체크 QR을 생성할 수 있습니다.");
}
if (!activityGroup.isProgressing()) {
@@ -165,9 +174,11 @@ private ActivityGroup validateAttendanceQRCodeGeneration(Long activityGroupId, M
return activityGroup;
}
- private ActivityGroup validateMemberForAttendance(Member member, Long activityGroupId) throws IllegalAccessException, DuplicateAttendanceException {
+ private ActivityGroup validateMemberForAttendance(Member member, Long activityGroupId)
+ throws IllegalAccessException, DuplicateAttendanceException {
ActivityGroup activityGroup = activityGroupAdminService.getActivityGroupById(activityGroupId);
- if (!activityGroupAdminService.isMemberHasRoleInActivityGroup(member, ActivityGroupRole.MEMBER, activityGroupId)) {
+ if (!activityGroupAdminService.isMemberHasRoleInActivityGroup(member, ActivityGroupRole.MEMBER,
+ activityGroupId)) {
throw new IllegalAccessException("해당 그룹의 멤버가 아닙니다. 출석체크 인증을 진행할 수 없습니다.");
}
LocalDate today = LocalDate.now();
@@ -184,9 +195,11 @@ private void validateQRCodeData(String QRCodeData) throws InvalidInformationExce
}
@NotNull
- private ActivityGroup validateGroupAndMemberForAttendance(Long activityGroupId, Member member) throws IllegalAccessException {
+ private ActivityGroup validateGroupAndMemberForAttendance(Long activityGroupId, Member member)
+ throws IllegalAccessException {
ActivityGroup activityGroup = activityGroupAdminService.getActivityGroupById(activityGroupId);
- if (!activityGroupAdminService.isMemberHasRoleInActivityGroup(member, ActivityGroupRole.MEMBER, activityGroupId)) {
+ if (!activityGroupAdminService.isMemberHasRoleInActivityGroup(member, ActivityGroupRole.MEMBER,
+ activityGroupId)) {
throw new IllegalAccessException("해당 그룹의 멤버가 아닙니다. 출석체크 인증을 진행할 수 없습니다.");
}
if (!activityGroup.isProgressing()) {
@@ -195,9 +208,11 @@ private ActivityGroup validateGroupAndMemberForAttendance(Long activityGroupId,
return activityGroup;
}
- private ActivityGroup getActivityGroupWithValidPermissions(Long activityGroupId, Member member) throws PermissionDeniedException {
+ private ActivityGroup getActivityGroupWithValidPermissions(Long activityGroupId, Member member)
+ throws PermissionDeniedException {
ActivityGroup activityGroup = activityGroupAdminService.getActivityGroupById(activityGroupId);
- if (!member.isAdminRole() || !activityGroupAdminService.isMemberHasRoleInActivityGroup(member, ActivityGroupRole.LEADER, activityGroupId)) {
+ if (!member.isAdminRole() || !activityGroupAdminService.isMemberHasRoleInActivityGroup(member,
+ ActivityGroupRole.LEADER, activityGroupId)) {
throw new PermissionDeniedException("그룹의 출석기록을 조회할 권한이 없습니다.");
}
return activityGroup;
@@ -211,8 +226,10 @@ private ActivityGroup getValidActivityGroup(Long activityGroupId) throws Illegal
return activityGroup;
}
- private void validateAbsentExcuseConditions(Member absentee, ActivityGroup activityGroup, LocalDate absentDate) throws IllegalAccessException, DuplicateAbsentExcuseException {
- if (!activityGroupAdminService.isMemberHasRoleInActivityGroup(absentee, ActivityGroupRole.MEMBER, activityGroup.getId())) {
+ private void validateAbsentExcuseConditions(Member absentee, ActivityGroup activityGroup, LocalDate absentDate)
+ throws IllegalAccessException, DuplicateAbsentExcuseException {
+ if (!activityGroupAdminService.isMemberHasRoleInActivityGroup(absentee, ActivityGroupRole.MEMBER,
+ activityGroup.getId())) {
throw new IllegalAccessException("해당 그룹의 멤버가 아닙니다. 불참 사유서를 등록할 수 없습니다.");
}
if (!isActivityExistedAt(activityGroup, absentDate)) {
@@ -226,9 +243,11 @@ private void validateAbsentExcuseConditions(Member absentee, ActivityGroup activ
}
}
- private ActivityGroup getActivityGroupWithPermissionCheck(Long activityGroupId, Member member) throws PermissionDeniedException {
+ private ActivityGroup getActivityGroupWithPermissionCheck(Long activityGroupId, Member member)
+ throws PermissionDeniedException {
ActivityGroup activityGroup = activityGroupAdminService.getActivityGroupById(activityGroupId);
- if (!member.isAdminRole() && !activityGroupAdminService.isMemberHasRoleInActivityGroup(member, ActivityGroupRole.LEADER, activityGroupId)) {
+ if (!member.isAdminRole() && !activityGroupAdminService.isMemberHasRoleInActivityGroup(member,
+ ActivityGroupRole.LEADER, activityGroupId)) {
throw new PermissionDeniedException("해당 그룹의 불참사유서를 열람할 권한이 부족합니다.");
}
return activityGroup;
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dao/AbsentRepository.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dao/AbsentRepository.java
index f2cf76c48..f608ff96d 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dao/AbsentRepository.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dao/AbsentRepository.java
@@ -1,5 +1,6 @@
package page.clab.api.domain.activity.activitygroup.dao;
+import java.time.LocalDate;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
@@ -7,12 +8,11 @@
import page.clab.api.domain.activity.activitygroup.domain.Absent;
import page.clab.api.domain.activity.activitygroup.domain.ActivityGroup;
-import java.time.LocalDate;
-
@Repository
public interface AbsentRepository extends JpaRepository {
Page findAllByActivityGroup(ActivityGroup activityGroup, Pageable pageable);
- Absent findByActivityGroupAndMemberIdAndAbsentDate(ActivityGroup activityGroup, String memberId, LocalDate absentDate);
+ Absent findByActivityGroupAndMemberIdAndAbsentDate(ActivityGroup activityGroup, String memberId,
+ LocalDate absentDate);
}
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dao/ActivityGroupBoardRepository.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dao/ActivityGroupBoardRepository.java
index 1aba07fd7..bc0075bee 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dao/ActivityGroupBoardRepository.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dao/ActivityGroupBoardRepository.java
@@ -1,5 +1,6 @@
package page.clab.api.domain.activity.activitygroup.dao;
+import java.util.List;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
@@ -9,12 +10,12 @@
import page.clab.api.domain.activity.activitygroup.domain.ActivityGroupBoard;
import page.clab.api.domain.activity.activitygroup.domain.ActivityGroupBoardCategory;
-import java.util.List;
-
@Repository
-public interface ActivityGroupBoardRepository extends JpaRepository, ActivityGroupBoardRepositoryCustom, QuerydslPredicateExecutor {
+public interface ActivityGroupBoardRepository extends JpaRepository,
+ ActivityGroupBoardRepositoryCustom, QuerydslPredicateExecutor {
- Page findAllByActivityGroup_IdAndCategory(Long activityGroupId, ActivityGroupBoardCategory category, Pageable pageable);
+ Page findAllByActivityGroup_IdAndCategory(Long activityGroupId,
+ ActivityGroupBoardCategory category, Pageable pageable);
Long countByActivityGroupIdAndCategory(Long id, ActivityGroupBoardCategory category);
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dao/ActivityGroupBoardRepositoryCustom.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dao/ActivityGroupBoardRepositoryCustom.java
index 737f00fc6..354d05ff0 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dao/ActivityGroupBoardRepositoryCustom.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dao/ActivityGroupBoardRepositoryCustom.java
@@ -1,9 +1,9 @@
package page.clab.api.domain.activity.activitygroup.dao;
-import page.clab.api.domain.activity.activitygroup.domain.ActivityGroupBoard;
-
import java.util.List;
+import page.clab.api.domain.activity.activitygroup.domain.ActivityGroupBoard;
public interface ActivityGroupBoardRepositoryCustom {
+
List findMySubmissionsWithFeedbacks(Long parentId, String memberId);
}
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dao/ActivityGroupBoardRepositoryImpl.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dao/ActivityGroupBoardRepositoryImpl.java
index c4497ca07..0c09d7fb1 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dao/ActivityGroupBoardRepositoryImpl.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dao/ActivityGroupBoardRepositoryImpl.java
@@ -2,14 +2,13 @@
import com.querydsl.core.BooleanBuilder;
import com.querydsl.jpa.impl.JPAQueryFactory;
+import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository;
import page.clab.api.domain.activity.activitygroup.domain.ActivityGroupBoard;
import page.clab.api.domain.activity.activitygroup.domain.ActivityGroupBoardCategory;
import page.clab.api.domain.activity.activitygroup.domain.QActivityGroupBoard;
-import java.util.List;
-
@Repository
@RequiredArgsConstructor
public class ActivityGroupBoardRepositoryImpl implements ActivityGroupBoardRepositoryCustom {
@@ -27,9 +26,9 @@ public List findMySubmissionsWithFeedbacks(Long parentId, St
builder.and(qBoard.category.eq(ActivityGroupBoardCategory.SUBMIT));
return queryFactory.selectFrom(qBoard)
- .leftJoin(qBoard.children, qChild).fetchJoin()
- .where(builder)
- .distinct()
- .fetch();
+ .leftJoin(qBoard.children, qChild).fetchJoin()
+ .where(builder)
+ .distinct()
+ .fetch();
}
}
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dao/ActivityGroupDetailsRepository.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dao/ActivityGroupDetailsRepository.java
index 3ee9d2f66..67ec5019a 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dao/ActivityGroupDetailsRepository.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dao/ActivityGroupDetailsRepository.java
@@ -3,5 +3,6 @@
import page.clab.api.domain.activity.activitygroup.dto.param.ActivityGroupDetails;
public interface ActivityGroupDetailsRepository {
+
ActivityGroupDetails fetchActivityGroupDetails(Long activityGroupId);
}
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dao/ActivityGroupDetailsRepositoryImpl.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dao/ActivityGroupDetailsRepositoryImpl.java
index 33fb3af50..a1c2fd59b 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dao/ActivityGroupDetailsRepositoryImpl.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dao/ActivityGroupDetailsRepositoryImpl.java
@@ -2,6 +2,7 @@
import com.querydsl.core.BooleanBuilder;
import com.querydsl.jpa.impl.JPAQueryFactory;
+import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository;
import page.clab.api.domain.activity.activitygroup.domain.ActivityGroup;
@@ -15,8 +16,6 @@
import page.clab.api.domain.activity.activitygroup.dto.mapper.ActivityGroupDtoMapper;
import page.clab.api.domain.activity.activitygroup.dto.param.ActivityGroupDetails;
-import java.util.List;
-
@Repository
@RequiredArgsConstructor
public class ActivityGroupDetailsRepositoryImpl implements ActivityGroupDetailsRepository {
@@ -31,32 +30,40 @@ public ActivityGroupDetails fetchActivityGroupDetails(Long activityGroupId) {
QActivityGroupBoard qActivityGroupBoard = QActivityGroupBoard.activityGroupBoard;
BooleanBuilder groupMemberCondition = new BooleanBuilder();
- if (activityGroupId != null) groupMemberCondition.and(qGroupMember.activityGroup.id.eq(activityGroupId)
+ if (activityGroupId != null) {
+ groupMemberCondition.and(qGroupMember.activityGroup.id.eq(activityGroupId)
.and(qGroupMember.status.eq(GroupMemberStatus.ACCEPTED)));
+ }
List groupMembers = queryFactory.selectFrom(qGroupMember)
- .where(groupMemberCondition)
- .fetch();
+ .where(groupMemberCondition)
+ .fetch();
BooleanBuilder boardCondition = new BooleanBuilder();
- if (activityGroupId != null) boardCondition.and(qActivityGroupBoard.activityGroup.id.eq(activityGroupId));
- if (activityGroupId != null) boardCondition.and(qActivityGroupBoard.category.in(
+ if (activityGroupId != null) {
+ boardCondition.and(qActivityGroupBoard.activityGroup.id.eq(activityGroupId));
+ }
+ if (activityGroupId != null) {
+ boardCondition.and(qActivityGroupBoard.category.in(
ActivityGroupBoardCategory.NOTICE,
ActivityGroupBoardCategory.WEEKLY_ACTIVITY,
ActivityGroupBoardCategory.ASSIGNMENT)
- );
+ );
+ }
List boards = queryFactory.selectFrom(qActivityGroupBoard)
- .where(boardCondition)
- .orderBy(qActivityGroupBoard.createdAt.desc())
- .fetch();
+ .where(boardCondition)
+ .orderBy(qActivityGroupBoard.createdAt.desc())
+ .fetch();
BooleanBuilder activityGroupCondition = new BooleanBuilder();
- if (activityGroupId != null) activityGroupCondition.and(qActivityGroup.id.eq(activityGroupId));
+ if (activityGroupId != null) {
+ activityGroupCondition.and(qActivityGroup.id.eq(activityGroupId));
+ }
ActivityGroup foundActivityGroup = queryFactory.selectFrom(qActivityGroup)
- .where(activityGroupCondition)
- .fetchOne();
+ .where(activityGroupCondition)
+ .fetchOne();
return mapper.of(foundActivityGroup, groupMembers, boards);
}
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dao/ActivityGroupRepository.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dao/ActivityGroupRepository.java
index a72b46a28..0355f77b1 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dao/ActivityGroupRepository.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dao/ActivityGroupRepository.java
@@ -1,5 +1,7 @@
package page.clab.api.domain.activity.activitygroup.dao;
+import java.time.LocalDate;
+import java.util.List;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
@@ -10,11 +12,9 @@
import page.clab.api.domain.activity.activitygroup.domain.ActivityGroupCategory;
import page.clab.api.domain.activity.activitygroup.domain.ActivityGroupStatus;
-import java.time.LocalDate;
-import java.util.List;
-
@Repository
-public interface ActivityGroupRepository extends JpaRepository, ActivityGroupRepositoryCustom, QuerydslPredicateExecutor {
+public interface ActivityGroupRepository extends JpaRepository, ActivityGroupRepositoryCustom,
+ QuerydslPredicateExecutor {
Page findAllByCategory(ActivityGroupCategory category, Pageable pageable);
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dao/ActivityGroupRepositoryCustomImpl.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dao/ActivityGroupRepositoryCustomImpl.java
index a90baf8fb..7342df365 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dao/ActivityGroupRepositoryCustomImpl.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dao/ActivityGroupRepositoryCustomImpl.java
@@ -2,6 +2,7 @@
import com.querydsl.core.BooleanBuilder;
import com.querydsl.jpa.impl.JPAQueryFactory;
+import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
@@ -12,8 +13,6 @@
import page.clab.api.domain.activity.activitygroup.domain.QActivityGroup;
import page.clab.api.global.util.OrderSpecifierUtil;
-import java.util.List;
-
@Repository
@RequiredArgsConstructor
public class ActivityGroupRepositoryCustomImpl implements ActivityGroupRepositoryCustom {
@@ -25,19 +24,21 @@ public Page findActivityGroupsByStatus(ActivityGroupStatus status
QActivityGroup qActivityGroup = QActivityGroup.activityGroup;
BooleanBuilder builder = new BooleanBuilder();
- if (status != null) builder.and(qActivityGroup.status.eq(status));
+ if (status != null) {
+ builder.and(qActivityGroup.status.eq(status));
+ }
List activityGroups = queryFactory.selectFrom(qActivityGroup)
- .where(builder)
- .orderBy(OrderSpecifierUtil.getOrderSpecifiers(pageable, qActivityGroup))
- .offset(pageable.getOffset())
- .limit(pageable.getPageSize())
- .fetch();
+ .where(builder)
+ .orderBy(OrderSpecifierUtil.getOrderSpecifiers(pageable, qActivityGroup))
+ .offset(pageable.getOffset())
+ .limit(pageable.getPageSize())
+ .fetch();
Long total = queryFactory.select(qActivityGroup.count())
- .from(qActivityGroup)
- .where(builder)
- .fetchOne();
+ .from(qActivityGroup)
+ .where(builder)
+ .fetchOne();
long totalElements = total != null ? total : 0;
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dao/ApplyFormRepository.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dao/ApplyFormRepository.java
index dc4d0aeda..aeb8d11fc 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dao/ApplyFormRepository.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dao/ApplyFormRepository.java
@@ -1,11 +1,11 @@
package page.clab.api.domain.activity.activitygroup.dao;
+import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import page.clab.api.domain.activity.activitygroup.domain.ActivityGroup;
import page.clab.api.domain.activity.activitygroup.domain.ApplyForm;
-import java.util.List;
-
public interface ApplyFormRepository extends JpaRepository {
+
List findAllByActivityGroup(ActivityGroup activityGroup);
}
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dao/AttendanceRepository.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dao/AttendanceRepository.java
index 35c29b411..2e2c11345 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dao/AttendanceRepository.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dao/AttendanceRepository.java
@@ -1,20 +1,20 @@
package page.clab.api.domain.activity.activitygroup.dao;
+import java.time.LocalDate;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import page.clab.api.domain.activity.activitygroup.domain.ActivityGroup;
import page.clab.api.domain.activity.activitygroup.domain.Attendance;
-import java.time.LocalDate;
-
public interface AttendanceRepository extends JpaRepository {
Page findAllByMemberIdAndActivityGroup(String memberId, ActivityGroup activityGroup, Pageable pageable);
Page findAllByActivityGroup(ActivityGroup activityGroup, Pageable pageable);
- Attendance findByActivityGroupAndMemberIdAndActivityDate(ActivityGroup activityGroup, String memberId, LocalDate activityDate);
+ Attendance findByActivityGroupAndMemberIdAndActivityDate(ActivityGroup activityGroup, String memberId,
+ LocalDate activityDate);
boolean existsByActivityGroupAndActivityDate(ActivityGroup activityGroup, LocalDate activityDate);
}
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dao/GroupMemberRepository.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dao/GroupMemberRepository.java
index ba759eec8..6d433326a 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dao/GroupMemberRepository.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dao/GroupMemberRepository.java
@@ -1,5 +1,7 @@
package page.clab.api.domain.activity.activitygroup.dao;
+import java.util.List;
+import java.util.Optional;
import org.springframework.data.domain.Page;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
@@ -12,11 +14,9 @@
import page.clab.api.domain.activity.activitygroup.domain.GroupMemberId;
import page.clab.api.domain.activity.activitygroup.domain.GroupMemberStatus;
-import java.util.List;
-import java.util.Optional;
-
@Repository
-public interface GroupMemberRepository extends JpaRepository, GroupMemberRepositoryCustom, QuerydslPredicateExecutor {
+public interface GroupMemberRepository extends JpaRepository, GroupMemberRepositoryCustom,
+ QuerydslPredicateExecutor {
List findAllByMemberId(String memberId);
@@ -28,18 +28,21 @@ public interface GroupMemberRepository extends JpaRepository findAllByActivityGroupIdOrderByMemberIdAsc(Long activityGroupId);
- Page findAllByActivityGroupIdAndStatus(Long activityGroupId, GroupMemberStatus status, org.springframework.data.domain.Pageable pageable);
+ Page findAllByActivityGroupIdAndStatus(Long activityGroupId, GroupMemberStatus status,
+ org.springframework.data.domain.Pageable pageable);
List findAllByActivityGroupIdAndStatus(Long activityGroupId, GroupMemberStatus status);
- boolean existsByActivityGroupAndMemberIdAndStatus(ActivityGroup activityGroup, String memberId, GroupMemberStatus status);
+ boolean existsByActivityGroupAndMemberIdAndStatus(ActivityGroup activityGroup, String memberId,
+ GroupMemberStatus status);
- boolean existsByActivityGroupIdAndMemberIdAndStatus(Long activityGroupId, String memberId, GroupMemberStatus status);
+ boolean existsByActivityGroupIdAndMemberIdAndStatus(Long activityGroupId, String memberId,
+ GroupMemberStatus status);
// activityGroupIds 리스트에 해당하는 각 ActivityGroup에서, 가장 createdAt이 오래된 GroupMember를 조회합니다.
@Query(value = "SELECT DISTINCT ON (gm.activity_group_id) * " +
- "FROM group_member gm " +
- "WHERE gm.activity_group_id IN :activityGroupIds " +
- "ORDER BY gm.activity_group_id, gm.created_at ASC", nativeQuery = true)
+ "FROM group_member gm " +
+ "WHERE gm.activity_group_id IN :activityGroupIds " +
+ "ORDER BY gm.activity_group_id, gm.created_at ASC", nativeQuery = true)
List findFirstByActivityGroupIdIn(@Param("activityGroupIds") List activityGroupIds);
}
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dao/GroupMemberRepositoryCustom.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dao/GroupMemberRepositoryCustom.java
index ba09f4fc4..1c7922488 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dao/GroupMemberRepositoryCustom.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dao/GroupMemberRepositoryCustom.java
@@ -1,11 +1,10 @@
package page.clab.api.domain.activity.activitygroup.dao;
+import java.util.List;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import page.clab.api.domain.activity.activitygroup.domain.GroupMember;
-import java.util.List;
-
public interface GroupMemberRepositoryCustom {
long countAcceptedMembersByActivityGroupId(Long activityGroupId);
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dao/GroupMemberRepositoryImpl.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dao/GroupMemberRepositoryImpl.java
index fb1ce48c6..29a51f100 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dao/GroupMemberRepositoryImpl.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dao/GroupMemberRepositoryImpl.java
@@ -4,19 +4,21 @@
import com.querydsl.core.types.OrderSpecifier;
import com.querydsl.core.types.dsl.CaseBuilder;
import com.querydsl.jpa.impl.JPAQueryFactory;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Stream;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository;
-import page.clab.api.domain.activity.activitygroup.domain.*;
+import page.clab.api.domain.activity.activitygroup.domain.ActivityGroupRole;
+import page.clab.api.domain.activity.activitygroup.domain.GroupMember;
+import page.clab.api.domain.activity.activitygroup.domain.GroupMemberStatus;
+import page.clab.api.domain.activity.activitygroup.domain.QGroupMember;
import page.clab.api.global.util.OrderSpecifierUtil;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Objects;
-import java.util.stream.Stream;
-
@Repository
@RequiredArgsConstructor
public class GroupMemberRepositoryImpl implements GroupMemberRepositoryCustom {
@@ -28,12 +30,14 @@ public long countAcceptedMembersByActivityGroupId(Long activityGroupId) {
QGroupMember qGroupMember = QGroupMember.groupMember;
BooleanBuilder builder = new BooleanBuilder();
- if (activityGroupId != null) builder.and(qGroupMember.activityGroup.id.eq(activityGroupId));
+ if (activityGroupId != null) {
+ builder.and(qGroupMember.activityGroup.id.eq(activityGroupId));
+ }
builder.and(qGroupMember.status.eq(GroupMemberStatus.ACCEPTED));
return queryFactory.selectFrom(qGroupMember)
- .where(builder)
- .fetchCount();
+ .where(builder)
+ .fetchCount();
}
@Override
@@ -41,12 +45,16 @@ public List findLeaderByActivityGroupId(Long activityGroupId) {
QGroupMember qGroupMember = QGroupMember.groupMember;
BooleanBuilder builder = new BooleanBuilder();
- if (activityGroupId != null) builder.and(qGroupMember.activityGroup.id.eq(activityGroupId));
- if (activityGroupId != null) builder.and(qGroupMember.role.eq(ActivityGroupRole.LEADER));
+ if (activityGroupId != null) {
+ builder.and(qGroupMember.activityGroup.id.eq(activityGroupId));
+ }
+ if (activityGroupId != null) {
+ builder.and(qGroupMember.role.eq(ActivityGroupRole.LEADER));
+ }
return queryFactory.selectFrom(qGroupMember)
- .where(builder)
- .fetch();
+ .where(builder)
+ .fetch();
}
@Override
@@ -54,40 +62,42 @@ public Page findAllByActivityGroupId(Long activityGroupId, Pageable
QGroupMember qGroupMember = QGroupMember.groupMember;
BooleanBuilder builder = new BooleanBuilder();
- if (activityGroupId != null) builder.and(qGroupMember.activityGroup.id.eq(activityGroupId));
+ if (activityGroupId != null) {
+ builder.and(qGroupMember.activityGroup.id.eq(activityGroupId));
+ }
OrderSpecifier leaderOrder = new CaseBuilder()
- .when(qGroupMember.role.eq(ActivityGroupRole.LEADER)).then(0)
- .otherwise(1)
- .asc();
+ .when(qGroupMember.role.eq(ActivityGroupRole.LEADER)).then(0)
+ .otherwise(1)
+ .asc();
OrderSpecifier statusOrder = pageable.getSort().stream()
- .filter(order -> order.getProperty().equals("status"))
- .findFirst()
- .map(order -> new CaseBuilder()
- .when(qGroupMember.status.eq(GroupMemberStatus.WAITING)).then(0)
- .when(qGroupMember.status.eq(GroupMemberStatus.ACCEPTED)).then(1)
- .when(qGroupMember.status.eq(GroupMemberStatus.REJECTED)).then(2)
- .otherwise(3)
- .asc())
- .orElse(null);
+ .filter(order -> order.getProperty().equals("status"))
+ .findFirst()
+ .map(order -> new CaseBuilder()
+ .when(qGroupMember.status.eq(GroupMemberStatus.WAITING)).then(0)
+ .when(qGroupMember.status.eq(GroupMemberStatus.ACCEPTED)).then(1)
+ .when(qGroupMember.status.eq(GroupMemberStatus.REJECTED)).then(2)
+ .otherwise(3)
+ .asc())
+ .orElse(null);
OrderSpecifier>[] dynamicOrderSpecifiers = OrderSpecifierUtil.getOrderSpecifiers(pageable, qGroupMember);
List groupMembers = queryFactory.selectFrom(qGroupMember)
- .where(builder)
- .orderBy(Stream.concat(
- Stream.of(leaderOrder, statusOrder).filter(Objects::nonNull),
- Arrays.stream(dynamicOrderSpecifiers)
- ).toArray(OrderSpecifier[]::new))
- .offset(pageable.getOffset())
- .limit(pageable.getPageSize())
- .fetch();
+ .where(builder)
+ .orderBy(Stream.concat(
+ Stream.of(leaderOrder, statusOrder).filter(Objects::nonNull),
+ Arrays.stream(dynamicOrderSpecifiers)
+ ).toArray(OrderSpecifier[]::new))
+ .offset(pageable.getOffset())
+ .limit(pageable.getPageSize())
+ .fetch();
Long total = queryFactory.select(qGroupMember.count())
- .from(qGroupMember)
- .where(builder)
- .fetchOne();
+ .from(qGroupMember)
+ .where(builder)
+ .fetchOne();
long totalElements = total != null ? total : 0;
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dao/GroupScheduleRepository.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dao/GroupScheduleRepository.java
index f99dff5fe..7726739f1 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dao/GroupScheduleRepository.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dao/GroupScheduleRepository.java
@@ -1,13 +1,12 @@
package page.clab.api.domain.activity.activitygroup.dao;
+import java.util.List;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import page.clab.api.domain.activity.activitygroup.domain.GroupSchedule;
-import java.util.List;
-
@Repository
public interface GroupScheduleRepository extends JpaRepository {
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dao/RedisQRKeyRepository.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dao/RedisQRKeyRepository.java
index 8f9246194..1831c3758 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dao/RedisQRKeyRepository.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dao/RedisQRKeyRepository.java
@@ -4,5 +4,6 @@
import page.clab.api.domain.activity.activitygroup.domain.RedisQRKey;
public interface RedisQRKeyRepository extends CrudRepository {
+
boolean existsByQRCodeKey(String qrCodeData);
}
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/domain/Absent.java b/src/main/java/page/clab/api/domain/activity/activitygroup/domain/Absent.java
index 60bd1b453..8cad66927 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/domain/Absent.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/domain/Absent.java
@@ -7,6 +7,7 @@
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
+import java.time.LocalDate;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
@@ -16,8 +17,6 @@
import lombok.Setter;
import page.clab.api.global.common.domain.BaseEntity;
-import java.time.LocalDate;
-
@Entity
@Getter
@Setter
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/domain/ActivityGroup.java b/src/main/java/page/clab/api/domain/activity/activitygroup/domain/ActivityGroup.java
index 0acd963e1..e9cec048d 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/domain/ActivityGroup.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/domain/ActivityGroup.java
@@ -8,6 +8,8 @@
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.validation.constraints.Size;
+import java.time.LocalDate;
+import java.util.Optional;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
@@ -22,9 +24,6 @@
import page.clab.api.domain.activity.activitygroup.exception.InvalidGithubUrlException;
import page.clab.api.global.common.domain.BaseEntity;
-import java.time.LocalDate;
-import java.util.Optional;
-
@Entity(name = "activity_group")
@Getter
@Setter
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/domain/ActivityGroupBoard.java b/src/main/java/page/clab/api/domain/activity/activitygroup/domain/ActivityGroupBoard.java
index b50484927..cbb37c37c 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/domain/ActivityGroupBoard.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/domain/ActivityGroupBoard.java
@@ -12,6 +12,10 @@
import jakarta.persistence.ManyToOne;
import jakarta.persistence.OneToMany;
import jakarta.validation.constraints.Future;
+import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
@@ -30,11 +34,6 @@
import page.clab.api.global.common.file.domain.UploadedFile;
import page.clab.api.global.exception.PermissionDeniedException;
-import java.time.LocalDateTime;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Optional;
-
@Entity
@Getter
@Setter
@@ -87,7 +86,8 @@ public void update(ActivityGroupBoardUpdateRequestDto requestDto, UploadedFileSe
Optional.ofNullable(requestDto.getTitle()).ifPresent(this::setTitle);
Optional.ofNullable(requestDto.getContent()).ifPresent(this::setContent);
Optional.ofNullable(requestDto.getDueDateTime()).ifPresent(this::setDueDateTime);
- Optional.ofNullable(requestDto.getFileUrls()).ifPresent(urls -> this.setUploadedFiles(uploadedFileService.getUploadedFilesByUrls(urls)));
+ Optional.ofNullable(requestDto.getFileUrls())
+ .ifPresent(urls -> this.setUploadedFiles(uploadedFileService.getUploadedFilesByUrls(urls)));
}
public void addChild(ActivityGroupBoard child) {
@@ -113,7 +113,8 @@ public boolean isFeedback() {
}
public void validateAccessPermission(Member member, List leaders) throws PermissionDeniedException {
- if (!member.isAdminRole() && !CollectionUtils.isEmpty(leaders) && leaders.stream().noneMatch(leader -> leader.isOwner(member.getId()))) {
+ if (!member.isAdminRole() && !CollectionUtils.isEmpty(leaders) && leaders.stream()
+ .noneMatch(leader -> leader.isOwner(member.getId()))) {
if (this.isAssignment()) {
throw new PermissionDeniedException("과제 게시판에 접근할 권한이 없습니다.");
}
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/domain/ActivityGroupReport.java b/src/main/java/page/clab/api/domain/activity/activitygroup/domain/ActivityGroupReport.java
index 311bd003f..4ca1c295a 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/domain/ActivityGroupReport.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/domain/ActivityGroupReport.java
@@ -7,6 +7,7 @@
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
+import java.util.Optional;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
@@ -18,8 +19,6 @@
import page.clab.api.domain.activity.activitygroup.dto.request.ActivityGroupReportUpdateRequestDto;
import page.clab.api.global.common.domain.BaseEntity;
-import java.util.Optional;
-
@Entity
@Getter
@Setter
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/domain/Attendance.java b/src/main/java/page/clab/api/domain/activity/activitygroup/domain/Attendance.java
index 05880dd37..defcf0bd7 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/domain/Attendance.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/domain/Attendance.java
@@ -7,6 +7,7 @@
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
+import java.time.LocalDate;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
@@ -15,8 +16,6 @@
import lombok.Setter;
import page.clab.api.global.common.domain.BaseEntity;
-import java.time.LocalDate;
-
@Entity
@Getter
@Setter
@@ -40,9 +39,9 @@ public class Attendance extends BaseEntity {
public static Attendance create(String memberId, ActivityGroup activityGroup, LocalDate activityDate) {
return Attendance.builder()
- .memberId(memberId)
- .activityGroup(activityGroup)
- .activityDate(activityDate)
- .build();
+ .memberId(memberId)
+ .activityGroup(activityGroup)
+ .activityDate(activityDate)
+ .build();
}
}
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/domain/GroupMember.java b/src/main/java/page/clab/api/domain/activity/activitygroup/domain/GroupMember.java
index 1942d91e2..c5c9de654 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/domain/GroupMember.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/domain/GroupMember.java
@@ -42,13 +42,14 @@ public class GroupMember extends BaseEntity {
@Enumerated(EnumType.STRING)
private GroupMemberStatus status;
- public static GroupMember create(String memberId, ActivityGroup activityGroup, ActivityGroupRole role, GroupMemberStatus status) {
+ public static GroupMember create(String memberId, ActivityGroup activityGroup, ActivityGroupRole role,
+ GroupMemberStatus status) {
return GroupMember.builder()
- .memberId(memberId)
- .activityGroup(activityGroup)
- .role(role)
- .status(status)
- .build();
+ .memberId(memberId)
+ .activityGroup(activityGroup)
+ .role(role)
+ .status(status)
+ .build();
}
public boolean isLeader() {
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/domain/GroupMemberId.java b/src/main/java/page/clab/api/domain/activity/activitygroup/domain/GroupMemberId.java
index b0e897162..5ca0ae4f8 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/domain/GroupMemberId.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/domain/GroupMemberId.java
@@ -1,13 +1,12 @@
package page.clab.api.domain.activity.activitygroup.domain;
import jakarta.persistence.Embeddable;
+import java.io.Serializable;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
-import java.io.Serializable;
-
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/domain/GroupSchedule.java b/src/main/java/page/clab/api/domain/activity/activitygroup/domain/GroupSchedule.java
index e4e4783f2..f8224dd2f 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/domain/GroupSchedule.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/domain/GroupSchedule.java
@@ -7,6 +7,7 @@
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
+import java.time.LocalDateTime;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
@@ -15,8 +16,6 @@
import lombok.Setter;
import page.clab.api.global.common.domain.BaseEntity;
-import java.time.LocalDateTime;
-
@Entity
@Getter
@Setter
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/domain/RedisQRKey.java b/src/main/java/page/clab/api/domain/activity/activitygroup/domain/RedisQRKey.java
index e525827c6..6f0add73a 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/domain/RedisQRKey.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/domain/RedisQRKey.java
@@ -24,7 +24,7 @@ public class RedisQRKey {
public static RedisQRKey create(String QRCodeKey) {
return RedisQRKey.builder()
- .QRCodeKey(QRCodeKey)
- .build();
+ .QRCodeKey(QRCodeKey)
+ .build();
}
}
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/mapper/ActivityGroupDtoMapper.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/mapper/ActivityGroupDtoMapper.java
index 1c683879b..46bc55cf0 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/mapper/ActivityGroupDtoMapper.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/mapper/ActivityGroupDtoMapper.java
@@ -1,5 +1,7 @@
package page.clab.api.domain.activity.activitygroup.dto.mapper;
+import java.time.LocalDateTime;
+import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
@@ -39,9 +41,6 @@
import page.clab.api.global.common.file.domain.UploadedFile;
import page.clab.api.global.common.file.dto.mapper.FileDtoMapper;
-import java.time.LocalDateTime;
-import java.util.List;
-
@Component
@RequiredArgsConstructor
public class ActivityGroupDtoMapper {
@@ -50,264 +49,271 @@ public class ActivityGroupDtoMapper {
public GroupSchedule fromDto(GroupScheduleDto groupScheduleDto, ActivityGroup activityGroup) {
return GroupSchedule.builder()
- .activityGroup(activityGroup)
- .schedule(groupScheduleDto.getSchedule())
- .content(groupScheduleDto.getContent())
- .build();
+ .activityGroup(activityGroup)
+ .schedule(groupScheduleDto.getSchedule())
+ .content(groupScheduleDto.getContent())
+ .build();
}
public Absent fromDto(AbsentRequestDto requestDto, Member absentee, ActivityGroup activityGroup) {
return Absent.builder()
- .memberId(absentee.getId())
- .activityGroup(activityGroup)
- .absentDate(requestDto.getAbsentDate())
- .reason(requestDto.getReason())
- .build();
+ .memberId(absentee.getId())
+ .activityGroup(activityGroup)
+ .absentDate(requestDto.getAbsentDate())
+ .reason(requestDto.getReason())
+ .build();
}
- public ActivityGroupBoard fromDto(ActivityGroupBoardRequestDto requestDto, Member member, ActivityGroup activityGroup, ActivityGroupBoard parentBoard, List uploadedFiles) {
+ public ActivityGroupBoard fromDto(ActivityGroupBoardRequestDto requestDto, Member member,
+ ActivityGroup activityGroup, ActivityGroupBoard parentBoard, List uploadedFiles) {
return ActivityGroupBoard.builder()
- .activityGroup(activityGroup)
- .memberId(member.getId())
- .category(requestDto.getCategory())
- .title(requestDto.getTitle())
- .content(requestDto.getContent())
- .parent(parentBoard)
- .uploadedFiles(uploadedFiles)
- .dueDateTime(requestDto.getDueDateTime())
- .isDeleted(false)
- .build();
+ .activityGroup(activityGroup)
+ .memberId(member.getId())
+ .category(requestDto.getCategory())
+ .title(requestDto.getTitle())
+ .content(requestDto.getContent())
+ .parent(parentBoard)
+ .uploadedFiles(uploadedFiles)
+ .dueDateTime(requestDto.getDueDateTime())
+ .isDeleted(false)
+ .build();
}
public ActivityGroupReport fromDto(ActivityGroupReportRequestDto requestDto, ActivityGroup activityGroup) {
return ActivityGroupReport.builder()
- .turn(requestDto.getTurn())
- .activityGroup(activityGroup)
- .title(requestDto.getTitle())
- .content(requestDto.getContent())
- .isDeleted(false)
- .build();
+ .turn(requestDto.getTurn())
+ .activityGroup(activityGroup)
+ .title(requestDto.getTitle())
+ .content(requestDto.getContent())
+ .isDeleted(false)
+ .build();
}
public ActivityGroup fromDto(ActivityGroupRequestDto requestDto) {
return ActivityGroup.builder()
- .category(requestDto.getCategory())
- .subject(requestDto.getSubject())
- .name(requestDto.getName())
- .content(requestDto.getContent())
- .status(ActivityGroupStatus.WAITING)
- .progress(0L)
- .imageUrl(requestDto.getImageUrl())
- .curriculum(requestDto.getCurriculum())
- .startDate(requestDto.getStartDate())
- .endDate(requestDto.getEndDate())
- .techStack(requestDto.getTechStack())
- .githubUrl(requestDto.getGithubUrl())
- .isDeleted(false)
- .build();
+ .category(requestDto.getCategory())
+ .subject(requestDto.getSubject())
+ .name(requestDto.getName())
+ .content(requestDto.getContent())
+ .status(ActivityGroupStatus.WAITING)
+ .progress(0L)
+ .imageUrl(requestDto.getImageUrl())
+ .curriculum(requestDto.getCurriculum())
+ .startDate(requestDto.getStartDate())
+ .endDate(requestDto.getEndDate())
+ .techStack(requestDto.getTechStack())
+ .githubUrl(requestDto.getGithubUrl())
+ .isDeleted(false)
+ .build();
}
public ApplyForm fromDto(ApplyFormRequestDto requestDto, ActivityGroup activityGroup, Member member) {
return ApplyForm.builder()
- .activityGroup(activityGroup)
- .memberId(member.getId())
- .applyReason(requestDto.getApplyReason())
- .build();
+ .activityGroup(activityGroup)
+ .memberId(member.getId())
+ .applyReason(requestDto.getApplyReason())
+ .build();
}
public GroupScheduleDto toDto(GroupSchedule groupSchedule) {
return GroupScheduleDto.builder()
- .schedule(groupSchedule.getSchedule())
- .content(groupSchedule.getContent())
- .build();
+ .schedule(groupSchedule.getSchedule())
+ .content(groupSchedule.getContent())
+ .build();
}
public AbsentResponseDto toDto(Absent absent, Member member) {
return AbsentResponseDto.builder()
- .absenteeId(member.getId())
- .absenteeName(member.getName())
- .activityGroupId(absent.getActivityGroup().getId())
- .activityGroupName(absent.getActivityGroup().getName())
- .reason(absent.getReason())
- .absentDate(absent.getAbsentDate())
- .build();
+ .absenteeId(member.getId())
+ .absenteeName(member.getName())
+ .activityGroupId(absent.getActivityGroup().getId())
+ .activityGroupName(absent.getActivityGroup().getName())
+ .reason(absent.getReason())
+ .absentDate(absent.getAbsentDate())
+ .build();
}
- public ActivityGroupDetailResponseDto toDto(ActivityGroup activityGroup, List boards, List groupMemberResponseDtos, boolean isOwner) {
+ public ActivityGroupDetailResponseDto toDto(ActivityGroup activityGroup, List boards,
+ List groupMemberResponseDtos, boolean isOwner) {
return ActivityGroupDetailResponseDto.builder()
- .id(activityGroup.getId())
- .category(activityGroup.getCategory())
- .subject(activityGroup.getSubject())
- .name(activityGroup.getName())
- .content(activityGroup.getContent())
- .status(activityGroup.getStatus())
- .progress(activityGroup.getProgress())
- .imageUrl(activityGroup.getImageUrl())
- .curriculum(activityGroup.getCurriculum())
- .groupMembers(groupMemberResponseDtos)
- .startDate(activityGroup.getStartDate())
- .endDate(activityGroup.getEndDate())
- .techStack(activityGroup.getTechStack())
- .githubUrl(activityGroup.getGithubUrl())
- .activityGroupBoards(boards)
- .isOwner(isOwner)
- .createdAt(activityGroup.getCreatedAt())
- .build();
+ .id(activityGroup.getId())
+ .category(activityGroup.getCategory())
+ .subject(activityGroup.getSubject())
+ .name(activityGroup.getName())
+ .content(activityGroup.getContent())
+ .status(activityGroup.getStatus())
+ .progress(activityGroup.getProgress())
+ .imageUrl(activityGroup.getImageUrl())
+ .curriculum(activityGroup.getCurriculum())
+ .groupMembers(groupMemberResponseDtos)
+ .startDate(activityGroup.getStartDate())
+ .endDate(activityGroup.getEndDate())
+ .techStack(activityGroup.getTechStack())
+ .githubUrl(activityGroup.getGithubUrl())
+ .activityGroupBoards(boards)
+ .isOwner(isOwner)
+ .createdAt(activityGroup.getCreatedAt())
+ .build();
}
- public ActivityGroupMemberWithApplyReasonResponseDto toDto(Member member, GroupMember groupMember, String applyReason) {
+ public ActivityGroupMemberWithApplyReasonResponseDto toDto(Member member, GroupMember groupMember,
+ String applyReason) {
return ActivityGroupMemberWithApplyReasonResponseDto.builder()
- .memberId(member.getId())
- .memberName(member.getName())
- .role(groupMember.getRole().toString())
- .status(groupMember.getStatus())
- .applyReason(applyReason)
- .build();
+ .memberId(member.getId())
+ .memberName(member.getName())
+ .role(groupMember.getRole().toString())
+ .status(groupMember.getStatus())
+ .applyReason(applyReason)
+ .build();
}
public ActivityGroupReportResponseDto toDto(ActivityGroupReport report) {
return ActivityGroupReportResponseDto.builder()
- .activityGroupId(report.getActivityGroup().getId())
- .activityGroupName(report.getActivityGroup().getName())
- .turn(report.getTurn())
- .title(report.getTitle())
- .content(report.getContent())
- .createdAt(report.getCreatedAt())
- .updatedAt(report.getUpdatedAt())
- .build();
+ .activityGroupId(report.getActivityGroup().getId())
+ .activityGroupName(report.getActivityGroup().getName())
+ .turn(report.getTurn())
+ .title(report.getTitle())
+ .content(report.getContent())
+ .createdAt(report.getCreatedAt())
+ .updatedAt(report.getUpdatedAt())
+ .build();
}
public ActivityGroupResponseDto toDto(ActivityGroup activityGroup) {
return ActivityGroupResponseDto.builder()
- .id(activityGroup.getId())
- .name(activityGroup.getName())
- .category(activityGroup.getCategory())
- .subject(activityGroup.getSubject())
- .status(activityGroup.getStatus())
- .imageUrl(activityGroup.getImageUrl())
- .createdAt(activityGroup.getCreatedAt())
- .build();
+ .id(activityGroup.getId())
+ .name(activityGroup.getName())
+ .category(activityGroup.getCategory())
+ .subject(activityGroup.getSubject())
+ .status(activityGroup.getStatus())
+ .imageUrl(activityGroup.getImageUrl())
+ .createdAt(activityGroup.getCreatedAt())
+ .build();
}
- public ActivityGroupStatusResponseDto toDto(ActivityGroup activityGroup, List leader, Long participantCount, Long weeklyActivityCount) {
+ public ActivityGroupStatusResponseDto toDto(ActivityGroup activityGroup, List leader,
+ Long participantCount, Long weeklyActivityCount) {
return ActivityGroupStatusResponseDto.builder()
- .id(activityGroup.getId())
- .name(activityGroup.getName())
- .content(activityGroup.getContent())
- .category(activityGroup.getCategory())
- .subject(activityGroup.getSubject())
- .imageUrl(activityGroup.getImageUrl())
- .leaders(CollectionUtils.isEmpty(leader) ? null : leader)
- .participantCount(participantCount)
- .weeklyActivityCount(weeklyActivityCount)
- .createdAt(activityGroup.getCreatedAt())
- .build();
+ .id(activityGroup.getId())
+ .name(activityGroup.getName())
+ .content(activityGroup.getContent())
+ .category(activityGroup.getCategory())
+ .subject(activityGroup.getSubject())
+ .imageUrl(activityGroup.getImageUrl())
+ .leaders(CollectionUtils.isEmpty(leader) ? null : leader)
+ .participantCount(participantCount)
+ .weeklyActivityCount(weeklyActivityCount)
+ .createdAt(activityGroup.getCreatedAt())
+ .build();
}
public AttendanceResponseDto toDto(Attendance attendance) {
return AttendanceResponseDto.builder()
- .activityGroupId(attendance.getActivityGroup().getId())
- .memberId(attendance.getMemberId())
- .attendanceDateTime(attendance.getCreatedAt())
- .build();
+ .activityGroupId(attendance.getActivityGroup().getId())
+ .memberId(attendance.getMemberId())
+ .attendanceDateTime(attendance.getCreatedAt())
+ .build();
}
public GroupMemberResponseDto toDto(Member member, GroupMember groupMember) {
return GroupMemberResponseDto.builder()
- .memberId(member.getId())
- .memberName(member.getName())
- .role(groupMember.getRole().getKey())
- .status(groupMember.getStatus())
- .build();
+ .memberId(member.getId())
+ .memberName(member.getName())
+ .role(groupMember.getRole().getKey())
+ .status(groupMember.getStatus())
+ .build();
}
- public ActivityGroupBoardChildResponseDto toChildDto(ActivityGroupBoard board, MemberBasicInfoDto memberBasicInfoDto, List childrenDtos) {
+ public ActivityGroupBoardChildResponseDto toChildDto(ActivityGroupBoard board,
+ MemberBasicInfoDto memberBasicInfoDto, List childrenDtos) {
return ActivityGroupBoardChildResponseDto.builder()
- .id(board.getId())
- .memberId(memberBasicInfoDto.getMemberId())
- .memberName(memberBasicInfoDto.getMemberName())
- .category(board.getCategory())
- .title(board.getTitle())
- .content(board.getContent())
- .dueDateTime(board.getDueDateTime())
- .updatedAt(board.getUpdatedAt())
- .createdAt(board.getCreatedAt())
- .files(mapper.toDto(board.getUploadedFiles()))
- .children(childrenDtos)
- .build();
+ .id(board.getId())
+ .memberId(memberBasicInfoDto.getMemberId())
+ .memberName(memberBasicInfoDto.getMemberName())
+ .category(board.getCategory())
+ .title(board.getTitle())
+ .content(board.getContent())
+ .dueDateTime(board.getDueDateTime())
+ .updatedAt(board.getUpdatedAt())
+ .createdAt(board.getCreatedAt())
+ .files(mapper.toDto(board.getUploadedFiles()))
+ .children(childrenDtos)
+ .build();
}
- public AssignmentSubmissionWithFeedbackResponseDto toAssignmentDto(ActivityGroupBoard board, MemberBasicInfoDto memberBasicInfo, List feedbackDtos) {
+ public AssignmentSubmissionWithFeedbackResponseDto toAssignmentDto(ActivityGroupBoard board,
+ MemberBasicInfoDto memberBasicInfo, List feedbackDtos) {
return AssignmentSubmissionWithFeedbackResponseDto.builder()
- .id(board.getId())
- .memberId(memberBasicInfo.getMemberId())
- .memberName(memberBasicInfo.getMemberName())
- .parentId(board.getParent() != null ? board.getParent().getId() : null)
- .content(board.getContent())
- .files(mapper.toDto(board.getUploadedFiles()))
- .createdAt(board.getCreatedAt())
- .updatedAt(board.getUpdatedAt())
- .feedbacks(feedbackDtos)
- .build();
+ .id(board.getId())
+ .memberId(memberBasicInfo.getMemberId())
+ .memberName(memberBasicInfo.getMemberName())
+ .parentId(board.getParent() != null ? board.getParent().getId() : null)
+ .content(board.getContent())
+ .files(mapper.toDto(board.getUploadedFiles()))
+ .createdAt(board.getCreatedAt())
+ .updatedAt(board.getUpdatedAt())
+ .feedbacks(feedbackDtos)
+ .build();
}
public ActivityGroupBoardResponseDto toBoardDto(ActivityGroupBoard board, MemberBasicInfoDto memberBasicInfoDto) {
return ActivityGroupBoardResponseDto.builder()
- .id(board.getId())
- .memberId(memberBasicInfoDto.getMemberId())
- .memberName(memberBasicInfoDto.getMemberName())
- .parentId(board.getParent() != null ? board.getParent().getId() : null)
- .category(board.getCategory())
- .title(board.getTitle())
- .content(board.getContent())
- .files(mapper.toDto(board.getUploadedFiles()))
- .dueDateTime(board.getDueDateTime())
- .createdAt(board.getCreatedAt())
- .updatedAt(board.getUpdatedAt())
- .build();
+ .id(board.getId())
+ .memberId(memberBasicInfoDto.getMemberId())
+ .memberName(memberBasicInfoDto.getMemberName())
+ .parentId(board.getParent() != null ? board.getParent().getId() : null)
+ .category(board.getCategory())
+ .title(board.getTitle())
+ .content(board.getContent())
+ .files(mapper.toDto(board.getUploadedFiles()))
+ .dueDateTime(board.getDueDateTime())
+ .createdAt(board.getCreatedAt())
+ .updatedAt(board.getUpdatedAt())
+ .build();
}
public FeedbackResponseDto toFeedbackDto(ActivityGroupBoard board, MemberBasicInfoDto memberBasicInfo) {
return FeedbackResponseDto.builder()
- .id(board.getId())
- .memberId(memberBasicInfo.getMemberId())
- .memberName(memberBasicInfo.getMemberName())
- .content(board.getContent())
- .files(mapper.toDto(board.getUploadedFiles()))
- .createdAt(board.getCreatedAt())
- .updatedAt(board.getUpdatedAt())
- .build();
+ .id(board.getId())
+ .memberId(memberBasicInfo.getMemberId())
+ .memberName(memberBasicInfo.getMemberName())
+ .content(board.getContent())
+ .files(mapper.toDto(board.getUploadedFiles()))
+ .createdAt(board.getCreatedAt())
+ .updatedAt(board.getUpdatedAt())
+ .build();
}
- public ActivityGroupDetails of(ActivityGroup activityGroup, List groupMembers, List activityGroupBoards) {
+ public ActivityGroupDetails of(ActivityGroup activityGroup, List groupMembers,
+ List activityGroupBoards) {
return ActivityGroupDetails.builder()
- .activityGroup(activityGroup)
- .groupMembers(groupMembers)
- .activityGroupBoards(activityGroupBoards)
- .build();
+ .activityGroup(activityGroup)
+ .groupMembers(groupMembers)
+ .activityGroupBoards(activityGroupBoards)
+ .build();
}
public ActivityGroupBoardStatusUpdatedResponseDto of(Long groupId, ActivityGroupStatus activityGroupStatus) {
return ActivityGroupBoardStatusUpdatedResponseDto.builder()
- .id(groupId)
- .activityGroupStatus(activityGroupStatus)
- .build();
+ .id(groupId)
+ .activityGroupStatus(activityGroupStatus)
+ .build();
}
public ActivityGroupBoardReferenceDto of(Long id, Long groupId, Long parentId) {
return ActivityGroupBoardReferenceDto.builder()
- .id(id)
- .groupId(groupId)
- .parentId(parentId)
- .build();
+ .id(id)
+ .groupId(groupId)
+ .parentId(parentId)
+ .build();
}
public LeaderInfo create(Member leader, LocalDateTime createdAt) {
return LeaderInfo.builder()
- .id(leader.getId())
- .name(leader.getName())
- .createdAt(createdAt)
- .build();
+ .id(leader.getId())
+ .name(leader.getName())
+ .createdAt(createdAt)
+ .build();
}
}
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/param/ActivityGroupDetails.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/param/ActivityGroupDetails.java
index a50eed5a6..4feb72017 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/param/ActivityGroupDetails.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/param/ActivityGroupDetails.java
@@ -1,13 +1,12 @@
package page.clab.api.domain.activity.activitygroup.dto.param;
+import java.util.List;
import lombok.Builder;
import lombok.Getter;
import page.clab.api.domain.activity.activitygroup.domain.ActivityGroup;
import page.clab.api.domain.activity.activitygroup.domain.ActivityGroupBoard;
import page.clab.api.domain.activity.activitygroup.domain.GroupMember;
-import java.util.List;
-
@Getter
@Builder
public class ActivityGroupDetails {
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/param/GroupScheduleDto.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/param/GroupScheduleDto.java
index f0c9b41f1..0d153c65f 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/param/GroupScheduleDto.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/param/GroupScheduleDto.java
@@ -1,11 +1,10 @@
package page.clab.api.domain.activity.activitygroup.dto.param;
+import java.time.LocalDateTime;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
-import java.time.LocalDateTime;
-
@Getter
@Setter
@Builder
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/request/AbsentRequestDto.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/request/AbsentRequestDto.java
index 933766213..f855737a9 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/request/AbsentRequestDto.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/request/AbsentRequestDto.java
@@ -2,11 +2,10 @@
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
+import java.time.LocalDate;
import lombok.Getter;
import lombok.Setter;
-import java.time.LocalDate;
-
@Getter
@Setter
public class AbsentRequestDto {
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/request/ActivityGroupBoardRequestDto.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/request/ActivityGroupBoardRequestDto.java
index fc7098303..2cbc6e105 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/request/ActivityGroupBoardRequestDto.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/request/ActivityGroupBoardRequestDto.java
@@ -2,13 +2,12 @@
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
+import java.time.LocalDateTime;
+import java.util.List;
import lombok.Getter;
import lombok.Setter;
import page.clab.api.domain.activity.activitygroup.domain.ActivityGroupBoardCategory;
-import java.time.LocalDateTime;
-import java.util.List;
-
@Getter
@Setter
public class ActivityGroupBoardRequestDto {
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/request/ActivityGroupBoardUpdateRequestDto.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/request/ActivityGroupBoardUpdateRequestDto.java
index fb4974037..64851bb73 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/request/ActivityGroupBoardUpdateRequestDto.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/request/ActivityGroupBoardUpdateRequestDto.java
@@ -1,11 +1,10 @@
package page.clab.api.domain.activity.activitygroup.dto.request;
import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Getter;
-import lombok.Setter;
-
import java.time.LocalDateTime;
import java.util.List;
+import lombok.Getter;
+import lombok.Setter;
@Getter
@Setter
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/request/ActivityGroupRequestDto.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/request/ActivityGroupRequestDto.java
index 93c4934ab..73254ece9 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/request/ActivityGroupRequestDto.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/request/ActivityGroupRequestDto.java
@@ -2,12 +2,11 @@
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
+import java.time.LocalDate;
import lombok.Getter;
import lombok.Setter;
import page.clab.api.domain.activity.activitygroup.domain.ActivityGroupCategory;
-import java.time.LocalDate;
-
@Getter
@Setter
public class ActivityGroupRequestDto {
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/request/ActivityGroupUpdateRequestDto.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/request/ActivityGroupUpdateRequestDto.java
index d552ebddb..8c4ae3399 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/request/ActivityGroupUpdateRequestDto.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/request/ActivityGroupUpdateRequestDto.java
@@ -1,12 +1,11 @@
package page.clab.api.domain.activity.activitygroup.dto.request;
import io.swagger.v3.oas.annotations.media.Schema;
+import java.time.LocalDate;
import lombok.Getter;
import lombok.Setter;
import page.clab.api.domain.activity.activitygroup.domain.ActivityGroupCategory;
-import java.time.LocalDate;
-
@Getter
@Setter
public class ActivityGroupUpdateRequestDto {
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/AbsentResponseDto.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/AbsentResponseDto.java
index 522a660a8..445b5f3a1 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/AbsentResponseDto.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/AbsentResponseDto.java
@@ -1,10 +1,9 @@
package page.clab.api.domain.activity.activitygroup.dto.response;
+import java.time.LocalDate;
import lombok.Builder;
import lombok.Getter;
-import java.time.LocalDate;
-
@Getter
@Builder
public class AbsentResponseDto {
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/ActivityGroupBoardChildResponseDto.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/ActivityGroupBoardChildResponseDto.java
index f817f6fc6..735596571 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/ActivityGroupBoardChildResponseDto.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/ActivityGroupBoardChildResponseDto.java
@@ -1,13 +1,12 @@
package page.clab.api.domain.activity.activitygroup.dto.response;
+import java.time.LocalDateTime;
+import java.util.List;
import lombok.Builder;
import lombok.Getter;
import page.clab.api.domain.activity.activitygroup.domain.ActivityGroupBoardCategory;
import page.clab.api.global.common.file.dto.response.UploadedFileResponseDto;
-import java.time.LocalDateTime;
-import java.util.List;
-
@Getter
@Builder
public class ActivityGroupBoardChildResponseDto {
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/ActivityGroupBoardResponseDto.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/ActivityGroupBoardResponseDto.java
index b39f8721e..4a8f9a930 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/ActivityGroupBoardResponseDto.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/ActivityGroupBoardResponseDto.java
@@ -1,13 +1,12 @@
package page.clab.api.domain.activity.activitygroup.dto.response;
+import java.time.LocalDateTime;
+import java.util.List;
import lombok.Builder;
import lombok.Getter;
import page.clab.api.domain.activity.activitygroup.domain.ActivityGroupBoardCategory;
import page.clab.api.global.common.file.dto.response.UploadedFileResponseDto;
-import java.time.LocalDateTime;
-import java.util.List;
-
@Getter
@Builder
public class ActivityGroupBoardResponseDto {
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/ActivityGroupReportResponseDto.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/ActivityGroupReportResponseDto.java
index 3e06ff955..cb024e9dc 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/ActivityGroupReportResponseDto.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/ActivityGroupReportResponseDto.java
@@ -1,10 +1,9 @@
package page.clab.api.domain.activity.activitygroup.dto.response;
+import java.time.LocalDateTime;
import lombok.Builder;
import lombok.Getter;
-import java.time.LocalDateTime;
-
@Getter
@Builder
public class ActivityGroupReportResponseDto {
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/ActivityGroupResponseDto.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/ActivityGroupResponseDto.java
index 2709c70f7..1b48bb71d 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/ActivityGroupResponseDto.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/ActivityGroupResponseDto.java
@@ -1,12 +1,11 @@
package page.clab.api.domain.activity.activitygroup.dto.response;
+import java.time.LocalDateTime;
import lombok.Builder;
import lombok.Getter;
import page.clab.api.domain.activity.activitygroup.domain.ActivityGroupCategory;
import page.clab.api.domain.activity.activitygroup.domain.ActivityGroupStatus;
-import java.time.LocalDateTime;
-
@Getter
@Builder
public class ActivityGroupResponseDto {
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/ActivityGroupStatusResponseDto.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/ActivityGroupStatusResponseDto.java
index 9033fa48c..d538de592 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/ActivityGroupStatusResponseDto.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/ActivityGroupStatusResponseDto.java
@@ -1,12 +1,11 @@
package page.clab.api.domain.activity.activitygroup.dto.response;
+import java.time.LocalDateTime;
+import java.util.List;
import lombok.Builder;
import lombok.Getter;
import page.clab.api.domain.activity.activitygroup.domain.ActivityGroupCategory;
-import java.time.LocalDateTime;
-import java.util.List;
-
@Getter
@Builder
public class ActivityGroupStatusResponseDto {
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/AssignmentSubmissionWithFeedbackResponseDto.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/AssignmentSubmissionWithFeedbackResponseDto.java
index a03991ba3..af98df474 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/AssignmentSubmissionWithFeedbackResponseDto.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/AssignmentSubmissionWithFeedbackResponseDto.java
@@ -1,12 +1,11 @@
package page.clab.api.domain.activity.activitygroup.dto.response;
+import java.time.LocalDateTime;
+import java.util.List;
import lombok.Builder;
import lombok.Getter;
import page.clab.api.global.common.file.dto.response.UploadedFileResponseDto;
-import java.time.LocalDateTime;
-import java.util.List;
-
@Getter
@Builder
public class AssignmentSubmissionWithFeedbackResponseDto {
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/AttendanceResponseDto.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/AttendanceResponseDto.java
index 01e43dbb6..2e932c36a 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/AttendanceResponseDto.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/AttendanceResponseDto.java
@@ -1,10 +1,9 @@
package page.clab.api.domain.activity.activitygroup.dto.response;
+import java.time.LocalDateTime;
import lombok.Builder;
import lombok.Getter;
-import java.time.LocalDateTime;
-
@Getter
@Builder
public class AttendanceResponseDto {
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/FeedbackResponseDto.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/FeedbackResponseDto.java
index 7da6e03fc..7426867b0 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/FeedbackResponseDto.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/FeedbackResponseDto.java
@@ -1,12 +1,11 @@
package page.clab.api.domain.activity.activitygroup.dto.response;
+import java.time.LocalDateTime;
+import java.util.List;
import lombok.Builder;
import lombok.Getter;
import page.clab.api.global.common.file.dto.response.UploadedFileResponseDto;
-import java.time.LocalDateTime;
-import java.util.List;
-
@Getter
@Builder
public class FeedbackResponseDto {
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/LeaderInfo.java b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/LeaderInfo.java
index b96f293a8..2322e5d60 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/LeaderInfo.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/dto/response/LeaderInfo.java
@@ -1,11 +1,10 @@
package page.clab.api.domain.activity.activitygroup.dto.response;
import com.fasterxml.jackson.annotation.JsonIgnore;
+import java.time.LocalDateTime;
import lombok.Builder;
import lombok.Getter;
-import java.time.LocalDateTime;
-
@Getter
@Builder
public class LeaderInfo {
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/exception/AlreadySubmittedThisWeekAssignmentException.java b/src/main/java/page/clab/api/domain/activity/activitygroup/exception/AlreadySubmittedThisWeekAssignmentException.java
index f7633884f..662fe16fb 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/exception/AlreadySubmittedThisWeekAssignmentException.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/exception/AlreadySubmittedThisWeekAssignmentException.java
@@ -1,6 +1,6 @@
package page.clab.api.domain.activity.activitygroup.exception;
-public class AlreadySubmittedThisWeekAssignmentException extends RuntimeException{
+public class AlreadySubmittedThisWeekAssignmentException extends RuntimeException {
private static final String DEFAULT_MESSAGE = "해당 주차의 과제물이 이미 제출되었습니다.";
diff --git a/src/main/java/page/clab/api/domain/activity/activitygroup/exception/SingleLeaderModificationException.java b/src/main/java/page/clab/api/domain/activity/activitygroup/exception/SingleLeaderModificationException.java
index e1282a61f..1285d9a00 100644
--- a/src/main/java/page/clab/api/domain/activity/activitygroup/exception/SingleLeaderModificationException.java
+++ b/src/main/java/page/clab/api/domain/activity/activitygroup/exception/SingleLeaderModificationException.java
@@ -1,6 +1,6 @@
package page.clab.api.domain.activity.activitygroup.exception;
-public class SingleLeaderModificationException extends RuntimeException{
+public class SingleLeaderModificationException extends RuntimeException {
public SingleLeaderModificationException(String message) {
super(message);
diff --git a/src/main/java/page/clab/api/domain/activity/review/adapter/in/web/DeletedReviewsRetrievalController.java b/src/main/java/page/clab/api/domain/activity/review/adapter/in/web/DeletedReviewsRetrievalController.java
index f6ba67534..683314bf1 100644
--- a/src/main/java/page/clab/api/domain/activity/review/adapter/in/web/DeletedReviewsRetrievalController.java
+++ b/src/main/java/page/clab/api/domain/activity/review/adapter/in/web/DeletedReviewsRetrievalController.java
@@ -27,8 +27,8 @@ public class DeletedReviewsRetrievalController {
@PreAuthorize("hasRole('SUPER')")
@GetMapping("/deleted")
public ApiResponse> retrieveDeletedReviews(
- @RequestParam(name = "page", defaultValue = "0") int page,
- @RequestParam(name = "size", defaultValue = "20") int size
+ @RequestParam(name = "page", defaultValue = "0") int page,
+ @RequestParam(name = "size", defaultValue = "20") int size
) {
Pageable pageable = PageRequest.of(page, size);
PagedResponseDto reviews = retrieveDeletedReviewsUseCase.retrieveDeletedReviews(pageable);
diff --git a/src/main/java/page/clab/api/domain/activity/review/adapter/in/web/MyReviewsRetrievalController.java b/src/main/java/page/clab/api/domain/activity/review/adapter/in/web/MyReviewsRetrievalController.java
index dff6e1b7b..588d52d1c 100644
--- a/src/main/java/page/clab/api/domain/activity/review/adapter/in/web/MyReviewsRetrievalController.java
+++ b/src/main/java/page/clab/api/domain/activity/review/adapter/in/web/MyReviewsRetrievalController.java
@@ -2,6 +2,7 @@
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
+import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Pageable;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -17,8 +18,6 @@
import page.clab.api.global.exception.SortingArgumentException;
import page.clab.api.global.util.PageableUtils;
-import java.util.List;
-
@RestController
@RequestMapping("/api/v1/reviews")
@RequiredArgsConstructor
@@ -29,14 +28,14 @@ public class MyReviewsRetrievalController {
private final PageableUtils pageableUtils;
@Operation(summary = "[G] 나의 리뷰 목록", description = "ROLE_GUEST 이상의 권한이 필요함
" +
- "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
+ "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
@PreAuthorize("hasRole('GUEST')")
@GetMapping("/my")
public ApiResponse> retrieveMyReviews(
- @RequestParam(name = "page", defaultValue = "0") int page,
- @RequestParam(name = "size", defaultValue = "20") int size,
- @RequestParam(name = "sortBy", defaultValue = "createdAt") List sortBy,
- @RequestParam(name = "sortDirection", defaultValue = "desc") List sortDirection
+ @RequestParam(name = "page", defaultValue = "0") int page,
+ @RequestParam(name = "size", defaultValue = "20") int size,
+ @RequestParam(name = "sortBy", defaultValue = "createdAt") List sortBy,
+ @RequestParam(name = "sortDirection", defaultValue = "desc") List sortDirection
) throws SortingArgumentException, InvalidColumnException {
Pageable pageable = pageableUtils.createPageable(page, size, sortBy, sortDirection, ReviewResponseDto.class);
PagedResponseDto myReviews = retrieveMyReviewsUseCase.retrieveMyReviews(pageable);
diff --git a/src/main/java/page/clab/api/domain/activity/review/adapter/in/web/ReviewRegisterController.java b/src/main/java/page/clab/api/domain/activity/review/adapter/in/web/ReviewRegisterController.java
index 9a025fdec..45340f87e 100644
--- a/src/main/java/page/clab/api/domain/activity/review/adapter/in/web/ReviewRegisterController.java
+++ b/src/main/java/page/clab/api/domain/activity/review/adapter/in/web/ReviewRegisterController.java
@@ -25,7 +25,7 @@ public class ReviewRegisterController {
@PreAuthorize("hasRole('USER')")
@PostMapping("")
public ApiResponse registerReview(
- @Valid @RequestBody ReviewRequestDto requestDto
+ @Valid @RequestBody ReviewRequestDto requestDto
) {
Long id = registerReviewUseCase.registerReview(requestDto);
return ApiResponse.success(id);
diff --git a/src/main/java/page/clab/api/domain/activity/review/adapter/in/web/ReviewRemoveController.java b/src/main/java/page/clab/api/domain/activity/review/adapter/in/web/ReviewRemoveController.java
index 44fb9e135..974b0d83f 100644
--- a/src/main/java/page/clab/api/domain/activity/review/adapter/in/web/ReviewRemoveController.java
+++ b/src/main/java/page/clab/api/domain/activity/review/adapter/in/web/ReviewRemoveController.java
@@ -24,7 +24,7 @@ public class ReviewRemoveController {
@PreAuthorize("hasRole('USER')")
@DeleteMapping("/{reviewId}")
public ApiResponse removeReview(
- @PathVariable(name = "reviewId") Long reviewId
+ @PathVariable(name = "reviewId") Long reviewId
) throws PermissionDeniedException {
Long id = removeReviewUseCase.removeReview(reviewId);
return ApiResponse.success(id);
diff --git a/src/main/java/page/clab/api/domain/activity/review/adapter/in/web/ReviewUpdateController.java b/src/main/java/page/clab/api/domain/activity/review/adapter/in/web/ReviewUpdateController.java
index 27d4ac32b..32ed2d8ac 100644
--- a/src/main/java/page/clab/api/domain/activity/review/adapter/in/web/ReviewUpdateController.java
+++ b/src/main/java/page/clab/api/domain/activity/review/adapter/in/web/ReviewUpdateController.java
@@ -27,8 +27,8 @@ public class ReviewUpdateController {
@PreAuthorize("hasRole('USER')")
@PatchMapping("/{reviewId}")
public ApiResponse updateReview(
- @PathVariable(name = "reviewId") Long reviewId,
- @Valid @RequestBody ReviewUpdateRequestDto requestDto
+ @PathVariable(name = "reviewId") Long reviewId,
+ @Valid @RequestBody ReviewUpdateRequestDto requestDto
) throws PermissionDeniedException {
Long id = updateReviewUseCase.updateReview(reviewId, requestDto);
return ApiResponse.success(id);
diff --git a/src/main/java/page/clab/api/domain/activity/review/adapter/in/web/ReviewsByConditionsRetrievalController.java b/src/main/java/page/clab/api/domain/activity/review/adapter/in/web/ReviewsByConditionsRetrievalController.java
index 266985e88..7d5d3ca70 100644
--- a/src/main/java/page/clab/api/domain/activity/review/adapter/in/web/ReviewsByConditionsRetrievalController.java
+++ b/src/main/java/page/clab/api/domain/activity/review/adapter/in/web/ReviewsByConditionsRetrievalController.java
@@ -2,6 +2,7 @@
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
+import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Pageable;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -17,8 +18,6 @@
import page.clab.api.global.exception.SortingArgumentException;
import page.clab.api.global.util.PageableUtils;
-import java.util.List;
-
@RestController
@RequestMapping("/api/v1/reviews")
@RequiredArgsConstructor
@@ -29,23 +28,24 @@ public class ReviewsByConditionsRetrievalController {
private final PageableUtils pageableUtils;
@Operation(summary = "[U] 리뷰 목록 조회(멤버 ID, 멤버 이름, 활동 ID, 공개 여부 기준)", description = "ROLE_USER 이상의 권한이 필요함
" +
- "4개의 파라미터를 자유롭게 조합하여 필터링 가능
" +
- "멤버 ID, 멤버 이름, 활동 ID, 공개 여부 중 하나라도 입력하지 않으면 전체 조회됨
" +
- "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
+ "4개의 파라미터를 자유롭게 조합하여 필터링 가능
" +
+ "멤버 ID, 멤버 이름, 활동 ID, 공개 여부 중 하나라도 입력하지 않으면 전체 조회됨
" +
+ "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
@PreAuthorize("hasRole('USER')")
@GetMapping("")
public ApiResponse> retrieveReviewsByConditions(
- @RequestParam(name = "memberId", required = false) String memberId,
- @RequestParam(name = "memberName", required = false) String memberName,
- @RequestParam(name = "activityId", required = false) Long activityId,
- @RequestParam(name = "isPublic", required = false) Boolean isPublic,
- @RequestParam(name = "page", defaultValue = "0") int page,
- @RequestParam(name = "size", defaultValue = "20") int size,
- @RequestParam(name = "sortBy", defaultValue = "createdAt") List sortBy,
- @RequestParam(name = "sortDirection", defaultValue = "desc") List sortDirection
+ @RequestParam(name = "memberId", required = false) String memberId,
+ @RequestParam(name = "memberName", required = false) String memberName,
+ @RequestParam(name = "activityId", required = false) Long activityId,
+ @RequestParam(name = "isPublic", required = false) Boolean isPublic,
+ @RequestParam(name = "page", defaultValue = "0") int page,
+ @RequestParam(name = "size", defaultValue = "20") int size,
+ @RequestParam(name = "sortBy", defaultValue = "createdAt") List sortBy,
+ @RequestParam(name = "sortDirection", defaultValue = "desc") List sortDirection
) throws SortingArgumentException, InvalidColumnException {
Pageable pageable = pageableUtils.createPageable(page, size, sortBy, sortDirection, ReviewResponseDto.class);
- PagedResponseDto reviews = retrieveReviewsByConditionsUseCase.retrieveReviews(memberId, memberName, activityId, isPublic, pageable);
+ PagedResponseDto reviews = retrieveReviewsByConditionsUseCase.retrieveReviews(memberId,
+ memberName, activityId, isPublic, pageable);
return ApiResponse.success(reviews);
}
}
diff --git a/src/main/java/page/clab/api/domain/activity/review/adapter/out/persistence/ReviewPersistenceAdapter.java b/src/main/java/page/clab/api/domain/activity/review/adapter/out/persistence/ReviewPersistenceAdapter.java
index f55547f76..2cdd7d62b 100644
--- a/src/main/java/page/clab/api/domain/activity/review/adapter/out/persistence/ReviewPersistenceAdapter.java
+++ b/src/main/java/page/clab/api/domain/activity/review/adapter/out/persistence/ReviewPersistenceAdapter.java
@@ -13,8 +13,8 @@
@Component
@RequiredArgsConstructor
public class ReviewPersistenceAdapter implements
- RegisterReviewPort,
- RetrieveReviewPort {
+ RegisterReviewPort,
+ RetrieveReviewPort {
private final ReviewRepository repository;
private final ReviewMapper mapper;
@@ -29,20 +29,20 @@ public Review save(Review review) {
@Override
public Review getById(Long reviewId) {
return repository.findById(reviewId)
- .map(mapper::toDomain)
- .orElseThrow(() -> new NotFoundException("[Review] id: " + reviewId + "에 해당하는 리뷰가 존재하지 않습니다."));
+ .map(mapper::toDomain)
+ .orElseThrow(() -> new NotFoundException("[Review] id: " + reviewId + "에 해당하는 리뷰가 존재하지 않습니다."));
}
@Override
public Page findAllByIsDeletedTrue(Pageable pageable) {
return repository.findAllByIsDeletedTrue(pageable)
- .map(mapper::toDomain);
+ .map(mapper::toDomain);
}
@Override
public Page findAllByMemberId(String memberId, Pageable pageable) {
return repository.findAllByMemberId(memberId, pageable)
- .map(mapper::toDomain);
+ .map(mapper::toDomain);
}
@Override
@@ -51,8 +51,9 @@ public boolean existsByMemberIdAndActivityGroup(String memberId, ActivityGroup a
}
@Override
- public Page findByConditions(String memberId, String memberName, Long activityId, Boolean isPublic, Pageable pageable) {
+ public Page findByConditions(String memberId, String memberName, Long activityId, Boolean isPublic,
+ Pageable pageable) {
return repository.findByConditions(memberId, memberName, activityId, isPublic, pageable)
- .map(mapper::toDomain);
+ .map(mapper::toDomain);
}
}
diff --git a/src/main/java/page/clab/api/domain/activity/review/adapter/out/persistence/ReviewRepository.java b/src/main/java/page/clab/api/domain/activity/review/adapter/out/persistence/ReviewRepository.java
index a2265d63e..5589b6cdb 100644
--- a/src/main/java/page/clab/api/domain/activity/review/adapter/out/persistence/ReviewRepository.java
+++ b/src/main/java/page/clab/api/domain/activity/review/adapter/out/persistence/ReviewRepository.java
@@ -8,7 +8,8 @@
import page.clab.api.domain.activity.activitygroup.domain.ActivityGroup;
import page.clab.api.domain.activity.review.domain.Review;
-public interface ReviewRepository extends JpaRepository, ReviewRepositoryCustom, QuerydslPredicateExecutor {
+public interface ReviewRepository extends JpaRepository, ReviewRepositoryCustom,
+ QuerydslPredicateExecutor {
boolean existsByMemberIdAndActivityGroup(String memberId, ActivityGroup activityGroup);
diff --git a/src/main/java/page/clab/api/domain/activity/review/adapter/out/persistence/ReviewRepositoryCustom.java b/src/main/java/page/clab/api/domain/activity/review/adapter/out/persistence/ReviewRepositoryCustom.java
index 1a8652a75..267913cc0 100644
--- a/src/main/java/page/clab/api/domain/activity/review/adapter/out/persistence/ReviewRepositoryCustom.java
+++ b/src/main/java/page/clab/api/domain/activity/review/adapter/out/persistence/ReviewRepositoryCustom.java
@@ -4,5 +4,7 @@
import org.springframework.data.domain.Pageable;
public interface ReviewRepositoryCustom {
- Page findByConditions(String memberId, String memberName, Long activityId, Boolean isPublic, Pageable pageable);
+
+ Page findByConditions(String memberId, String memberName, Long activityId, Boolean isPublic,
+ Pageable pageable);
}
diff --git a/src/main/java/page/clab/api/domain/activity/review/adapter/out/persistence/ReviewRepositoryImpl.java b/src/main/java/page/clab/api/domain/activity/review/adapter/out/persistence/ReviewRepositoryImpl.java
index 043ddec86..7fb8c0d48 100644
--- a/src/main/java/page/clab/api/domain/activity/review/adapter/out/persistence/ReviewRepositoryImpl.java
+++ b/src/main/java/page/clab/api/domain/activity/review/adapter/out/persistence/ReviewRepositoryImpl.java
@@ -3,6 +3,7 @@
import com.querydsl.core.BooleanBuilder;
import com.querydsl.jpa.JPAExpressions;
import com.querydsl.jpa.impl.JPAQueryFactory;
+import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
@@ -11,8 +12,6 @@
import page.clab.api.domain.memberManagement.member.adapter.out.persistence.QMemberJpaEntity;
import page.clab.api.global.util.OrderSpecifierUtil;
-import java.util.List;
-
@Repository
@RequiredArgsConstructor
public class ReviewRepositoryImpl implements ReviewRepositoryCustom {
@@ -20,31 +19,38 @@ public class ReviewRepositoryImpl implements ReviewRepositoryCustom {
private final JPAQueryFactory queryFactory;
@Override
- public Page findByConditions(String memberId, String memberName, Long activityId, Boolean isPublic, Pageable pageable) {
+ public Page findByConditions(String memberId, String memberName, Long activityId, Boolean isPublic,
+ Pageable pageable) {
QReviewJpaEntity review = QReviewJpaEntity.reviewJpaEntity;
BooleanBuilder builder = new BooleanBuilder();
- if (memberId != null) builder.and(review.memberId.eq(memberId));
+ if (memberId != null) {
+ builder.and(review.memberId.eq(memberId));
+ }
if (memberName != null && !memberName.isBlank()) {
QMemberJpaEntity member = QMemberJpaEntity.memberJpaEntity;
builder.and(JPAExpressions.selectFrom(member)
- .where(member.name.eq(memberName)
- .and(member.id.eq(review.memberId)))
- .exists());
+ .where(member.name.eq(memberName)
+ .and(member.id.eq(review.memberId)))
+ .exists());
+ }
+ if (activityId != null) {
+ builder.and(review.activityGroup.id.eq(activityId));
+ }
+ if (isPublic != null) {
+ builder.and(review.isPublic.eq(isPublic));
}
- if (activityId != null) builder.and(review.activityGroup.id.eq(activityId));
- if (isPublic != null) builder.and(review.isPublic.eq(isPublic));
List reviews = queryFactory.selectFrom(review)
- .where(builder)
- .orderBy(OrderSpecifierUtil.getOrderSpecifiers(pageable, review))
- .offset(pageable.getOffset())
- .limit(pageable.getPageSize())
- .fetch();
+ .where(builder)
+ .orderBy(OrderSpecifierUtil.getOrderSpecifiers(pageable, review))
+ .offset(pageable.getOffset())
+ .limit(pageable.getPageSize())
+ .fetch();
long count = queryFactory.selectFrom(review)
- .where(builder)
- .fetchCount();
+ .where(builder)
+ .fetchCount();
return new PageImpl<>(reviews, pageable, count);
}
diff --git a/src/main/java/page/clab/api/domain/activity/review/application/dto/mapper/ReviewDtoMapper.java b/src/main/java/page/clab/api/domain/activity/review/application/dto/mapper/ReviewDtoMapper.java
index dff125ec1..f61c4670f 100644
--- a/src/main/java/page/clab/api/domain/activity/review/application/dto/mapper/ReviewDtoMapper.java
+++ b/src/main/java/page/clab/api/domain/activity/review/application/dto/mapper/ReviewDtoMapper.java
@@ -12,28 +12,28 @@ public class ReviewDtoMapper {
public Review fromDto(ReviewRequestDto requestDto, String memberId, ActivityGroup activityGroup) {
return Review.builder()
- .activityGroup(activityGroup)
- .memberId(memberId)
- .content(requestDto.getContent())
- .isPublic(false)
- .isDeleted(false)
- .build();
+ .activityGroup(activityGroup)
+ .memberId(memberId)
+ .content(requestDto.getContent())
+ .isPublic(false)
+ .isDeleted(false)
+ .build();
}
public ReviewResponseDto toDto(Review review, MemberReviewInfoDto reviewer, boolean isOwner) {
ActivityGroup activityGroup = review.getActivityGroup();
return ReviewResponseDto.builder()
- .id(review.getId())
- .activityGroupId(activityGroup.getId())
- .activityGroupName(activityGroup.getName())
- .activityGroupCategory(String.valueOf(activityGroup.getCategory()))
- .memberId(reviewer.getMemberId())
- .name(reviewer.getMemberName())
- .department(reviewer.getDepartment())
- .content(review.getContent())
- .isPublic(review.getIsPublic())
- .isOwner(isOwner)
- .createdAt(review.getCreatedAt())
- .build();
+ .id(review.getId())
+ .activityGroupId(activityGroup.getId())
+ .activityGroupName(activityGroup.getName())
+ .activityGroupCategory(String.valueOf(activityGroup.getCategory()))
+ .memberId(reviewer.getMemberId())
+ .name(reviewer.getMemberName())
+ .department(reviewer.getDepartment())
+ .content(review.getContent())
+ .isPublic(review.getIsPublic())
+ .isOwner(isOwner)
+ .createdAt(review.getCreatedAt())
+ .build();
}
}
diff --git a/src/main/java/page/clab/api/domain/activity/review/application/dto/request/ReviewRequestDto.java b/src/main/java/page/clab/api/domain/activity/review/application/dto/request/ReviewRequestDto.java
index 3d255c500..1b61d4c5f 100644
--- a/src/main/java/page/clab/api/domain/activity/review/application/dto/request/ReviewRequestDto.java
+++ b/src/main/java/page/clab/api/domain/activity/review/application/dto/request/ReviewRequestDto.java
@@ -15,6 +15,6 @@ public class ReviewRequestDto {
@NotNull(message = "{notNull.review.content}")
@Schema(description = "후기", example = "C-Lab에는 다양한 분야에 대한 열정있는 사람들이 모이기 때문에 다양하고 활동적인 스터디 그룹과 프로젝트 팀이 있습니다. " +
- "신입생이라도 자유롭게 스터디 그룹을 만들고 사람들을 모아서 원하는 분야와 관련된 기술을 알아보고 같이 공부하기 좋습니다!", required = true)
+ "신입생이라도 자유롭게 스터디 그룹을 만들고 사람들을 모아서 원하는 분야와 관련된 기술을 알아보고 같이 공부하기 좋습니다!", required = true)
private String content;
}
diff --git a/src/main/java/page/clab/api/domain/activity/review/application/dto/response/ReviewResponseDto.java b/src/main/java/page/clab/api/domain/activity/review/application/dto/response/ReviewResponseDto.java
index c5e3e85af..47819cdd3 100644
--- a/src/main/java/page/clab/api/domain/activity/review/application/dto/response/ReviewResponseDto.java
+++ b/src/main/java/page/clab/api/domain/activity/review/application/dto/response/ReviewResponseDto.java
@@ -1,10 +1,9 @@
package page.clab.api.domain.activity.review.application.dto.response;
+import java.time.LocalDateTime;
import lombok.Builder;
import lombok.Getter;
-import java.time.LocalDateTime;
-
@Getter
@Builder
public class ReviewResponseDto {
diff --git a/src/main/java/page/clab/api/domain/activity/review/application/port/in/RegisterReviewUseCase.java b/src/main/java/page/clab/api/domain/activity/review/application/port/in/RegisterReviewUseCase.java
index b0f50575e..82b264a7b 100644
--- a/src/main/java/page/clab/api/domain/activity/review/application/port/in/RegisterReviewUseCase.java
+++ b/src/main/java/page/clab/api/domain/activity/review/application/port/in/RegisterReviewUseCase.java
@@ -3,5 +3,6 @@
import page.clab.api.domain.activity.review.application.dto.request.ReviewRequestDto;
public interface RegisterReviewUseCase {
+
Long registerReview(ReviewRequestDto requestDto);
}
diff --git a/src/main/java/page/clab/api/domain/activity/review/application/port/in/RemoveReviewUseCase.java b/src/main/java/page/clab/api/domain/activity/review/application/port/in/RemoveReviewUseCase.java
index 770a03e73..2eb6b8d91 100644
--- a/src/main/java/page/clab/api/domain/activity/review/application/port/in/RemoveReviewUseCase.java
+++ b/src/main/java/page/clab/api/domain/activity/review/application/port/in/RemoveReviewUseCase.java
@@ -3,5 +3,6 @@
import page.clab.api.global.exception.PermissionDeniedException;
public interface RemoveReviewUseCase {
+
Long removeReview(Long reviewId) throws PermissionDeniedException;
}
diff --git a/src/main/java/page/clab/api/domain/activity/review/application/port/in/RetrieveDeletedReviewsUseCase.java b/src/main/java/page/clab/api/domain/activity/review/application/port/in/RetrieveDeletedReviewsUseCase.java
index ceb549e30..b9d21a6f4 100644
--- a/src/main/java/page/clab/api/domain/activity/review/application/port/in/RetrieveDeletedReviewsUseCase.java
+++ b/src/main/java/page/clab/api/domain/activity/review/application/port/in/RetrieveDeletedReviewsUseCase.java
@@ -5,5 +5,6 @@
import page.clab.api.global.common.dto.PagedResponseDto;
public interface RetrieveDeletedReviewsUseCase {
+
PagedResponseDto retrieveDeletedReviews(Pageable pageable);
}
diff --git a/src/main/java/page/clab/api/domain/activity/review/application/port/in/RetrieveMyReviewsUseCase.java b/src/main/java/page/clab/api/domain/activity/review/application/port/in/RetrieveMyReviewsUseCase.java
index 06b4d7ad6..7f01cb801 100644
--- a/src/main/java/page/clab/api/domain/activity/review/application/port/in/RetrieveMyReviewsUseCase.java
+++ b/src/main/java/page/clab/api/domain/activity/review/application/port/in/RetrieveMyReviewsUseCase.java
@@ -5,5 +5,6 @@
import page.clab.api.global.common.dto.PagedResponseDto;
public interface RetrieveMyReviewsUseCase {
+
PagedResponseDto retrieveMyReviews(Pageable pageable);
}
diff --git a/src/main/java/page/clab/api/domain/activity/review/application/port/in/RetrieveReviewsByConditionsUseCase.java b/src/main/java/page/clab/api/domain/activity/review/application/port/in/RetrieveReviewsByConditionsUseCase.java
index 972feeafc..f390e45c1 100644
--- a/src/main/java/page/clab/api/domain/activity/review/application/port/in/RetrieveReviewsByConditionsUseCase.java
+++ b/src/main/java/page/clab/api/domain/activity/review/application/port/in/RetrieveReviewsByConditionsUseCase.java
@@ -5,5 +5,7 @@
import page.clab.api.global.common.dto.PagedResponseDto;
public interface RetrieveReviewsByConditionsUseCase {
- PagedResponseDto retrieveReviews(String memberId, String memberName, Long activityId, Boolean isPublic, Pageable pageable);
+
+ PagedResponseDto retrieveReviews(String memberId, String memberName, Long activityId,
+ Boolean isPublic, Pageable pageable);
}
diff --git a/src/main/java/page/clab/api/domain/activity/review/application/port/in/UpdateReviewUseCase.java b/src/main/java/page/clab/api/domain/activity/review/application/port/in/UpdateReviewUseCase.java
index 81e6f8a7b..daa757a82 100644
--- a/src/main/java/page/clab/api/domain/activity/review/application/port/in/UpdateReviewUseCase.java
+++ b/src/main/java/page/clab/api/domain/activity/review/application/port/in/UpdateReviewUseCase.java
@@ -4,5 +4,6 @@
import page.clab.api.global.exception.PermissionDeniedException;
public interface UpdateReviewUseCase {
+
Long updateReview(Long reviewId, ReviewUpdateRequestDto requestDto) throws PermissionDeniedException;
}
diff --git a/src/main/java/page/clab/api/domain/activity/review/application/port/out/RegisterReviewPort.java b/src/main/java/page/clab/api/domain/activity/review/application/port/out/RegisterReviewPort.java
index 49370b62c..cb73ca401 100644
--- a/src/main/java/page/clab/api/domain/activity/review/application/port/out/RegisterReviewPort.java
+++ b/src/main/java/page/clab/api/domain/activity/review/application/port/out/RegisterReviewPort.java
@@ -3,5 +3,6 @@
import page.clab.api.domain.activity.review.domain.Review;
public interface RegisterReviewPort {
+
Review save(Review review);
}
diff --git a/src/main/java/page/clab/api/domain/activity/review/application/port/out/RetrieveReviewPort.java b/src/main/java/page/clab/api/domain/activity/review/application/port/out/RetrieveReviewPort.java
index 2b35088fd..46857486a 100644
--- a/src/main/java/page/clab/api/domain/activity/review/application/port/out/RetrieveReviewPort.java
+++ b/src/main/java/page/clab/api/domain/activity/review/application/port/out/RetrieveReviewPort.java
@@ -13,7 +13,8 @@ public interface RetrieveReviewPort {
Page findAllByMemberId(String memberId, Pageable pageable);
- Page findByConditions(String memberId, String memberName, Long activityId, Boolean isPublic, Pageable pageable);
+ Page findByConditions(String memberId, String memberName, Long activityId, Boolean isPublic,
+ Pageable pageable);
boolean existsByMemberIdAndActivityGroup(String memberId, ActivityGroup activityGroup);
}
diff --git a/src/main/java/page/clab/api/domain/activity/review/application/service/ReviewRegisterService.java b/src/main/java/page/clab/api/domain/activity/review/application/service/ReviewRegisterService.java
index ca2413a5f..a777df8f8 100644
--- a/src/main/java/page/clab/api/domain/activity/review/application/service/ReviewRegisterService.java
+++ b/src/main/java/page/clab/api/domain/activity/review/application/service/ReviewRegisterService.java
@@ -1,5 +1,6 @@
package page.clab.api.domain.activity.review.application.service;
+import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -20,8 +21,6 @@
import page.clab.api.external.memberManagement.member.application.port.ExternalRetrieveMemberUseCase;
import page.clab.api.external.memberManagement.notification.application.port.ExternalSendNotificationUseCase;
-import java.util.List;
-
@Service
@RequiredArgsConstructor
public class ReviewRegisterService implements RegisterReviewUseCase {
@@ -54,9 +53,12 @@ private void validateReviewCreationPermission(ActivityGroup activityGroup, Strin
}
private void notifyGroupLeaderOfNewReview(ActivityGroup activityGroup, String memberName) {
- List groupLeaders = activityGroupMemberService.getGroupMemberByActivityGroupIdAndRole(activityGroup.getId(), ActivityGroupRole.LEADER);
+ List groupLeaders = activityGroupMemberService.getGroupMemberByActivityGroupIdAndRole(
+ activityGroup.getId(), ActivityGroupRole.LEADER);
if (!CollectionUtils.isEmpty(groupLeaders)) {
- groupLeaders.forEach(leader -> externalSendNotificationUseCase.sendNotificationToMember(leader.getMemberId(), "[" + activityGroup.getName() + "] " + memberName + "님이 리뷰를 등록하였습니다."));
+ groupLeaders.forEach(
+ leader -> externalSendNotificationUseCase.sendNotificationToMember(leader.getMemberId(),
+ "[" + activityGroup.getName() + "] " + memberName + "님이 리뷰를 등록하였습니다."));
}
}
diff --git a/src/main/java/page/clab/api/domain/activity/review/application/service/ReviewsByConditionsRetrievalService.java b/src/main/java/page/clab/api/domain/activity/review/application/service/ReviewsByConditionsRetrievalService.java
index 4d97fc901..f6eab85b5 100644
--- a/src/main/java/page/clab/api/domain/activity/review/application/service/ReviewsByConditionsRetrievalService.java
+++ b/src/main/java/page/clab/api/domain/activity/review/application/service/ReviewsByConditionsRetrievalService.java
@@ -24,9 +24,11 @@ public class ReviewsByConditionsRetrievalService implements RetrieveReviewsByCon
@Transactional(readOnly = true)
@Override
- public PagedResponseDto retrieveReviews(String memberId, String memberName, Long activityId, Boolean isPublic, Pageable pageable) {
+ public PagedResponseDto retrieveReviews(String memberId, String memberName, Long activityId,
+ Boolean isPublic, Pageable pageable) {
String currentMemberId = externalRetrieveMemberUseCase.getCurrentMemberId();
- Page reviews = retrieveReviewPort.findByConditions(memberId, memberName, activityId, isPublic, pageable);
+ Page reviews = retrieveReviewPort.findByConditions(memberId, memberName, activityId, isPublic,
+ pageable);
return new PagedResponseDto<>(reviews.map(review -> {
MemberReviewInfoDto reviewer = externalRetrieveMemberUseCase.getMemberReviewInfoById(review.getMemberId());
return mapper.toDto(review, reviewer, review.isOwner(currentMemberId));
diff --git a/src/main/java/page/clab/api/domain/activity/review/domain/Review.java b/src/main/java/page/clab/api/domain/activity/review/domain/Review.java
index 323a16342..d3edc2e19 100644
--- a/src/main/java/page/clab/api/domain/activity/review/domain/Review.java
+++ b/src/main/java/page/clab/api/domain/activity/review/domain/Review.java
@@ -1,5 +1,7 @@
package page.clab.api.domain.activity.review.domain;
+import java.time.LocalDateTime;
+import java.util.Optional;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
@@ -11,9 +13,6 @@
import page.clab.api.domain.memberManagement.member.application.dto.shared.MemberDetailedInfoDto;
import page.clab.api.global.exception.PermissionDeniedException;
-import java.time.LocalDateTime;
-import java.util.Optional;
-
@Getter
@Setter
@Builder
diff --git a/src/main/java/page/clab/api/domain/auth/accountAccessLog/adapter/out/persistence/AccountAccessLogJpaEntity.java b/src/main/java/page/clab/api/domain/auth/accountAccessLog/adapter/out/persistence/AccountAccessLogJpaEntity.java
index aa2adcd79..4bcc0c5a8 100644
--- a/src/main/java/page/clab/api/domain/auth/accountAccessLog/adapter/out/persistence/AccountAccessLogJpaEntity.java
+++ b/src/main/java/page/clab/api/domain/auth/accountAccessLog/adapter/out/persistence/AccountAccessLogJpaEntity.java
@@ -8,6 +8,7 @@
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
+import java.time.LocalDateTime;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
@@ -17,8 +18,6 @@
import page.clab.api.domain.auth.accountAccessLog.domain.AccountAccessResult;
import page.clab.api.global.common.domain.BaseEntity;
-import java.time.LocalDateTime;
-
@Entity
@Table(name = "account_access_log")
@Getter
diff --git a/src/main/java/page/clab/api/domain/auth/accountAccessLog/adapter/out/persistence/AccountAccessLogPersistenceAdapter.java b/src/main/java/page/clab/api/domain/auth/accountAccessLog/adapter/out/persistence/AccountAccessLogPersistenceAdapter.java
index 4220791df..7c427511c 100644
--- a/src/main/java/page/clab/api/domain/auth/accountAccessLog/adapter/out/persistence/AccountAccessLogPersistenceAdapter.java
+++ b/src/main/java/page/clab/api/domain/auth/accountAccessLog/adapter/out/persistence/AccountAccessLogPersistenceAdapter.java
@@ -8,7 +8,7 @@
@Component
@RequiredArgsConstructor
public class AccountAccessLogPersistenceAdapter implements
- RegisterAccountAccessLogPort {
+ RegisterAccountAccessLogPort {
private final AccountAccessLogRepository accountAccessLogRepository;
private final AccountAccessLogMapper accountAccessLogMapper;
diff --git a/src/main/java/page/clab/api/domain/auth/accountAccessLog/adapter/out/persistence/AccountAccessLogRepository.java b/src/main/java/page/clab/api/domain/auth/accountAccessLog/adapter/out/persistence/AccountAccessLogRepository.java
index c84e09ddd..f7ca72b0f 100644
--- a/src/main/java/page/clab/api/domain/auth/accountAccessLog/adapter/out/persistence/AccountAccessLogRepository.java
+++ b/src/main/java/page/clab/api/domain/auth/accountAccessLog/adapter/out/persistence/AccountAccessLogRepository.java
@@ -7,5 +7,6 @@
@Repository
public interface AccountAccessLogRepository extends JpaRepository {
+
Page findAllByMemberId(String memberId, Pageable pageable);
}
diff --git a/src/main/java/page/clab/api/domain/auth/accountAccessLog/application/port/out/RegisterAccountAccessLogPort.java b/src/main/java/page/clab/api/domain/auth/accountAccessLog/application/port/out/RegisterAccountAccessLogPort.java
index 63df045e4..ffc642eb4 100644
--- a/src/main/java/page/clab/api/domain/auth/accountAccessLog/application/port/out/RegisterAccountAccessLogPort.java
+++ b/src/main/java/page/clab/api/domain/auth/accountAccessLog/application/port/out/RegisterAccountAccessLogPort.java
@@ -3,5 +3,6 @@
import page.clab.api.domain.auth.accountAccessLog.domain.AccountAccessLog;
public interface RegisterAccountAccessLogPort {
+
AccountAccessLog save(AccountAccessLog accountAccessLog);
}
diff --git a/src/main/java/page/clab/api/domain/auth/accountAccessLog/domain/AccountAccessLog.java b/src/main/java/page/clab/api/domain/auth/accountAccessLog/domain/AccountAccessLog.java
index 2932dc8bc..12150480e 100644
--- a/src/main/java/page/clab/api/domain/auth/accountAccessLog/domain/AccountAccessLog.java
+++ b/src/main/java/page/clab/api/domain/auth/accountAccessLog/domain/AccountAccessLog.java
@@ -2,14 +2,13 @@
import io.ipinfo.api.model.IPResponse;
import jakarta.servlet.http.HttpServletRequest;
+import java.time.LocalDateTime;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
-import java.time.LocalDateTime;
-
@Getter
@Builder
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@@ -24,14 +23,15 @@ public class AccountAccessLog {
private AccountAccessResult accountAccessResult;
private LocalDateTime accessTime;
- public static AccountAccessLog create(String memberId, HttpServletRequest httpServletRequest, String ipAddress, IPResponse ipResponse, AccountAccessResult accountAccessResult) {
+ public static AccountAccessLog create(String memberId, HttpServletRequest httpServletRequest, String ipAddress,
+ IPResponse ipResponse, AccountAccessResult accountAccessResult) {
return AccountAccessLog.builder()
- .memberId(memberId)
- .userAgent(httpServletRequest.getHeader("User-Agent"))
- .ipAddress(ipAddress)
- .location(ipResponse == null ? "Unknown" : ipResponse.getCountryName() + ", " + ipResponse.getCity())
- .accountAccessResult(accountAccessResult)
- .accessTime(LocalDateTime.now())
- .build();
+ .memberId(memberId)
+ .userAgent(httpServletRequest.getHeader("User-Agent"))
+ .ipAddress(ipAddress)
+ .location(ipResponse == null ? "Unknown" : ipResponse.getCountryName() + ", " + ipResponse.getCity())
+ .accountAccessResult(accountAccessResult)
+ .accessTime(LocalDateTime.now())
+ .build();
}
}
diff --git a/src/main/java/page/clab/api/domain/auth/accountLockInfo/adapter/in/web/BanMembersRetrievalController.java b/src/main/java/page/clab/api/domain/auth/accountLockInfo/adapter/in/web/BanMembersRetrievalController.java
index fdc417826..f35df79f7 100644
--- a/src/main/java/page/clab/api/domain/auth/accountLockInfo/adapter/in/web/BanMembersRetrievalController.java
+++ b/src/main/java/page/clab/api/domain/auth/accountLockInfo/adapter/in/web/BanMembersRetrievalController.java
@@ -27,11 +27,12 @@ public class BanMembersRetrievalController {
@PreAuthorize("hasRole('SUPER')")
@GetMapping("")
public ApiResponse> retrieveBanMembers(
- @RequestParam(name = "page", defaultValue = "0") int page,
- @RequestParam(name = "size", defaultValue = "20") int size
+ @RequestParam(name = "page", defaultValue = "0") int page,
+ @RequestParam(name = "size", defaultValue = "20") int size
) {
Pageable pageable = PageRequest.of(page, size);
- PagedResponseDto banMembers = retrieveBannedMembersUseCase.retrieveBanMembers(pageable);
+ PagedResponseDto banMembers = retrieveBannedMembersUseCase.retrieveBanMembers(
+ pageable);
return ApiResponse.success(banMembers);
}
}
diff --git a/src/main/java/page/clab/api/domain/auth/accountLockInfo/adapter/in/web/MemberBanController.java b/src/main/java/page/clab/api/domain/auth/accountLockInfo/adapter/in/web/MemberBanController.java
index 21b35804e..167c9ce3c 100644
--- a/src/main/java/page/clab/api/domain/auth/accountLockInfo/adapter/in/web/MemberBanController.java
+++ b/src/main/java/page/clab/api/domain/auth/accountLockInfo/adapter/in/web/MemberBanController.java
@@ -24,8 +24,8 @@ public class MemberBanController {
@PreAuthorize("hasRole('SUPER')")
@PostMapping("/ban/{memberId}")
public ApiResponse banMember(
- HttpServletRequest request,
- @PathVariable(name = "memberId") String memberId
+ HttpServletRequest request,
+ @PathVariable(name = "memberId") String memberId
) {
Long id = banMemberUseCase.banMember(request, memberId);
return ApiResponse.success(id);
diff --git a/src/main/java/page/clab/api/domain/auth/accountLockInfo/adapter/in/web/MemberUnbanController.java b/src/main/java/page/clab/api/domain/auth/accountLockInfo/adapter/in/web/MemberUnbanController.java
index a9339d20c..38bfa43d2 100644
--- a/src/main/java/page/clab/api/domain/auth/accountLockInfo/adapter/in/web/MemberUnbanController.java
+++ b/src/main/java/page/clab/api/domain/auth/accountLockInfo/adapter/in/web/MemberUnbanController.java
@@ -24,8 +24,8 @@ public class MemberUnbanController {
@PreAuthorize("hasRole('SUPER')")
@PostMapping("/unban/{memberId}")
public ApiResponse unbanMember(
- HttpServletRequest request,
- @PathVariable(name = "memberId") String memberId
+ HttpServletRequest request,
+ @PathVariable(name = "memberId") String memberId
) {
Long id = unbanMemberUseCase.unbanMember(request, memberId);
return ApiResponse.success(id);
diff --git a/src/main/java/page/clab/api/domain/auth/accountLockInfo/adapter/out/persistence/AccountLockInfoJpaEntity.java b/src/main/java/page/clab/api/domain/auth/accountLockInfo/adapter/out/persistence/AccountLockInfoJpaEntity.java
index 4353577bc..9679f899b 100644
--- a/src/main/java/page/clab/api/domain/auth/accountLockInfo/adapter/out/persistence/AccountLockInfoJpaEntity.java
+++ b/src/main/java/page/clab/api/domain/auth/accountLockInfo/adapter/out/persistence/AccountLockInfoJpaEntity.java
@@ -6,6 +6,7 @@
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
+import java.time.LocalDateTime;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
@@ -14,8 +15,6 @@
import lombok.Setter;
import page.clab.api.global.common.domain.BaseEntity;
-import java.time.LocalDateTime;
-
@Entity
@Table(name = "account_lock_info")
@Getter
diff --git a/src/main/java/page/clab/api/domain/auth/accountLockInfo/adapter/out/persistence/AccountLockInfoPersistenceAdapter.java b/src/main/java/page/clab/api/domain/auth/accountLockInfo/adapter/out/persistence/AccountLockInfoPersistenceAdapter.java
index 59691005a..771b38f16 100644
--- a/src/main/java/page/clab/api/domain/auth/accountLockInfo/adapter/out/persistence/AccountLockInfoPersistenceAdapter.java
+++ b/src/main/java/page/clab/api/domain/auth/accountLockInfo/adapter/out/persistence/AccountLockInfoPersistenceAdapter.java
@@ -1,5 +1,7 @@
package page.clab.api.domain.auth.accountLockInfo.adapter.out.persistence;
+import java.time.LocalDateTime;
+import java.util.Optional;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
@@ -9,15 +11,12 @@
import page.clab.api.domain.auth.accountLockInfo.application.port.out.RetrieveAccountLockInfoPort;
import page.clab.api.domain.auth.accountLockInfo.domain.AccountLockInfo;
-import java.time.LocalDateTime;
-import java.util.Optional;
-
@Component
@RequiredArgsConstructor
public class AccountLockInfoPersistenceAdapter implements
- RegisterAccountLockInfoPort,
- RetrieveAccountLockInfoPort,
- RemoveAccountLockInfoPort {
+ RegisterAccountLockInfoPort,
+ RetrieveAccountLockInfoPort,
+ RemoveAccountLockInfoPort {
private final AccountLockInfoRepository accountLockInfoRepository;
private final AccountLockInfoMapper accountLockInfoMapper;
diff --git a/src/main/java/page/clab/api/domain/auth/accountLockInfo/adapter/out/persistence/AccountLockInfoRepository.java b/src/main/java/page/clab/api/domain/auth/accountLockInfo/adapter/out/persistence/AccountLockInfoRepository.java
index a99a97287..a433b3ac7 100644
--- a/src/main/java/page/clab/api/domain/auth/accountLockInfo/adapter/out/persistence/AccountLockInfoRepository.java
+++ b/src/main/java/page/clab/api/domain/auth/accountLockInfo/adapter/out/persistence/AccountLockInfoRepository.java
@@ -1,13 +1,12 @@
package page.clab.api.domain.auth.accountLockInfo.adapter.out.persistence;
+import java.time.LocalDateTime;
+import java.util.Optional;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
-import java.time.LocalDateTime;
-import java.util.Optional;
-
@Repository
public interface AccountLockInfoRepository extends JpaRepository {
diff --git a/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/dto/mapper/AccountLockInfoDtoMapper.java b/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/dto/mapper/AccountLockInfoDtoMapper.java
index f96f7b5c2..fc8a21a26 100644
--- a/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/dto/mapper/AccountLockInfoDtoMapper.java
+++ b/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/dto/mapper/AccountLockInfoDtoMapper.java
@@ -9,8 +9,8 @@ public class AccountLockInfoDtoMapper {
public AccountLockInfoResponseDto toDto(AccountLockInfo accountLockInfo, String memberName) {
return AccountLockInfoResponseDto.builder()
- .id(accountLockInfo.getMemberId())
- .name(memberName)
- .build();
+ .id(accountLockInfo.getMemberId())
+ .name(memberName)
+ .build();
}
}
diff --git a/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/port/in/BanMemberUseCase.java b/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/port/in/BanMemberUseCase.java
index 2cce13954..2c766f064 100644
--- a/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/port/in/BanMemberUseCase.java
+++ b/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/port/in/BanMemberUseCase.java
@@ -3,5 +3,6 @@
import jakarta.servlet.http.HttpServletRequest;
public interface BanMemberUseCase {
+
Long banMember(HttpServletRequest request, String memberId);
}
diff --git a/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/port/in/RetrieveBannedMembersUseCase.java b/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/port/in/RetrieveBannedMembersUseCase.java
index 5c17ce8b7..090a51e82 100644
--- a/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/port/in/RetrieveBannedMembersUseCase.java
+++ b/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/port/in/RetrieveBannedMembersUseCase.java
@@ -5,5 +5,6 @@
import page.clab.api.global.common.dto.PagedResponseDto;
public interface RetrieveBannedMembersUseCase {
+
PagedResponseDto retrieveBanMembers(Pageable pageable);
}
diff --git a/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/port/in/UnbanMemberUseCase.java b/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/port/in/UnbanMemberUseCase.java
index 77ba37bbd..577038038 100644
--- a/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/port/in/UnbanMemberUseCase.java
+++ b/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/port/in/UnbanMemberUseCase.java
@@ -3,5 +3,6 @@
import jakarta.servlet.http.HttpServletRequest;
public interface UnbanMemberUseCase {
+
Long unbanMember(HttpServletRequest request, String memberId);
}
diff --git a/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/port/out/RegisterAccountLockInfoPort.java b/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/port/out/RegisterAccountLockInfoPort.java
index 76044e234..f6fc57080 100644
--- a/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/port/out/RegisterAccountLockInfoPort.java
+++ b/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/port/out/RegisterAccountLockInfoPort.java
@@ -3,5 +3,6 @@
import page.clab.api.domain.auth.accountLockInfo.domain.AccountLockInfo;
public interface RegisterAccountLockInfoPort {
+
AccountLockInfo save(AccountLockInfo accountLockInfo);
}
diff --git a/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/port/out/RemoveAccountLockInfoPort.java b/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/port/out/RemoveAccountLockInfoPort.java
index f56bedbae..a32b8382a 100644
--- a/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/port/out/RemoveAccountLockInfoPort.java
+++ b/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/port/out/RemoveAccountLockInfoPort.java
@@ -3,5 +3,6 @@
import page.clab.api.domain.auth.accountLockInfo.domain.AccountLockInfo;
public interface RemoveAccountLockInfoPort {
+
void delete(AccountLockInfo accountLockInfo);
}
diff --git a/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/port/out/RetrieveAccountLockInfoPort.java b/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/port/out/RetrieveAccountLockInfoPort.java
index 142c8d48e..042517808 100644
--- a/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/port/out/RetrieveAccountLockInfoPort.java
+++ b/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/port/out/RetrieveAccountLockInfoPort.java
@@ -1,12 +1,11 @@
package page.clab.api.domain.auth.accountLockInfo.application.port.out;
+import java.time.LocalDateTime;
+import java.util.Optional;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import page.clab.api.domain.auth.accountLockInfo.domain.AccountLockInfo;
-import java.time.LocalDateTime;
-import java.util.Optional;
-
public interface RetrieveAccountLockInfoPort {
Optional findByMemberId(String memberId);
diff --git a/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/service/BanMembersRetrievalService.java b/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/service/BanMembersRetrievalService.java
index cec3d1ca4..485cef7d7 100644
--- a/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/service/BanMembersRetrievalService.java
+++ b/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/service/BanMembersRetrievalService.java
@@ -1,5 +1,6 @@
package page.clab.api.domain.auth.accountLockInfo.application.service;
+import java.time.LocalDateTime;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
@@ -13,8 +14,6 @@
import page.clab.api.external.memberManagement.member.application.port.ExternalRetrieveMemberUseCase;
import page.clab.api.global.common.dto.PagedResponseDto;
-import java.time.LocalDateTime;
-
@Service
@RequiredArgsConstructor
public class BanMembersRetrievalService implements RetrieveBannedMembersUseCase {
@@ -29,7 +28,8 @@ public PagedResponseDto retrieveBanMembers(Pageable
LocalDateTime banDate = LocalDateTime.of(9999, 12, 31, 23, 59);
Page banMembers = retrieveAccountLockInfoPort.findByLockUntil(banDate, pageable);
return new PagedResponseDto<>(banMembers.map(accountLockInfo -> {
- String memberName = externalRetrieveMemberUseCase.getMemberBasicInfoById(accountLockInfo.getMemberId()).getMemberName();
+ String memberName = externalRetrieveMemberUseCase.getMemberBasicInfoById(accountLockInfo.getMemberId())
+ .getMemberName();
return mapper.toDto(accountLockInfo, memberName);
}));
}
diff --git a/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/service/MemberBanService.java b/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/service/MemberBanService.java
index a7ca3a616..8f7236a9d 100644
--- a/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/service/MemberBanService.java
+++ b/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/service/MemberBanService.java
@@ -48,7 +48,7 @@ public Long banMember(HttpServletRequest request, String memberId) {
private AccountLockInfo ensureAccountLockInfo(String memberId) {
return retrieveAccountLockInfoPort.findByMemberId(memberId)
- .orElseGet(() -> createAccountLockInfo(memberId));
+ .orElseGet(() -> createAccountLockInfo(memberId));
}
private AccountLockInfo createAccountLockInfo(String memberId) {
@@ -61,6 +61,6 @@ private void sendSlackBanNotification(HttpServletRequest request, String memberI
String memberName = externalRetrieveMemberUseCase.getMemberBasicInfoById(memberId).getMemberName();
String memberBannedMessage = "ID: " + memberId + ", Name: " + memberName;
eventPublisher.publishEvent(
- new NotificationEvent(this, SecurityAlertType.MEMBER_BANNED, request, memberBannedMessage));
+ new NotificationEvent(this, SecurityAlertType.MEMBER_BANNED, request, memberBannedMessage));
}
}
diff --git a/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/service/MemberUnbanService.java b/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/service/MemberUnbanService.java
index 1aaf67e4d..0d2517129 100644
--- a/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/service/MemberUnbanService.java
+++ b/src/main/java/page/clab/api/domain/auth/accountLockInfo/application/service/MemberUnbanService.java
@@ -45,7 +45,7 @@ public Long unbanMember(HttpServletRequest request, String memberId) {
private AccountLockInfo ensureAccountLockInfo(String memberId) {
return retrieveAccountLockInfoPort.findByMemberId(memberId)
- .orElseGet(() -> createAccountLockInfo(memberId));
+ .orElseGet(() -> createAccountLockInfo(memberId));
}
private AccountLockInfo createAccountLockInfo(String memberId) {
@@ -58,6 +58,6 @@ private void sendSlackUnbanNotification(HttpServletRequest request, String membe
String memberName = externalRetrieveMemberUseCase.getMemberBasicInfoById(memberId).getMemberName();
String memberUnbannedMessage = "ID: " + memberId + ", Name: " + memberName;
eventPublisher.publishEvent(
- new NotificationEvent(this, SecurityAlertType.MEMBER_UNBANNED, request, memberUnbannedMessage));
+ new NotificationEvent(this, SecurityAlertType.MEMBER_UNBANNED, request, memberUnbannedMessage));
}
}
diff --git a/src/main/java/page/clab/api/domain/auth/accountLockInfo/domain/AccountLockInfo.java b/src/main/java/page/clab/api/domain/auth/accountLockInfo/domain/AccountLockInfo.java
index 022e7820c..bed8fb4df 100644
--- a/src/main/java/page/clab/api/domain/auth/accountLockInfo/domain/AccountLockInfo.java
+++ b/src/main/java/page/clab/api/domain/auth/accountLockInfo/domain/AccountLockInfo.java
@@ -1,5 +1,6 @@
package page.clab.api.domain.auth.accountLockInfo.domain;
+import java.time.LocalDateTime;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
@@ -7,8 +8,6 @@
import lombok.NoArgsConstructor;
import lombok.Setter;
-import java.time.LocalDateTime;
-
@Getter
@Setter
@Builder
@@ -24,11 +23,11 @@ public class AccountLockInfo {
public static AccountLockInfo create(String memberId) {
return AccountLockInfo.builder()
- .memberId(memberId)
- .loginFailCount(0L)
- .isLock(false)
- .lockUntil(null)
- .build();
+ .memberId(memberId)
+ .loginFailCount(0L)
+ .isLock(false)
+ .lockUntil(null)
+ .build();
}
public void banPermanently() {
diff --git a/src/main/java/page/clab/api/domain/auth/blacklistIp/adapter/in/web/BlacklistIpRegisterController.java b/src/main/java/page/clab/api/domain/auth/blacklistIp/adapter/in/web/BlacklistIpRegisterController.java
index cf9aeef27..b740df599 100644
--- a/src/main/java/page/clab/api/domain/auth/blacklistIp/adapter/in/web/BlacklistIpRegisterController.java
+++ b/src/main/java/page/clab/api/domain/auth/blacklistIp/adapter/in/web/BlacklistIpRegisterController.java
@@ -26,8 +26,8 @@ public class BlacklistIpRegisterController {
@PreAuthorize("hasRole('SUPER')")
@PostMapping("")
public ApiResponse registerBlacklistIp(
- HttpServletRequest request,
- @Valid @RequestBody BlacklistIpRequestDto requestDto
+ HttpServletRequest request,
+ @Valid @RequestBody BlacklistIpRequestDto requestDto
) {
String addedIp = registerBlacklistIpUseCase.registerBlacklistIp(request, requestDto);
return ApiResponse.success(addedIp);
diff --git a/src/main/java/page/clab/api/domain/auth/blacklistIp/adapter/in/web/BlacklistIpRemoveController.java b/src/main/java/page/clab/api/domain/auth/blacklistIp/adapter/in/web/BlacklistIpRemoveController.java
index f82205656..41b4140bd 100644
--- a/src/main/java/page/clab/api/domain/auth/blacklistIp/adapter/in/web/BlacklistIpRemoveController.java
+++ b/src/main/java/page/clab/api/domain/auth/blacklistIp/adapter/in/web/BlacklistIpRemoveController.java
@@ -24,8 +24,8 @@ public class BlacklistIpRemoveController {
@PreAuthorize("hasRole('SUPER')")
@DeleteMapping("")
public ApiResponse removeBlacklistIp(
- HttpServletRequest request,
- @RequestParam(name = "ipAddress") String ipAddress
+ HttpServletRequest request,
+ @RequestParam(name = "ipAddress") String ipAddress
) {
String deletedIp = removeBlacklistIpUseCase.removeBlacklistIp(request, ipAddress);
return ApiResponse.success(deletedIp);
diff --git a/src/main/java/page/clab/api/domain/auth/blacklistIp/adapter/in/web/BlacklistIpRetrievalController.java b/src/main/java/page/clab/api/domain/auth/blacklistIp/adapter/in/web/BlacklistIpRetrievalController.java
index de1a8d351..0c37988ac 100644
--- a/src/main/java/page/clab/api/domain/auth/blacklistIp/adapter/in/web/BlacklistIpRetrievalController.java
+++ b/src/main/java/page/clab/api/domain/auth/blacklistIp/adapter/in/web/BlacklistIpRetrievalController.java
@@ -2,6 +2,7 @@
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
+import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Pageable;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -17,8 +18,6 @@
import page.clab.api.global.exception.SortingArgumentException;
import page.clab.api.global.util.PageableUtils;
-import java.util.List;
-
@RestController
@RequestMapping("/api/v1/blacklists")
@RequiredArgsConstructor
@@ -29,17 +28,19 @@ public class BlacklistIpRetrievalController {
private final PageableUtils pageableUtils;
@Operation(summary = "[A] 블랙리스트 IP 목록 조회", description = "ROLE_ADMIN 이상의 권한이 필요함
" +
- "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
+ "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
@PreAuthorize("hasRole('ADMIN')")
@GetMapping("")
public ApiResponse> retrieveBlacklistIps(
- @RequestParam(name = "page", defaultValue = "0") int page,
- @RequestParam(name = "size", defaultValue = "20") int size,
- @RequestParam(name = "sortBy", defaultValue = "createdAt") List sortBy,
- @RequestParam(name = "sortDirection", defaultValue = "desc") List sortDirection
+ @RequestParam(name = "page", defaultValue = "0") int page,
+ @RequestParam(name = "size", defaultValue = "20") int size,
+ @RequestParam(name = "sortBy", defaultValue = "createdAt") List sortBy,
+ @RequestParam(name = "sortDirection", defaultValue = "desc") List sortDirection
) throws SortingArgumentException, InvalidColumnException {
- Pageable pageable = pageableUtils.createPageable(page, size, sortBy, sortDirection, BlacklistIpResponseDto.class);
- PagedResponseDto blacklistedIps = retrieveBlacklistIpsUseCase.retrieveBlacklistIps(pageable);
+ Pageable pageable = pageableUtils.createPageable(page, size, sortBy, sortDirection,
+ BlacklistIpResponseDto.class);
+ PagedResponseDto blacklistedIps = retrieveBlacklistIpsUseCase.retrieveBlacklistIps(
+ pageable);
return ApiResponse.success(blacklistedIps);
}
}
diff --git a/src/main/java/page/clab/api/domain/auth/blacklistIp/adapter/in/web/BlacklistResetController.java b/src/main/java/page/clab/api/domain/auth/blacklistIp/adapter/in/web/BlacklistResetController.java
index ac7f6756f..4a5cadbcc 100644
--- a/src/main/java/page/clab/api/domain/auth/blacklistIp/adapter/in/web/BlacklistResetController.java
+++ b/src/main/java/page/clab/api/domain/auth/blacklistIp/adapter/in/web/BlacklistResetController.java
@@ -3,6 +3,7 @@
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletRequest;
+import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
@@ -11,8 +12,6 @@
import page.clab.api.domain.auth.blacklistIp.application.port.in.ResetBlacklistIpsUseCase;
import page.clab.api.global.common.dto.ApiResponse;
-import java.util.List;
-
@RestController
@RequestMapping("/api/v1/blacklists")
@RequiredArgsConstructor
@@ -25,7 +24,7 @@ public class BlacklistResetController {
@PreAuthorize("hasRole('SUPER')")
@DeleteMapping("/clear")
public ApiResponse> resetBlacklistIps(
- HttpServletRequest request
+ HttpServletRequest request
) {
List blacklistIps = resetBlacklistIpsUseCase.resetBlacklistIps(request);
return ApiResponse.success(blacklistIps);
diff --git a/src/main/java/page/clab/api/domain/auth/blacklistIp/adapter/out/persistence/BlacklistIpJpaEntity.java b/src/main/java/page/clab/api/domain/auth/blacklistIp/adapter/out/persistence/BlacklistIpJpaEntity.java
index 0b80db3c2..ca1cf3dac 100644
--- a/src/main/java/page/clab/api/domain/auth/blacklistIp/adapter/out/persistence/BlacklistIpJpaEntity.java
+++ b/src/main/java/page/clab/api/domain/auth/blacklistIp/adapter/out/persistence/BlacklistIpJpaEntity.java
@@ -34,8 +34,8 @@ public class BlacklistIpJpaEntity extends BaseEntity {
public static BlacklistIpJpaEntity create(String ipAddress, String reason) {
return BlacklistIpJpaEntity.builder()
- .ipAddress(ipAddress)
- .reason(reason)
- .build();
+ .ipAddress(ipAddress)
+ .reason(reason)
+ .build();
}
}
diff --git a/src/main/java/page/clab/api/domain/auth/blacklistIp/adapter/out/persistence/BlacklistIpPersistenceAdapter.java b/src/main/java/page/clab/api/domain/auth/blacklistIp/adapter/out/persistence/BlacklistIpPersistenceAdapter.java
index cbafe18fe..efe11c213 100644
--- a/src/main/java/page/clab/api/domain/auth/blacklistIp/adapter/out/persistence/BlacklistIpPersistenceAdapter.java
+++ b/src/main/java/page/clab/api/domain/auth/blacklistIp/adapter/out/persistence/BlacklistIpPersistenceAdapter.java
@@ -1,5 +1,7 @@
package page.clab.api.domain.auth.blacklistIp.adapter.out.persistence;
+import java.util.List;
+import java.util.Optional;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
@@ -10,15 +12,12 @@
import page.clab.api.domain.auth.blacklistIp.domain.BlacklistIp;
import page.clab.api.global.exception.NotFoundException;
-import java.util.List;
-import java.util.Optional;
-
@Component
@RequiredArgsConstructor
public class BlacklistIpPersistenceAdapter implements
- RegisterBlacklistIpPort,
- RetrieveBlacklistIpPort,
- RemoveBlacklistIpPort {
+ RegisterBlacklistIpPort,
+ RetrieveBlacklistIpPort,
+ RemoveBlacklistIpPort {
private final BlacklistIpRepository blacklistIpRepository;
private final BlacklistIpMapper blacklistIpMapper;
@@ -33,14 +32,14 @@ public BlacklistIp save(BlacklistIp blacklistIp) {
@Override
public Optional findByIpAddress(String ipAddress) {
return blacklistIpRepository.findByIpAddress(ipAddress)
- .map(blacklistIpMapper::toDomain);
+ .map(blacklistIpMapper::toDomain);
}
@Override
public BlacklistIp getByIpAddress(String ipAddress) {
return blacklistIpRepository.findByIpAddress(ipAddress)
- .map(blacklistIpMapper::toDomain)
- .orElseThrow(() -> new NotFoundException("[BlacklistIp] IP: " + ipAddress + "에 해당하는 블랙리스트 IP가 존재하지 않습니다."));
+ .map(blacklistIpMapper::toDomain)
+ .orElseThrow(() -> new NotFoundException("[BlacklistIp] IP: " + ipAddress + "에 해당하는 블랙리스트 IP가 존재하지 않습니다."));
}
@Override
@@ -62,13 +61,13 @@ public void deleteAll() {
@Override
public List findAll() {
return blacklistIpRepository.findAll().stream()
- .map(blacklistIpMapper::toDomain)
- .toList();
+ .map(blacklistIpMapper::toDomain)
+ .toList();
}
@Override
public Page findAll(Pageable pageable) {
return blacklistIpRepository.findAll(pageable)
- .map(blacklistIpMapper::toDomain);
+ .map(blacklistIpMapper::toDomain);
}
}
diff --git a/src/main/java/page/clab/api/domain/auth/blacklistIp/adapter/out/persistence/BlacklistIpRepository.java b/src/main/java/page/clab/api/domain/auth/blacklistIp/adapter/out/persistence/BlacklistIpRepository.java
index 0fdc6e045..9742909f3 100644
--- a/src/main/java/page/clab/api/domain/auth/blacklistIp/adapter/out/persistence/BlacklistIpRepository.java
+++ b/src/main/java/page/clab/api/domain/auth/blacklistIp/adapter/out/persistence/BlacklistIpRepository.java
@@ -1,13 +1,12 @@
package page.clab.api.domain.auth.blacklistIp.adapter.out.persistence;
+import java.util.Optional;
import org.jetbrains.annotations.NotNull;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
-import java.util.Optional;
-
@Repository
public interface BlacklistIpRepository extends JpaRepository {
diff --git a/src/main/java/page/clab/api/domain/auth/blacklistIp/application/dto/mapper/BlacklistIpDtoMapper.java b/src/main/java/page/clab/api/domain/auth/blacklistIp/application/dto/mapper/BlacklistIpDtoMapper.java
index e82607c2d..9cb585846 100644
--- a/src/main/java/page/clab/api/domain/auth/blacklistIp/application/dto/mapper/BlacklistIpDtoMapper.java
+++ b/src/main/java/page/clab/api/domain/auth/blacklistIp/application/dto/mapper/BlacklistIpDtoMapper.java
@@ -10,17 +10,17 @@ public class BlacklistIpDtoMapper {
public BlacklistIp fromDto(BlacklistIpRequestDto requestDto) {
return BlacklistIp.builder()
- .ipAddress(requestDto.getIpAddress())
- .reason(requestDto.getReason())
- .build();
+ .ipAddress(requestDto.getIpAddress())
+ .reason(requestDto.getReason())
+ .build();
}
public BlacklistIpResponseDto toDto(BlacklistIp blacklistIp) {
return BlacklistIpResponseDto.builder()
- .id(blacklistIp.getId())
- .ipAddress(blacklistIp.getIpAddress())
- .reason(blacklistIp.getReason())
- .createdAt(blacklistIp.getCreatedAt())
- .build();
+ .id(blacklistIp.getId())
+ .ipAddress(blacklistIp.getIpAddress())
+ .reason(blacklistIp.getReason())
+ .createdAt(blacklistIp.getCreatedAt())
+ .build();
}
}
diff --git a/src/main/java/page/clab/api/domain/auth/blacklistIp/application/dto/response/BlacklistIpResponseDto.java b/src/main/java/page/clab/api/domain/auth/blacklistIp/application/dto/response/BlacklistIpResponseDto.java
index 2e712645f..fc3cce38e 100644
--- a/src/main/java/page/clab/api/domain/auth/blacklistIp/application/dto/response/BlacklistIpResponseDto.java
+++ b/src/main/java/page/clab/api/domain/auth/blacklistIp/application/dto/response/BlacklistIpResponseDto.java
@@ -1,10 +1,9 @@
package page.clab.api.domain.auth.blacklistIp.application.dto.response;
+import java.time.LocalDateTime;
import lombok.Builder;
import lombok.Getter;
-import java.time.LocalDateTime;
-
@Getter
@Builder
public class BlacklistIpResponseDto {
diff --git a/src/main/java/page/clab/api/domain/auth/blacklistIp/application/port/in/RegisterBlacklistIpUseCase.java b/src/main/java/page/clab/api/domain/auth/blacklistIp/application/port/in/RegisterBlacklistIpUseCase.java
index 73c550ac3..638b8c355 100644
--- a/src/main/java/page/clab/api/domain/auth/blacklistIp/application/port/in/RegisterBlacklistIpUseCase.java
+++ b/src/main/java/page/clab/api/domain/auth/blacklistIp/application/port/in/RegisterBlacklistIpUseCase.java
@@ -4,5 +4,6 @@
import page.clab.api.domain.auth.blacklistIp.application.dto.request.BlacklistIpRequestDto;
public interface RegisterBlacklistIpUseCase {
+
String registerBlacklistIp(HttpServletRequest request, BlacklistIpRequestDto requestDto);
}
diff --git a/src/main/java/page/clab/api/domain/auth/blacklistIp/application/port/in/RemoveBlacklistIpUseCase.java b/src/main/java/page/clab/api/domain/auth/blacklistIp/application/port/in/RemoveBlacklistIpUseCase.java
index 227e3fbf8..9628f40c7 100644
--- a/src/main/java/page/clab/api/domain/auth/blacklistIp/application/port/in/RemoveBlacklistIpUseCase.java
+++ b/src/main/java/page/clab/api/domain/auth/blacklistIp/application/port/in/RemoveBlacklistIpUseCase.java
@@ -3,5 +3,6 @@
import jakarta.servlet.http.HttpServletRequest;
public interface RemoveBlacklistIpUseCase {
+
String removeBlacklistIp(HttpServletRequest request, String ipAddress);
}
diff --git a/src/main/java/page/clab/api/domain/auth/blacklistIp/application/port/in/ResetBlacklistIpsUseCase.java b/src/main/java/page/clab/api/domain/auth/blacklistIp/application/port/in/ResetBlacklistIpsUseCase.java
index dcf1da738..f10a3a7d3 100644
--- a/src/main/java/page/clab/api/domain/auth/blacklistIp/application/port/in/ResetBlacklistIpsUseCase.java
+++ b/src/main/java/page/clab/api/domain/auth/blacklistIp/application/port/in/ResetBlacklistIpsUseCase.java
@@ -1,9 +1,9 @@
package page.clab.api.domain.auth.blacklistIp.application.port.in;
import jakarta.servlet.http.HttpServletRequest;
-
import java.util.List;
public interface ResetBlacklistIpsUseCase {
+
List resetBlacklistIps(HttpServletRequest request);
}
diff --git a/src/main/java/page/clab/api/domain/auth/blacklistIp/application/port/in/RetrieveBlacklistIpsUseCase.java b/src/main/java/page/clab/api/domain/auth/blacklistIp/application/port/in/RetrieveBlacklistIpsUseCase.java
index d499a6ada..71e274634 100644
--- a/src/main/java/page/clab/api/domain/auth/blacklistIp/application/port/in/RetrieveBlacklistIpsUseCase.java
+++ b/src/main/java/page/clab/api/domain/auth/blacklistIp/application/port/in/RetrieveBlacklistIpsUseCase.java
@@ -5,5 +5,6 @@
import page.clab.api.global.common.dto.PagedResponseDto;
public interface RetrieveBlacklistIpsUseCase {
+
PagedResponseDto retrieveBlacklistIps(Pageable pageable);
}
diff --git a/src/main/java/page/clab/api/domain/auth/blacklistIp/application/port/out/RegisterBlacklistIpPort.java b/src/main/java/page/clab/api/domain/auth/blacklistIp/application/port/out/RegisterBlacklistIpPort.java
index 15b7d6138..e51864207 100644
--- a/src/main/java/page/clab/api/domain/auth/blacklistIp/application/port/out/RegisterBlacklistIpPort.java
+++ b/src/main/java/page/clab/api/domain/auth/blacklistIp/application/port/out/RegisterBlacklistIpPort.java
@@ -3,5 +3,6 @@
import page.clab.api.domain.auth.blacklistIp.domain.BlacklistIp;
public interface RegisterBlacklistIpPort {
+
BlacklistIp save(BlacklistIp blacklistIp);
}
diff --git a/src/main/java/page/clab/api/domain/auth/blacklistIp/application/port/out/RetrieveBlacklistIpPort.java b/src/main/java/page/clab/api/domain/auth/blacklistIp/application/port/out/RetrieveBlacklistIpPort.java
index 097ee7fea..ae2ca5304 100644
--- a/src/main/java/page/clab/api/domain/auth/blacklistIp/application/port/out/RetrieveBlacklistIpPort.java
+++ b/src/main/java/page/clab/api/domain/auth/blacklistIp/application/port/out/RetrieveBlacklistIpPort.java
@@ -1,12 +1,11 @@
package page.clab.api.domain.auth.blacklistIp.application.port.out;
+import java.util.List;
+import java.util.Optional;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import page.clab.api.domain.auth.blacklistIp.domain.BlacklistIp;
-import java.util.List;
-import java.util.Optional;
-
public interface RetrieveBlacklistIpPort {
List findAll();
diff --git a/src/main/java/page/clab/api/domain/auth/blacklistIp/application/service/BlacklistIpRegisterService.java b/src/main/java/page/clab/api/domain/auth/blacklistIp/application/service/BlacklistIpRegisterService.java
index 42bc014d8..99957b099 100644
--- a/src/main/java/page/clab/api/domain/auth/blacklistIp/application/service/BlacklistIpRegisterService.java
+++ b/src/main/java/page/clab/api/domain/auth/blacklistIp/application/service/BlacklistIpRegisterService.java
@@ -38,17 +38,17 @@ public class BlacklistIpRegisterService implements RegisterBlacklistIpUseCase {
public String registerBlacklistIp(HttpServletRequest request, BlacklistIpRequestDto requestDto) {
String ipAddress = requestDto.getIpAddress();
return retrieveBlacklistIpPort.findByIpAddress(ipAddress)
- .map(BlacklistIp::getIpAddress)
- .orElseGet(() -> {
- BlacklistIp blacklistIp = mapper.fromDto(requestDto);
- registerBlacklistIpPort.save(blacklistIp);
+ .map(BlacklistIp::getIpAddress)
+ .orElseGet(() -> {
+ BlacklistIp blacklistIp = mapper.fromDto(requestDto);
+ registerBlacklistIpPort.save(blacklistIp);
- String blacklistAddedMessage = "Added IP: " + ipAddress;
- eventPublisher.publishEvent(
- new NotificationEvent(this, SecurityAlertType.BLACKLISTED_IP_ADDED, request,
- blacklistAddedMessage));
+ String blacklistAddedMessage = "Added IP: " + ipAddress;
+ eventPublisher.publishEvent(
+ new NotificationEvent(this, SecurityAlertType.BLACKLISTED_IP_ADDED, request,
+ blacklistAddedMessage));
- return ipAddress;
- });
+ return ipAddress;
+ });
}
}
diff --git a/src/main/java/page/clab/api/domain/auth/blacklistIp/application/service/BlacklistIpRemoveService.java b/src/main/java/page/clab/api/domain/auth/blacklistIp/application/service/BlacklistIpRemoveService.java
index 26b558adc..1e7ca0b42 100644
--- a/src/main/java/page/clab/api/domain/auth/blacklistIp/application/service/BlacklistIpRemoveService.java
+++ b/src/main/java/page/clab/api/domain/auth/blacklistIp/application/service/BlacklistIpRemoveService.java
@@ -38,8 +38,8 @@ public String removeBlacklistIp(HttpServletRequest request, String ipAddress) {
String blacklistRemovedMessage = "Deleted IP: " + ipAddress;
eventPublisher.publishEvent(
- new NotificationEvent(this, SecurityAlertType.BLACKLISTED_IP_REMOVED, request,
- blacklistRemovedMessage));
+ new NotificationEvent(this, SecurityAlertType.BLACKLISTED_IP_REMOVED, request,
+ blacklistRemovedMessage));
return blacklistIp.getIpAddress();
}
diff --git a/src/main/java/page/clab/api/domain/auth/blacklistIp/application/service/BlacklistIpResetService.java b/src/main/java/page/clab/api/domain/auth/blacklistIp/application/service/BlacklistIpResetService.java
index cdcf60021..634cae8b5 100644
--- a/src/main/java/page/clab/api/domain/auth/blacklistIp/application/service/BlacklistIpResetService.java
+++ b/src/main/java/page/clab/api/domain/auth/blacklistIp/application/service/BlacklistIpResetService.java
@@ -34,15 +34,15 @@ public class BlacklistIpResetService implements ResetBlacklistIpsUseCase {
@Override
public List resetBlacklistIps(HttpServletRequest request) {
List blacklistedIps = retrieveBlacklistIpPort.findAll()
- .stream()
- .map(BlacklistIp::getIpAddress)
- .toList();
+ .stream()
+ .map(BlacklistIp::getIpAddress)
+ .toList();
removeBlacklistIpPort.deleteAll();
String blacklistRemovedMessage = "Deleted IP: ALL";
eventPublisher.publishEvent(
- new NotificationEvent(this, SecurityAlertType.BLACKLISTED_IP_REMOVED, request,
- blacklistRemovedMessage));
+ new NotificationEvent(this, SecurityAlertType.BLACKLISTED_IP_REMOVED, request,
+ blacklistRemovedMessage));
return blacklistedIps;
}
diff --git a/src/main/java/page/clab/api/domain/auth/blacklistIp/domain/BlacklistIp.java b/src/main/java/page/clab/api/domain/auth/blacklistIp/domain/BlacklistIp.java
index 5a83673ca..55eace952 100644
--- a/src/main/java/page/clab/api/domain/auth/blacklistIp/domain/BlacklistIp.java
+++ b/src/main/java/page/clab/api/domain/auth/blacklistIp/domain/BlacklistIp.java
@@ -1,5 +1,6 @@
package page.clab.api.domain.auth.blacklistIp.domain;
+import java.time.LocalDateTime;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
@@ -7,8 +8,6 @@
import lombok.NoArgsConstructor;
import lombok.Setter;
-import java.time.LocalDateTime;
-
@Getter
@Setter
@Builder
@@ -23,8 +22,8 @@ public class BlacklistIp {
public static BlacklistIp create(String ipAddress, String reason) {
return BlacklistIp.builder()
- .ipAddress(ipAddress)
- .reason(reason)
- .build();
+ .ipAddress(ipAddress)
+ .reason(reason)
+ .build();
}
}
diff --git a/src/main/java/page/clab/api/domain/auth/login/adapter/in/web/MemberLoginController.java b/src/main/java/page/clab/api/domain/auth/login/adapter/in/web/MemberLoginController.java
index 900a1dace..83eaa502d 100644
--- a/src/main/java/page/clab/api/domain/auth/login/adapter/in/web/MemberLoginController.java
+++ b/src/main/java/page/clab/api/domain/auth/login/adapter/in/web/MemberLoginController.java
@@ -28,8 +28,8 @@ public class MemberLoginController {
private final String authHeader;
public MemberLoginController(
- @Qualifier("userLoginService") ManageLoginUseCase manageLoginUseCase,
- @Value("${security.auth.header}") String authHeader
+ @Qualifier("userLoginService") ManageLoginUseCase manageLoginUseCase,
+ @Value("${security.auth.header}") String authHeader
) {
this.manageLoginUseCase = manageLoginUseCase;
this.authHeader = authHeader;
@@ -38,9 +38,9 @@ public MemberLoginController(
@Operation(summary = "멤버 로그인", description = "ROLE_ANONYMOUS 권한이 필요함")
@PostMapping("")
public ApiResponse login(
- HttpServletRequest request,
- HttpServletResponse response,
- @Valid @RequestBody LoginRequestDto requestDto
+ HttpServletRequest request,
+ HttpServletResponse response,
+ @Valid @RequestBody LoginRequestDto requestDto
) throws MemberLockedException, LoginFailedException {
LoginResult result = manageLoginUseCase.login(request, requestDto);
response.setHeader(authHeader, result.getHeader());
@@ -50,8 +50,8 @@ public ApiResponse login(
@Operation(summary = "Guest 로그인", description = "ROLE_ANONYMOUS 권한이 필요함")
@PostMapping("/guest")
public ApiResponse guestLogin(
- HttpServletRequest request,
- HttpServletResponse response
+ HttpServletRequest request,
+ HttpServletResponse response
) {
LoginResult result = manageLoginUseCase.guestLogin(request);
response.setHeader(authHeader, result.getHeader());
diff --git a/src/main/java/page/clab/api/domain/auth/login/adapter/in/web/TokenManagementController.java b/src/main/java/page/clab/api/domain/auth/login/adapter/in/web/TokenManagementController.java
index 87fb86d5e..2a5b7cfe2 100644
--- a/src/main/java/page/clab/api/domain/auth/login/adapter/in/web/TokenManagementController.java
+++ b/src/main/java/page/clab/api/domain/auth/login/adapter/in/web/TokenManagementController.java
@@ -4,6 +4,7 @@
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
+import java.util.List;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -15,8 +16,6 @@
import page.clab.api.domain.auth.login.application.port.in.ManageLoginUseCase;
import page.clab.api.global.common.dto.ApiResponse;
-import java.util.List;
-
@RestController
@RequestMapping("/api/v1/login")
@Tag(name = "Authentication - Token Management", description = "토큰 관리")
@@ -27,8 +26,8 @@ public class TokenManagementController {
private final String authHeader;
public TokenManagementController(
- @Qualifier("tokenManagementService") ManageLoginUseCase manageLoginUseCase,
- @Value("${security.auth.header}") String authHeader
+ @Qualifier("tokenManagementService") ManageLoginUseCase manageLoginUseCase,
+ @Value("${security.auth.header}") String authHeader
) {
this.manageLoginUseCase = manageLoginUseCase;
this.authHeader = authHeader;
@@ -38,8 +37,8 @@ public TokenManagementController(
@PostMapping("/reissue")
@PreAuthorize("hasRole('GUEST')")
public ApiResponse reissueToken(
- HttpServletRequest request,
- HttpServletResponse response
+ HttpServletRequest request,
+ HttpServletResponse response
) {
TokenHeader headerData = manageLoginUseCase.reissueToken(request);
response.setHeader(authHeader, headerData.toJson());
@@ -47,7 +46,7 @@ public ApiResponse reissueToken(
}
@Operation(summary = "[S] 현재 로그인 중인 멤버 조회", description = "ROLE_SUPER 이상의 권한이 필요함
" +
- "Redis에 저장된 토큰을 조회하여 현재 로그인 중인 멤버를 조회합니다.")
+ "Redis에 저장된 토큰을 조회하여 현재 로그인 중인 멤버를 조회합니다.")
@GetMapping("/current")
@PreAuthorize("hasRole('SUPER')")
public ApiResponse> retrieveCurrentLoggedInUsers() {
diff --git a/src/main/java/page/clab/api/domain/auth/login/adapter/in/web/TwoFactorAuthenticationController.java b/src/main/java/page/clab/api/domain/auth/login/adapter/in/web/TwoFactorAuthenticationController.java
index 946e3e5a9..9a8f7fee4 100644
--- a/src/main/java/page/clab/api/domain/auth/login/adapter/in/web/TwoFactorAuthenticationController.java
+++ b/src/main/java/page/clab/api/domain/auth/login/adapter/in/web/TwoFactorAuthenticationController.java
@@ -31,8 +31,8 @@ public class TwoFactorAuthenticationController {
private final String authHeader;
public TwoFactorAuthenticationController(
- @Qualifier("twoFactorAuthenticationService") ManageLoginUseCase manageLoginUseCase,
- @Value("${security.auth.header}") String authHeader
+ @Qualifier("twoFactorAuthenticationService") ManageLoginUseCase manageLoginUseCase,
+ @Value("${security.auth.header}") String authHeader
) {
this.manageLoginUseCase = manageLoginUseCase;
this.authHeader = authHeader;
@@ -41,9 +41,9 @@ public TwoFactorAuthenticationController(
@Operation(summary = "TOTP 인증", description = "ROLE_ANONYMOUS 권한이 필요함")
@PostMapping("")
public ApiResponse authenticate(
- HttpServletRequest request,
- HttpServletResponse response,
- @Valid @RequestBody TwoFactorAuthenticationRequestDto requestDto
+ HttpServletRequest request,
+ HttpServletResponse response,
+ @Valid @RequestBody TwoFactorAuthenticationRequestDto requestDto
) throws MemberLockedException, LoginFailedException {
LoginResult result = manageLoginUseCase.authenticate(request, requestDto);
response.setHeader(authHeader, result.getHeader());
@@ -54,7 +54,7 @@ public ApiResponse authenticate(
@DeleteMapping("/{memberId}")
@PreAuthorize("hasRole('SUPER')")
public ApiResponse resetAuthenticator(
- @PathVariable(name = "memberId") String memberId
+ @PathVariable(name = "memberId") String memberId
) {
String id = manageLoginUseCase.resetAuthenticator(memberId);
return ApiResponse.success(id);
diff --git a/src/main/java/page/clab/api/domain/auth/login/adapter/out/persistence/AuthenticatorPersistenceAdapter.java b/src/main/java/page/clab/api/domain/auth/login/adapter/out/persistence/AuthenticatorPersistenceAdapter.java
index 3fec2bad2..2bd6f5f90 100644
--- a/src/main/java/page/clab/api/domain/auth/login/adapter/out/persistence/AuthenticatorPersistenceAdapter.java
+++ b/src/main/java/page/clab/api/domain/auth/login/adapter/out/persistence/AuthenticatorPersistenceAdapter.java
@@ -1,5 +1,6 @@
package page.clab.api.domain.auth.login.adapter.out.persistence;
+import java.util.Optional;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
import page.clab.api.domain.auth.login.application.port.out.RegisterAuthenticatorPort;
@@ -8,14 +9,12 @@
import page.clab.api.domain.auth.login.domain.Authenticator;
import page.clab.api.global.exception.NotFoundException;
-import java.util.Optional;
-
@Component
@RequiredArgsConstructor
public class AuthenticatorPersistenceAdapter implements
- RegisterAuthenticatorPort,
- RetrieveAuthenticatorPort,
- RemoveAuthenticatorPort {
+ RegisterAuthenticatorPort,
+ RetrieveAuthenticatorPort,
+ RemoveAuthenticatorPort {
private final AuthenticatorRepository authenticatorRepository;
private final AuthenticatorMapper authenticatorMapper;
@@ -35,8 +34,9 @@ public Optional findById(String memberId) {
@Override
public Authenticator getById(String memberId) {
return authenticatorRepository.findById(memberId)
- .map(authenticatorMapper::toDomain)
- .orElseThrow(() -> new NotFoundException("[Authenticator] memberId: " + memberId + "에 해당하는 Authenticator가 존재하지 않습니다."));
+ .map(authenticatorMapper::toDomain)
+ .orElseThrow(() -> new NotFoundException(
+ "[Authenticator] memberId: " + memberId + "에 해당하는 Authenticator가 존재하지 않습니다."));
}
@Override
diff --git a/src/main/java/page/clab/api/domain/auth/login/adapter/out/persistence/AuthenticatorRepository.java b/src/main/java/page/clab/api/domain/auth/login/adapter/out/persistence/AuthenticatorRepository.java
index d376a6517..3d0ccfbdd 100644
--- a/src/main/java/page/clab/api/domain/auth/login/adapter/out/persistence/AuthenticatorRepository.java
+++ b/src/main/java/page/clab/api/domain/auth/login/adapter/out/persistence/AuthenticatorRepository.java
@@ -5,4 +5,5 @@
@Repository
public interface AuthenticatorRepository extends JpaRepository {
+
}
diff --git a/src/main/java/page/clab/api/domain/auth/login/adapter/out/persistence/RedisTokenPersistenceAdapter.java b/src/main/java/page/clab/api/domain/auth/login/adapter/out/persistence/RedisTokenPersistenceAdapter.java
index 18e6540cd..551bf7e42 100644
--- a/src/main/java/page/clab/api/domain/auth/login/adapter/out/persistence/RedisTokenPersistenceAdapter.java
+++ b/src/main/java/page/clab/api/domain/auth/login/adapter/out/persistence/RedisTokenPersistenceAdapter.java
@@ -1,5 +1,7 @@
package page.clab.api.domain.auth.login.adapter.out.persistence;
+import java.util.List;
+import java.util.Optional;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
import page.clab.api.domain.auth.login.application.port.out.RegisterRedisTokenPort;
@@ -7,15 +9,12 @@
import page.clab.api.domain.auth.login.application.port.out.RetrieveRedisTokenPort;
import page.clab.api.domain.auth.login.domain.RedisToken;
-import java.util.List;
-import java.util.Optional;
-
@Component
@RequiredArgsConstructor
public class RedisTokenPersistenceAdapter implements
- RegisterRedisTokenPort,
- RetrieveRedisTokenPort,
- RemoveRedisTokenPort {
+ RegisterRedisTokenPort,
+ RetrieveRedisTokenPort,
+ RemoveRedisTokenPort {
private final RedisTokenRepository redisTokenRepository;
diff --git a/src/main/java/page/clab/api/domain/auth/login/adapter/out/persistence/RedisTokenRepository.java b/src/main/java/page/clab/api/domain/auth/login/adapter/out/persistence/RedisTokenRepository.java
index c4b01a6ec..d3200775d 100644
--- a/src/main/java/page/clab/api/domain/auth/login/adapter/out/persistence/RedisTokenRepository.java
+++ b/src/main/java/page/clab/api/domain/auth/login/adapter/out/persistence/RedisTokenRepository.java
@@ -1,11 +1,10 @@
package page.clab.api.domain.auth.login.adapter.out.persistence;
+import java.util.Optional;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
import page.clab.api.domain.auth.login.domain.RedisToken;
-import java.util.Optional;
-
@Repository
public interface RedisTokenRepository extends CrudRepository {
diff --git a/src/main/java/page/clab/api/domain/auth/login/application/dto/response/TokenInfo.java b/src/main/java/page/clab/api/domain/auth/login/application/dto/response/TokenInfo.java
index e2742e5a0..e9ce5b44a 100644
--- a/src/main/java/page/clab/api/domain/auth/login/application/dto/response/TokenInfo.java
+++ b/src/main/java/page/clab/api/domain/auth/login/application/dto/response/TokenInfo.java
@@ -15,8 +15,8 @@ public class TokenInfo {
public static TokenInfo create(String accessToken, String refreshToken) {
return TokenInfo.builder()
- .accessToken(accessToken)
- .refreshToken(refreshToken)
- .build();
+ .accessToken(accessToken)
+ .refreshToken(refreshToken)
+ .build();
}
}
diff --git a/src/main/java/page/clab/api/domain/auth/login/application/port/in/ManageLoginUseCase.java b/src/main/java/page/clab/api/domain/auth/login/application/port/in/ManageLoginUseCase.java
index 86b562ec4..8b1ae49da 100644
--- a/src/main/java/page/clab/api/domain/auth/login/application/port/in/ManageLoginUseCase.java
+++ b/src/main/java/page/clab/api/domain/auth/login/application/port/in/ManageLoginUseCase.java
@@ -1,6 +1,7 @@
package page.clab.api.domain.auth.login.application.port.in;
import jakarta.servlet.http.HttpServletRequest;
+import java.util.List;
import page.clab.api.domain.auth.login.application.dto.request.LoginRequestDto;
import page.clab.api.domain.auth.login.application.dto.request.TwoFactorAuthenticationRequestDto;
import page.clab.api.domain.auth.login.application.dto.response.LoginResult;
@@ -8,13 +9,13 @@
import page.clab.api.domain.auth.login.application.exception.LoginFailedException;
import page.clab.api.domain.auth.login.application.exception.MemberLockedException;
-import java.util.List;
-
public interface ManageLoginUseCase {
- LoginResult login(HttpServletRequest request, LoginRequestDto requestDto) throws LoginFailedException, MemberLockedException;
+ LoginResult login(HttpServletRequest request, LoginRequestDto requestDto)
+ throws LoginFailedException, MemberLockedException;
- LoginResult authenticate(HttpServletRequest request, TwoFactorAuthenticationRequestDto requestDto) throws LoginFailedException, MemberLockedException;
+ LoginResult authenticate(HttpServletRequest request, TwoFactorAuthenticationRequestDto requestDto)
+ throws LoginFailedException, MemberLockedException;
String resetAuthenticator(String memberId);
diff --git a/src/main/java/page/clab/api/domain/auth/login/application/port/in/ManageRedisTokenUseCase.java b/src/main/java/page/clab/api/domain/auth/login/application/port/in/ManageRedisTokenUseCase.java
index 4e008c8aa..1bea743d7 100644
--- a/src/main/java/page/clab/api/domain/auth/login/application/port/in/ManageRedisTokenUseCase.java
+++ b/src/main/java/page/clab/api/domain/auth/login/application/port/in/ManageRedisTokenUseCase.java
@@ -1,11 +1,10 @@
package page.clab.api.domain.auth.login.application.port.in;
+import java.util.List;
import page.clab.api.domain.auth.login.application.dto.response.TokenInfo;
import page.clab.api.domain.auth.login.domain.RedisToken;
import page.clab.api.domain.memberManagement.member.domain.Role;
-import java.util.List;
-
public interface ManageRedisTokenUseCase {
RedisToken findByAccessToken(String accessToken);
diff --git a/src/main/java/page/clab/api/domain/auth/login/application/port/out/RegisterAuthenticatorPort.java b/src/main/java/page/clab/api/domain/auth/login/application/port/out/RegisterAuthenticatorPort.java
index 0520da10c..e4ce921c6 100644
--- a/src/main/java/page/clab/api/domain/auth/login/application/port/out/RegisterAuthenticatorPort.java
+++ b/src/main/java/page/clab/api/domain/auth/login/application/port/out/RegisterAuthenticatorPort.java
@@ -3,5 +3,6 @@
import page.clab.api.domain.auth.login.domain.Authenticator;
public interface RegisterAuthenticatorPort {
+
Authenticator save(Authenticator authenticator);
}
diff --git a/src/main/java/page/clab/api/domain/auth/login/application/port/out/RegisterRedisTokenPort.java b/src/main/java/page/clab/api/domain/auth/login/application/port/out/RegisterRedisTokenPort.java
index 7ebefd085..4aed8d8dc 100644
--- a/src/main/java/page/clab/api/domain/auth/login/application/port/out/RegisterRedisTokenPort.java
+++ b/src/main/java/page/clab/api/domain/auth/login/application/port/out/RegisterRedisTokenPort.java
@@ -3,5 +3,6 @@
import page.clab.api.domain.auth.login.domain.RedisToken;
public interface RegisterRedisTokenPort {
+
RedisToken save(RedisToken redisToken);
}
diff --git a/src/main/java/page/clab/api/domain/auth/login/application/port/out/RemoveAuthenticatorPort.java b/src/main/java/page/clab/api/domain/auth/login/application/port/out/RemoveAuthenticatorPort.java
index 688a36979..f193e8453 100644
--- a/src/main/java/page/clab/api/domain/auth/login/application/port/out/RemoveAuthenticatorPort.java
+++ b/src/main/java/page/clab/api/domain/auth/login/application/port/out/RemoveAuthenticatorPort.java
@@ -3,5 +3,6 @@
import page.clab.api.domain.auth.login.domain.Authenticator;
public interface RemoveAuthenticatorPort {
+
void delete(Authenticator authenticator);
}
diff --git a/src/main/java/page/clab/api/domain/auth/login/application/port/out/RetrieveAuthenticatorPort.java b/src/main/java/page/clab/api/domain/auth/login/application/port/out/RetrieveAuthenticatorPort.java
index 988e37d88..57a662255 100644
--- a/src/main/java/page/clab/api/domain/auth/login/application/port/out/RetrieveAuthenticatorPort.java
+++ b/src/main/java/page/clab/api/domain/auth/login/application/port/out/RetrieveAuthenticatorPort.java
@@ -1,8 +1,7 @@
package page.clab.api.domain.auth.login.application.port.out;
-import page.clab.api.domain.auth.login.domain.Authenticator;
-
import java.util.Optional;
+import page.clab.api.domain.auth.login.domain.Authenticator;
public interface RetrieveAuthenticatorPort {
diff --git a/src/main/java/page/clab/api/domain/auth/login/application/port/out/RetrieveRedisTokenPort.java b/src/main/java/page/clab/api/domain/auth/login/application/port/out/RetrieveRedisTokenPort.java
index cf83c4192..fdd7d36e9 100644
--- a/src/main/java/page/clab/api/domain/auth/login/application/port/out/RetrieveRedisTokenPort.java
+++ b/src/main/java/page/clab/api/domain/auth/login/application/port/out/RetrieveRedisTokenPort.java
@@ -1,9 +1,8 @@
package page.clab.api.domain.auth.login.application.port.out;
-import page.clab.api.domain.auth.login.domain.RedisToken;
-
import java.util.List;
import java.util.Optional;
+import page.clab.api.domain.auth.login.domain.RedisToken;
public interface RetrieveRedisTokenPort {
diff --git a/src/main/java/page/clab/api/domain/auth/login/application/service/RedisTokenManagementService.java b/src/main/java/page/clab/api/domain/auth/login/application/service/RedisTokenManagementService.java
index 7aeab8c8d..c188dd054 100644
--- a/src/main/java/page/clab/api/domain/auth/login/application/service/RedisTokenManagementService.java
+++ b/src/main/java/page/clab/api/domain/auth/login/application/service/RedisTokenManagementService.java
@@ -1,5 +1,9 @@
package page.clab.api.domain.auth.login.application.service;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+import java.util.stream.StreamSupport;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import page.clab.api.domain.auth.login.application.dto.response.TokenInfo;
@@ -12,11 +16,6 @@
import page.clab.api.global.auth.exception.TokenNotFoundException;
import page.clab.api.global.auth.jwt.JwtTokenProvider;
-import java.util.List;
-import java.util.Objects;
-import java.util.stream.Collectors;
-import java.util.stream.StreamSupport;
-
@Service
@RequiredArgsConstructor
public class RedisTokenManagementService implements ManageRedisTokenUseCase {
@@ -28,22 +27,22 @@ public class RedisTokenManagementService implements ManageRedisTokenUseCase {
public RedisToken findByAccessToken(String accessToken) {
return retrieveRedisTokenPort.findByAccessToken(accessToken)
- .orElseThrow(() -> new TokenNotFoundException("존재하지 않는 토큰입니다."));
+ .orElseThrow(() -> new TokenNotFoundException("존재하지 않는 토큰입니다."));
}
public RedisToken findByRefreshToken(String refreshToken) {
return retrieveRedisTokenPort.findByRefreshToken(refreshToken)
- .orElseThrow(() -> new TokenNotFoundException("존재하지 않는 토큰입니다."));
+ .orElseThrow(() -> new TokenNotFoundException("존재하지 않는 토큰입니다."));
}
public List getCurrentLoggedInUsers() {
Iterable iterableTokens = retrieveRedisTokenPort.findAll();
return StreamSupport.stream(iterableTokens.spliterator(), false)
- .filter(Objects::nonNull)
- .filter(redisToken -> jwtTokenProvider.validateTokenSilently(redisToken.getAccessToken()))
- .map(RedisToken::getMemberId)
- .distinct()
- .collect(Collectors.toList());
+ .filter(Objects::nonNull)
+ .filter(redisToken -> jwtTokenProvider.validateTokenSilently(redisToken.getAccessToken()))
+ .map(RedisToken::getMemberId)
+ .distinct()
+ .collect(Collectors.toList());
}
public void saveToken(String memberId, Role role, TokenInfo tokenInfo, String ip) {
@@ -53,6 +52,6 @@ public void saveToken(String memberId, Role role, TokenInfo tokenInfo, String ip
public void deleteByAccessToken(String accessToken) {
retrieveRedisTokenPort.findByAccessToken(accessToken)
- .ifPresent(removeRedisTokenPort::delete);
+ .ifPresent(removeRedisTokenPort::delete);
}
}
diff --git a/src/main/java/page/clab/api/domain/auth/login/application/service/TokenManagementService.java b/src/main/java/page/clab/api/domain/auth/login/application/service/TokenManagementService.java
index 631378efc..a8d57caa0 100644
--- a/src/main/java/page/clab/api/domain/auth/login/application/service/TokenManagementService.java
+++ b/src/main/java/page/clab/api/domain/auth/login/application/service/TokenManagementService.java
@@ -1,6 +1,7 @@
package page.clab.api.domain.auth.login.application.service;
import jakarta.servlet.http.HttpServletRequest;
+import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.security.core.Authentication;
@@ -22,8 +23,6 @@
import page.clab.api.global.auth.jwt.JwtTokenProvider;
import page.clab.api.global.util.HttpReqResUtil;
-import java.util.List;
-
@Service
@RequiredArgsConstructor
@Qualifier("tokenManagementService")
@@ -44,7 +43,8 @@ public TokenHeader reissueToken(HttpServletRequest request) {
validateToken(redisToken);
TokenInfo newTokenInfo = jwtTokenProvider.generateToken(redisToken.getMemberId(), redisToken.getRole());
- manageRedisTokenUseCase.saveToken(redisToken.getMemberId(), redisToken.getRole(), newTokenInfo, redisToken.getIp());
+ manageRedisTokenUseCase.saveToken(redisToken.getMemberId(), redisToken.getRole(), newTokenInfo,
+ redisToken.getIp());
return TokenHeader.create(newTokenInfo);
}
@@ -74,12 +74,14 @@ private void validateToken(RedisToken redisToken) {
}
@Override
- public LoginResult login(HttpServletRequest request, LoginRequestDto requestDto) throws LoginFailedException, MemberLockedException {
+ public LoginResult login(HttpServletRequest request, LoginRequestDto requestDto)
+ throws LoginFailedException, MemberLockedException {
throw new UnsupportedOperationException("Method not implemented");
}
@Override
- public LoginResult authenticate(HttpServletRequest request, TwoFactorAuthenticationRequestDto requestDto) throws LoginFailedException, MemberLockedException {
+ public LoginResult authenticate(HttpServletRequest request, TwoFactorAuthenticationRequestDto requestDto)
+ throws LoginFailedException, MemberLockedException {
throw new UnsupportedOperationException("Method not implemented");
}
diff --git a/src/main/java/page/clab/api/domain/auth/login/application/service/TwoFactorAuthenticationService.java b/src/main/java/page/clab/api/domain/auth/login/application/service/TwoFactorAuthenticationService.java
index 402cf4ee7..35df7605e 100644
--- a/src/main/java/page/clab/api/domain/auth/login/application/service/TwoFactorAuthenticationService.java
+++ b/src/main/java/page/clab/api/domain/auth/login/application/service/TwoFactorAuthenticationService.java
@@ -43,8 +43,8 @@ public class TwoFactorAuthenticationService implements ManageLoginUseCase {
@Transactional
@Override
public LoginResult authenticate(HttpServletRequest request,
- TwoFactorAuthenticationRequestDto twoFactorAuthenticationRequestDto)
- throws LoginFailedException, MemberLockedException {
+ TwoFactorAuthenticationRequestDto twoFactorAuthenticationRequestDto)
+ throws LoginFailedException, MemberLockedException {
String memberId = twoFactorAuthenticationRequestDto.getMemberId();
MemberLoginInfoDto loginMember = externalRetrieveMemberUseCase.getMemberLoginInfoById(memberId);
String totp = twoFactorAuthenticationRequestDto.getTotp();
@@ -59,10 +59,10 @@ public LoginResult authenticate(HttpServletRequest request,
}
private void verifyTwoFactorAuthentication(String memberId, String totp, HttpServletRequest request)
- throws MemberLockedException, LoginFailedException {
+ throws MemberLockedException, LoginFailedException {
if (!manageAuthenticatorUseCase.isAuthenticatorValid(memberId, totp)) {
externalRegisterAccountAccessLogUseCase.registerAccountAccessLog(request, memberId,
- AccountAccessResult.FAILURE);
+ AccountAccessResult.FAILURE);
externalManageAccountLockUseCase.handleLoginFailure(request, memberId);
throw new LoginFailedException("잘못된 인증번호입니다.");
}
@@ -73,20 +73,20 @@ private TokenInfo generateAndSaveToken(MemberLoginInfoDto memberInfo) {
TokenInfo tokenInfo = jwtTokenProvider.generateToken(memberInfo.getMemberId(), memberInfo.getRole());
String clientIpAddress = HttpReqResUtil.getClientIpAddressIfServletRequestExist();
externalManageRedisTokenUseCase.saveToken(memberInfo.getMemberId(), memberInfo.getRole(), tokenInfo,
- clientIpAddress);
+ clientIpAddress);
return tokenInfo;
}
private void sendAdminLoginNotification(HttpServletRequest request, MemberLoginInfoDto loginMember) {
if (loginMember.isSuperAdminRole()) {
eventPublisher.publishEvent(
- new NotificationEvent(this, GeneralAlertType.ADMIN_LOGIN, request, loginMember));
+ new NotificationEvent(this, GeneralAlertType.ADMIN_LOGIN, request, loginMember));
}
}
@Override
public LoginResult login(HttpServletRequest request, LoginRequestDto requestDto)
- throws LoginFailedException, MemberLockedException {
+ throws LoginFailedException, MemberLockedException {
throw new UnsupportedOperationException("Method not implemented");
}
diff --git a/src/main/java/page/clab/api/domain/auth/login/application/service/UserLoginService.java b/src/main/java/page/clab/api/domain/auth/login/application/service/UserLoginService.java
index 5358b85ee..53c1d597c 100644
--- a/src/main/java/page/clab/api/domain/auth/login/application/service/UserLoginService.java
+++ b/src/main/java/page/clab/api/domain/auth/login/application/service/UserLoginService.java
@@ -1,6 +1,8 @@
package page.clab.api.domain.auth.login.application.service;
import jakarta.servlet.http.HttpServletRequest;
+import java.util.List;
+import java.util.Optional;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.security.authentication.AuthenticationManager;
@@ -28,9 +30,6 @@
import page.clab.api.global.auth.jwt.JwtTokenProvider;
import page.clab.api.global.util.HttpReqResUtil;
-import java.util.List;
-import java.util.Optional;
-
@Service
@RequiredArgsConstructor
@Qualifier("userLoginService")
@@ -49,7 +48,8 @@ public class UserLoginService implements ManageLoginUseCase {
@Transactional
@Override
- public LoginResult login(HttpServletRequest request, LoginRequestDto requestDto) throws LoginFailedException, MemberLockedException {
+ public LoginResult login(HttpServletRequest request, LoginRequestDto requestDto)
+ throws LoginFailedException, MemberLockedException {
authenticateAndCheckStatus(request, requestDto);
registerAccountAccessLog(request, requestDto.getId(), true);
MemberLoginInfoDto loginMember = externalRetrieveMemberUseCase.getMemberLoginInfoById(requestDto.getId());
@@ -61,15 +61,17 @@ public LoginResult login(HttpServletRequest request, LoginRequestDto requestDto)
@Override
public LoginResult guestLogin(HttpServletRequest request) {
MemberLoginInfoDto guestMember = externalRetrieveMemberUseCase.getGuestMemberLoginInfo();
- registerAccountAccessLogUseCase.registerAccountAccessLog(request, guestMember.getMemberId(), AccountAccessResult.SUCCESS);
+ registerAccountAccessLogUseCase.registerAccountAccessLog(request, guestMember.getMemberId(),
+ AccountAccessResult.SUCCESS);
externalUpdateMemberUseCase.updateLastLoginTime(guestMember.getMemberId());
return generateLoginResult(guestMember);
}
- private void authenticateAndCheckStatus(HttpServletRequest httpServletRequest, LoginRequestDto loginRequestDto) throws LoginFailedException, MemberLockedException {
+ private void authenticateAndCheckStatus(HttpServletRequest httpServletRequest, LoginRequestDto loginRequestDto)
+ throws LoginFailedException, MemberLockedException {
try {
UsernamePasswordAuthenticationToken authenticationToken =
- new UsernamePasswordAuthenticationToken(loginRequestDto.getId(), loginRequestDto.getPassword());
+ new UsernamePasswordAuthenticationToken(loginRequestDto.getId(), loginRequestDto.getPassword());
loginAuthenticationManager.authenticate(authenticationToken);
externalManageAccountLockUseCase.handleAccountLockInfo(loginRequestDto.getId());
} catch (BadCredentialsException e) {
diff --git a/src/main/java/page/clab/api/domain/auth/login/domain/Authenticator.java b/src/main/java/page/clab/api/domain/auth/login/domain/Authenticator.java
index 4e348e9d8..c867cf91c 100644
--- a/src/main/java/page/clab/api/domain/auth/login/domain/Authenticator.java
+++ b/src/main/java/page/clab/api/domain/auth/login/domain/Authenticator.java
@@ -17,8 +17,8 @@ public class Authenticator {
public static Authenticator create(String memberId, String secretKey) {
return Authenticator.builder()
- .memberId(memberId)
- .secretKey(secretKey)
- .build();
+ .memberId(memberId)
+ .secretKey(secretKey)
+ .build();
}
}
diff --git a/src/main/java/page/clab/api/domain/auth/login/domain/RedisToken.java b/src/main/java/page/clab/api/domain/auth/login/domain/RedisToken.java
index 1c71e502a..dfc3aeb74 100644
--- a/src/main/java/page/clab/api/domain/auth/login/domain/RedisToken.java
+++ b/src/main/java/page/clab/api/domain/auth/login/domain/RedisToken.java
@@ -1,6 +1,7 @@
package page.clab.api.domain.auth.login.domain;
import jakarta.persistence.Id;
+import java.util.UUID;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
@@ -12,8 +13,6 @@
import page.clab.api.domain.auth.login.application.dto.response.TokenInfo;
import page.clab.api.domain.memberManagement.member.domain.Role;
-import java.util.UUID;
-
@Getter
@Setter
@Builder
@@ -36,13 +35,13 @@ public class RedisToken {
public static RedisToken create(String memberId, Role role, String ip, TokenInfo tokenInfo) {
return RedisToken.builder()
- .id(UUID.randomUUID())
- .memberId(memberId)
- .role(role)
- .ip(ip)
- .accessToken(tokenInfo.getAccessToken())
- .refreshToken(tokenInfo.getRefreshToken())
- .build();
+ .id(UUID.randomUUID())
+ .memberId(memberId)
+ .role(role)
+ .ip(ip)
+ .accessToken(tokenInfo.getAccessToken())
+ .refreshToken(tokenInfo.getRefreshToken())
+ .build();
}
public boolean isSameIp(String ip) {
diff --git a/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/adapter/in/web/AbnormalAccessIpRemoveController.java b/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/adapter/in/web/AbnormalAccessIpRemoveController.java
index 9759991e7..5b550c3a2 100644
--- a/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/adapter/in/web/AbnormalAccessIpRemoveController.java
+++ b/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/adapter/in/web/AbnormalAccessIpRemoveController.java
@@ -21,12 +21,12 @@ public class AbnormalAccessIpRemoveController {
private final RemoveAbnormalAccessIpUseCase removeAbnormalAccessIpUseCase;
@Operation(summary = "[S] 비정상 접근 IP 기록 삭제", description = "ROLE_SUPER 이상의 권한이 필요함
" +
- "지속적인 비정상 접근으로 인해 차단된 IP를 삭제")
+ "지속적인 비정상 접근으로 인해 차단된 IP를 삭제")
@PreAuthorize("hasRole('SUPER')")
@DeleteMapping("/abnormal-access")
public ApiResponse removeAbnormalAccessBlacklistIp(
- HttpServletRequest request,
- @RequestParam(name = "ipAddress") String ipAddress
+ HttpServletRequest request,
+ @RequestParam(name = "ipAddress") String ipAddress
) {
String deletedIp = removeAbnormalAccessIpUseCase.removeAbnormalAccessIp(request, ipAddress);
return ApiResponse.success(deletedIp);
diff --git a/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/adapter/in/web/AbnormalAccessIpsClearController.java b/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/adapter/in/web/AbnormalAccessIpsClearController.java
index ea7e8dd77..815d6123f 100644
--- a/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/adapter/in/web/AbnormalAccessIpsClearController.java
+++ b/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/adapter/in/web/AbnormalAccessIpsClearController.java
@@ -3,6 +3,7 @@
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletRequest;
+import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
@@ -12,8 +13,6 @@
import page.clab.api.domain.auth.redisIpAccessMonitor.domain.RedisIpAccessMonitor;
import page.clab.api.global.common.dto.ApiResponse;
-import java.util.List;
-
@RestController
@RequestMapping("/api/v1/ip-access-monitor")
@RequiredArgsConstructor
@@ -23,11 +22,11 @@ public class AbnormalAccessIpsClearController {
private final ClearAbnormalAccessIpsUseCase clearAbnormalAccessIpsUseCase;
@Operation(summary = "[S] 비정상 접근 IP 기록 초기화", description = "ROLE_SUPER 이상의 권한이 필요함
" +
- "지속적인 비정상 접근으로 인해 차단된 IP를 모두 삭제")
+ "지속적인 비정상 접근으로 인해 차단된 IP를 모두 삭제")
@PreAuthorize("hasRole('SUPER')")
@DeleteMapping("/abnormal-access/clear")
public ApiResponse> clearAbnormalAccessBlacklist(
- HttpServletRequest request
+ HttpServletRequest request
) {
List ipAccessMonitors = clearAbnormalAccessIpsUseCase.clearAbnormalAccessIps(request);
return ApiResponse.success(ipAccessMonitors);
diff --git a/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/adapter/in/web/AbnormalAccessIpsRetrieveController.java b/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/adapter/in/web/AbnormalAccessIpsRetrieveController.java
index 2cf1b453f..702e75667 100644
--- a/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/adapter/in/web/AbnormalAccessIpsRetrieveController.java
+++ b/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/adapter/in/web/AbnormalAccessIpsRetrieveController.java
@@ -24,15 +24,16 @@ public class AbnormalAccessIpsRetrieveController {
private final RetrieveAbnormalAccessIpsUseCase retrieveAbnormalAccessIpsUseCase;
@Operation(summary = "[S] 비정상 접근으로 인한 차단 IP 목록 조회", description = "ROLE_SUPER 이상의 권한이 필요함
" +
- "지속적인 비정상 접근으로 인해 Redis에 추가된 IP를 조회")
+ "지속적인 비정상 접근으로 인해 Redis에 추가된 IP를 조회")
@PreAuthorize("hasRole('SUPER')")
@GetMapping("/abnormal-access")
public ApiResponse> retrieveAbnormalAccessBlacklistIps(
- @RequestParam(name = "page", defaultValue = "0") int page,
- @RequestParam(name = "size", defaultValue = "20") int size
+ @RequestParam(name = "page", defaultValue = "0") int page,
+ @RequestParam(name = "size", defaultValue = "20") int size
) {
Pageable pageable = PageRequest.of(page, size);
- PagedResponseDto abnormalAccessBlacklistIps = retrieveAbnormalAccessIpsUseCase.retrieveAbnormalAccessIps(pageable);
+ PagedResponseDto abnormalAccessBlacklistIps = retrieveAbnormalAccessIpsUseCase.retrieveAbnormalAccessIps(
+ pageable);
return ApiResponse.success(abnormalAccessBlacklistIps);
}
}
diff --git a/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/adapter/out/persistence/RedisIpAccessMonitorAdapter.java b/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/adapter/out/persistence/RedisIpAccessMonitorAdapter.java
index 9b9222008..caeef134b 100644
--- a/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/adapter/out/persistence/RedisIpAccessMonitorAdapter.java
+++ b/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/adapter/out/persistence/RedisIpAccessMonitorAdapter.java
@@ -1,5 +1,8 @@
package page.clab.api.domain.auth.redisIpAccessMonitor.adapter.out.persistence;
+import java.util.List;
+import java.util.Optional;
+import java.util.stream.StreamSupport;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
import page.clab.api.domain.auth.redisIpAccessMonitor.application.port.out.ClearIpAccessMonitorPort;
@@ -8,17 +11,13 @@
import page.clab.api.domain.auth.redisIpAccessMonitor.application.port.out.RetrieveIpAccessMonitorPort;
import page.clab.api.domain.auth.redisIpAccessMonitor.domain.RedisIpAccessMonitor;
-import java.util.List;
-import java.util.Optional;
-import java.util.stream.StreamSupport;
-
@Component
@RequiredArgsConstructor
public class RedisIpAccessMonitorAdapter implements
- RegisterIpAccessMonitorPort,
- RetrieveIpAccessMonitorPort,
- RemoveIpAccessMonitorPort,
- ClearIpAccessMonitorPort {
+ RegisterIpAccessMonitorPort,
+ RetrieveIpAccessMonitorPort,
+ RemoveIpAccessMonitorPort,
+ ClearIpAccessMonitorPort {
private final RedisIpAccessMonitorRepository repository;
@@ -30,7 +29,7 @@ public Optional findById(String ipAddress) {
@Override
public void deleteById(String ipAddress) {
repository.findById(ipAddress)
- .ifPresent(repository::delete);
+ .ifPresent(repository::delete);
}
@Override
@@ -40,8 +39,8 @@ public void deleteAll() {
public List findAll() {
return StreamSupport
- .stream(repository.findAll().spliterator(), false)
- .toList();
+ .stream(repository.findAll().spliterator(), false)
+ .toList();
}
@Override
diff --git a/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/adapter/out/persistence/RedisIpAccessMonitorRepository.java b/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/adapter/out/persistence/RedisIpAccessMonitorRepository.java
index f9652abf7..0bd8172dc 100644
--- a/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/adapter/out/persistence/RedisIpAccessMonitorRepository.java
+++ b/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/adapter/out/persistence/RedisIpAccessMonitorRepository.java
@@ -6,4 +6,5 @@
@Repository
public interface RedisIpAccessMonitorRepository extends CrudRepository {
+
}
diff --git a/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/port/in/ClearAbnormalAccessIpsUseCase.java b/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/port/in/ClearAbnormalAccessIpsUseCase.java
index 9caa1407c..c4dc825a6 100644
--- a/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/port/in/ClearAbnormalAccessIpsUseCase.java
+++ b/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/port/in/ClearAbnormalAccessIpsUseCase.java
@@ -1,10 +1,10 @@
package page.clab.api.domain.auth.redisIpAccessMonitor.application.port.in;
import jakarta.servlet.http.HttpServletRequest;
-import page.clab.api.domain.auth.redisIpAccessMonitor.domain.RedisIpAccessMonitor;
-
import java.util.List;
+import page.clab.api.domain.auth.redisIpAccessMonitor.domain.RedisIpAccessMonitor;
public interface ClearAbnormalAccessIpsUseCase {
+
List clearAbnormalAccessIps(HttpServletRequest request);
}
diff --git a/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/port/in/RemoveAbnormalAccessIpUseCase.java b/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/port/in/RemoveAbnormalAccessIpUseCase.java
index f0ac753d4..ed7ad12f0 100644
--- a/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/port/in/RemoveAbnormalAccessIpUseCase.java
+++ b/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/port/in/RemoveAbnormalAccessIpUseCase.java
@@ -3,5 +3,6 @@
import jakarta.servlet.http.HttpServletRequest;
public interface RemoveAbnormalAccessIpUseCase {
+
String removeAbnormalAccessIp(HttpServletRequest request, String ipAddress);
}
diff --git a/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/port/in/RetrieveAbnormalAccessIpsUseCase.java b/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/port/in/RetrieveAbnormalAccessIpsUseCase.java
index a5a9f5e6a..c2201d6ea 100644
--- a/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/port/in/RetrieveAbnormalAccessIpsUseCase.java
+++ b/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/port/in/RetrieveAbnormalAccessIpsUseCase.java
@@ -5,5 +5,6 @@
import page.clab.api.global.common.dto.PagedResponseDto;
public interface RetrieveAbnormalAccessIpsUseCase {
+
PagedResponseDto retrieveAbnormalAccessIps(Pageable pageable);
}
diff --git a/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/port/out/ClearIpAccessMonitorPort.java b/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/port/out/ClearIpAccessMonitorPort.java
index a0397a9a9..f51b5bafd 100644
--- a/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/port/out/ClearIpAccessMonitorPort.java
+++ b/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/port/out/ClearIpAccessMonitorPort.java
@@ -1,5 +1,6 @@
package page.clab.api.domain.auth.redisIpAccessMonitor.application.port.out;
public interface ClearIpAccessMonitorPort {
+
void deleteAll();
}
diff --git a/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/port/out/RegisterIpAccessMonitorPort.java b/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/port/out/RegisterIpAccessMonitorPort.java
index cff2bdb3d..13721f3c5 100644
--- a/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/port/out/RegisterIpAccessMonitorPort.java
+++ b/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/port/out/RegisterIpAccessMonitorPort.java
@@ -3,5 +3,6 @@
import page.clab.api.domain.auth.redisIpAccessMonitor.domain.RedisIpAccessMonitor;
public interface RegisterIpAccessMonitorPort {
+
void save(RedisIpAccessMonitor redisIpAccessMonitor);
}
diff --git a/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/port/out/RemoveIpAccessMonitorPort.java b/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/port/out/RemoveIpAccessMonitorPort.java
index 226fa293f..b960f80c4 100644
--- a/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/port/out/RemoveIpAccessMonitorPort.java
+++ b/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/port/out/RemoveIpAccessMonitorPort.java
@@ -1,5 +1,6 @@
package page.clab.api.domain.auth.redisIpAccessMonitor.application.port.out;
public interface RemoveIpAccessMonitorPort {
+
void deleteById(String ipAddress);
}
diff --git a/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/port/out/RetrieveIpAccessMonitorPort.java b/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/port/out/RetrieveIpAccessMonitorPort.java
index 877213369..f2a54347a 100644
--- a/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/port/out/RetrieveIpAccessMonitorPort.java
+++ b/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/port/out/RetrieveIpAccessMonitorPort.java
@@ -1,9 +1,8 @@
package page.clab.api.domain.auth.redisIpAccessMonitor.application.port.out;
-import page.clab.api.domain.auth.redisIpAccessMonitor.domain.RedisIpAccessMonitor;
-
import java.util.List;
import java.util.Optional;
+import page.clab.api.domain.auth.redisIpAccessMonitor.domain.RedisIpAccessMonitor;
public interface RetrieveIpAccessMonitorPort {
diff --git a/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/service/AbnormalAccessIpRemoveService.java b/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/service/AbnormalAccessIpRemoveService.java
index a31e7ee8a..37ef0d425 100644
--- a/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/service/AbnormalAccessIpRemoveService.java
+++ b/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/service/AbnormalAccessIpRemoveService.java
@@ -23,8 +23,8 @@ public String removeAbnormalAccessIp(HttpServletRequest request, String ipAddres
removeIpAccessMonitorPort.deleteById(ipAddress);
String abnormalAccessIpDeletedMessage = "Deleted IP: " + ipAddress;
eventPublisher.publishEvent(
- new NotificationEvent(this, SecurityAlertType.ABNORMAL_ACCESS_IP_DELETED, request,
- abnormalAccessIpDeletedMessage));
+ new NotificationEvent(this, SecurityAlertType.ABNORMAL_ACCESS_IP_DELETED, request,
+ abnormalAccessIpDeletedMessage));
return ipAddress;
}
}
diff --git a/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/service/AbnormalAccessIpsClearService.java b/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/service/AbnormalAccessIpsClearService.java
index f347f2644..84e3877b3 100644
--- a/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/service/AbnormalAccessIpsClearService.java
+++ b/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/service/AbnormalAccessIpsClearService.java
@@ -29,8 +29,8 @@ public List clearAbnormalAccessIps(HttpServletRequest requ
String abnormalAccessIpClearedMessage = "Deleted IP: ALL";
eventPublisher.publishEvent(
- new NotificationEvent(this, SecurityAlertType.ABNORMAL_ACCESS_IP_DELETED, request,
- abnormalAccessIpClearedMessage));
+ new NotificationEvent(this, SecurityAlertType.ABNORMAL_ACCESS_IP_DELETED, request,
+ abnormalAccessIpClearedMessage));
return ipAccessMonitors;
}
diff --git a/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/service/AbnormalAccessIpsRetrieveService.java b/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/service/AbnormalAccessIpsRetrieveService.java
index 923e354cc..5f4a32416 100644
--- a/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/service/AbnormalAccessIpsRetrieveService.java
+++ b/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/application/service/AbnormalAccessIpsRetrieveService.java
@@ -1,5 +1,8 @@
package page.clab.api.domain.auth.redisIpAccessMonitor.application.service;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Objects;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
@@ -9,10 +12,6 @@
import page.clab.api.domain.auth.redisIpAccessMonitor.domain.RedisIpAccessMonitor;
import page.clab.api.global.common.dto.PagedResponseDto;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Objects;
-
@Service
@RequiredArgsConstructor
public class AbnormalAccessIpsRetrieveService implements RetrieveAbnormalAccessIpsUseCase {
@@ -24,10 +23,10 @@ public class AbnormalAccessIpsRetrieveService implements RetrieveAbnormalAccessI
public PagedResponseDto retrieveAbnormalAccessIps(Pageable pageable) {
List allMonitors = retrieveIpAccessMonitorPort.findAll();
List filteredMonitors = allMonitors.stream()
- .filter(Objects::nonNull)
- .filter(RedisIpAccessMonitor::isBlocked)
- .sorted(Comparator.comparing(RedisIpAccessMonitor::getLastAttempt).reversed())
- .toList();
+ .filter(Objects::nonNull)
+ .filter(RedisIpAccessMonitor::isBlocked)
+ .sorted(Comparator.comparing(RedisIpAccessMonitor::getLastAttempt).reversed())
+ .toList();
return new PagedResponseDto<>(filteredMonitors, pageable, filteredMonitors.size());
}
}
diff --git a/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/domain/RedisIpAccessMonitor.java b/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/domain/RedisIpAccessMonitor.java
index 984c301fa..66f31efb5 100644
--- a/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/domain/RedisIpAccessMonitor.java
+++ b/src/main/java/page/clab/api/domain/auth/redisIpAccessMonitor/domain/RedisIpAccessMonitor.java
@@ -1,6 +1,7 @@
package page.clab.api.domain.auth.redisIpAccessMonitor.domain;
import jakarta.persistence.Column;
+import java.time.LocalDateTime;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
@@ -11,8 +12,6 @@
import org.springframework.data.redis.core.RedisHash;
import org.springframework.data.redis.core.index.Indexed;
-import java.time.LocalDateTime;
-
@Getter
@Setter
@Builder
diff --git a/src/main/java/page/clab/api/domain/community/accuse/adapter/in/web/AccusationReportController.java b/src/main/java/page/clab/api/domain/community/accuse/adapter/in/web/AccusationReportController.java
index 256716c3b..d780d5860 100644
--- a/src/main/java/page/clab/api/domain/community/accuse/adapter/in/web/AccusationReportController.java
+++ b/src/main/java/page/clab/api/domain/community/accuse/adapter/in/web/AccusationReportController.java
@@ -25,7 +25,7 @@ public class AccusationReportController {
@PreAuthorize("hasRole('USER')")
@PostMapping("")
public ApiResponse reportIncident(
- @Valid @RequestBody AccuseRequestDto requestDto
+ @Valid @RequestBody AccuseRequestDto requestDto
) {
Long id = reportAccusationUsecase.reportAccusation(requestDto);
return ApiResponse.success(id);
diff --git a/src/main/java/page/clab/api/domain/community/accuse/adapter/in/web/AccusationRetrievalController.java b/src/main/java/page/clab/api/domain/community/accuse/adapter/in/web/AccusationRetrievalController.java
index b453db63f..7087dbea9 100644
--- a/src/main/java/page/clab/api/domain/community/accuse/adapter/in/web/AccusationRetrievalController.java
+++ b/src/main/java/page/clab/api/domain/community/accuse/adapter/in/web/AccusationRetrievalController.java
@@ -2,6 +2,7 @@
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
+import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Pageable;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -19,8 +20,6 @@
import page.clab.api.global.exception.SortingArgumentException;
import page.clab.api.global.util.PageableUtils;
-import java.util.List;
-
@RestController
@RequestMapping("/api/v1/accusations")
@RequiredArgsConstructor
@@ -31,23 +30,24 @@ public class AccusationRetrievalController {
private final PageableUtils pageableUtils;
@Operation(summary = "[A] 신고 내역 조회(신고 대상, 처리 상태 기준)", description = "ROLE_ADMIN 이상의 권한이 필요함
" +
- "2개의 파라미터를 자유롭게 조합하여 필터링 가능
" +
- "신고 대상, 처리 상태 중 하나라도 입력하지 않으면 전체 조회됨
" +
- "누적 횟수 기준으로 정렬할지 여부를 선택할 수 있음
" +
- "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
+ "2개의 파라미터를 자유롭게 조합하여 필터링 가능
" +
+ "신고 대상, 처리 상태 중 하나라도 입력하지 않으면 전체 조회됨
" +
+ "누적 횟수 기준으로 정렬할지 여부를 선택할 수 있음
" +
+ "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
@PreAuthorize("hasRole('ADMIN')")
@GetMapping("")
public ApiResponse> retrieveAccusations(
- @RequestParam(name = "targetType", required = false) TargetType type,
- @RequestParam(name = "accuseStatus", required = false) AccuseStatus status,
- @RequestParam(name = "countOrder", defaultValue = "false") boolean countOrder,
- @RequestParam(name = "page", defaultValue = "0") int page,
- @RequestParam(name = "size", defaultValue = "20") int size,
- @RequestParam(name = "sortBy", defaultValue = "createdAt") List sortBy,
- @RequestParam(name = "sortDirection", defaultValue = "desc") List sortDirection
+ @RequestParam(name = "targetType", required = false) TargetType type,
+ @RequestParam(name = "accuseStatus", required = false) AccuseStatus status,
+ @RequestParam(name = "countOrder", defaultValue = "false") boolean countOrder,
+ @RequestParam(name = "page", defaultValue = "0") int page,
+ @RequestParam(name = "size", defaultValue = "20") int size,
+ @RequestParam(name = "sortBy", defaultValue = "createdAt") List sortBy,
+ @RequestParam(name = "sortDirection", defaultValue = "desc") List sortDirection
) throws SortingArgumentException, InvalidColumnException {
Pageable pageable = pageableUtils.createPageable(page, size, sortBy, sortDirection, AccuseResponseDto.class);
- PagedResponseDto accuses = retrieveAccusationUsecase.retrieveAccusations(type, status, countOrder, pageable);
+ PagedResponseDto accuses = retrieveAccusationUsecase.retrieveAccusations(type, status,
+ countOrder, pageable);
return ApiResponse.success(accuses);
}
}
diff --git a/src/main/java/page/clab/api/domain/community/accuse/adapter/in/web/AccusationStatusController.java b/src/main/java/page/clab/api/domain/community/accuse/adapter/in/web/AccusationStatusController.java
index 27decb97e..ed1c28ee9 100644
--- a/src/main/java/page/clab/api/domain/community/accuse/adapter/in/web/AccusationStatusController.java
+++ b/src/main/java/page/clab/api/domain/community/accuse/adapter/in/web/AccusationStatusController.java
@@ -26,9 +26,9 @@ public class AccusationStatusController {
@PreAuthorize("hasRole('ADMIN')")
@PatchMapping("/{targetType}/{targetId}")
public ApiResponse changeAccusationStatus(
- @PathVariable(name = "targetType") TargetType type,
- @PathVariable(name = "targetId") Long targetId,
- @RequestParam(name = "accuseStatus") AccuseStatus status
+ @PathVariable(name = "targetType") TargetType type,
+ @PathVariable(name = "targetId") Long targetId,
+ @RequestParam(name = "accuseStatus") AccuseStatus status
) {
Long id = changeAccusationStatusUsecase.changeAccusationStatus(type, targetId, status);
return ApiResponse.success(id);
diff --git a/src/main/java/page/clab/api/domain/community/accuse/adapter/in/web/MyAccusationsController.java b/src/main/java/page/clab/api/domain/community/accuse/adapter/in/web/MyAccusationsController.java
index 64dbb295e..03669b75a 100644
--- a/src/main/java/page/clab/api/domain/community/accuse/adapter/in/web/MyAccusationsController.java
+++ b/src/main/java/page/clab/api/domain/community/accuse/adapter/in/web/MyAccusationsController.java
@@ -2,6 +2,7 @@
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
+import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Pageable;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -17,8 +18,6 @@
import page.clab.api.global.exception.SortingArgumentException;
import page.clab.api.global.util.PageableUtils;
-import java.util.List;
-
@RestController
@RequestMapping("/api/v1/accusations")
@RequiredArgsConstructor
@@ -29,14 +28,14 @@ public class MyAccusationsController {
private final PageableUtils pageableUtils;
@Operation(summary = "[G] 나의 신고 내역 조회", description = "ROLE_GUEST 이상의 권한이 필요함
" +
- "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
+ "DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
@PreAuthorize("hasRole('GUEST')")
@GetMapping("/my")
public ApiResponse> retrieveMyAccusations(
- @RequestParam(name = "page", defaultValue = "0") int page,
- @RequestParam(name = "size", defaultValue = "20") int size,
- @RequestParam(name = "sortBy", defaultValue = "createdAt") List sortBy,
- @RequestParam(name = "sortDirection", defaultValue = "desc") List sortDirection
+ @RequestParam(name = "page", defaultValue = "0") int page,
+ @RequestParam(name = "size", defaultValue = "20") int size,
+ @RequestParam(name = "sortBy", defaultValue = "createdAt") List sortBy,
+ @RequestParam(name = "sortDirection", defaultValue = "desc") List sortDirection
) throws SortingArgumentException, InvalidColumnException {
Pageable pageable = pageableUtils.createPageable(page, size, sortBy, sortDirection, AccuseMyResponseDto.class);
PagedResponseDto accuses = retrieveMyAccusationsUsecase.retrieveMyAccusations(pageable);
diff --git a/src/main/java/page/clab/api/domain/community/accuse/adapter/out/persistence/AccuseJpaEntity.java b/src/main/java/page/clab/api/domain/community/accuse/adapter/out/persistence/AccuseJpaEntity.java
index 55822887a..a6faca8ca 100644
--- a/src/main/java/page/clab/api/domain/community/accuse/adapter/out/persistence/AccuseJpaEntity.java
+++ b/src/main/java/page/clab/api/domain/community/accuse/adapter/out/persistence/AccuseJpaEntity.java
@@ -42,8 +42,8 @@ public class AccuseJpaEntity extends BaseEntity {
@ManyToOne
@JoinColumns({
- @JoinColumn(name = "target_type", nullable = false),
- @JoinColumn(name = "target_reference_id", nullable = false)
+ @JoinColumn(name = "target_type", nullable = false),
+ @JoinColumn(name = "target_reference_id", nullable = false)
})
private AccuseTargetJpaEntity target;
diff --git a/src/main/java/page/clab/api/domain/community/accuse/adapter/out/persistence/AccusePersistenceAdapter.java b/src/main/java/page/clab/api/domain/community/accuse/adapter/out/persistence/AccusePersistenceAdapter.java
index 57e17ca20..aef9a124e 100644
--- a/src/main/java/page/clab/api/domain/community/accuse/adapter/out/persistence/AccusePersistenceAdapter.java
+++ b/src/main/java/page/clab/api/domain/community/accuse/adapter/out/persistence/AccusePersistenceAdapter.java
@@ -1,5 +1,7 @@
package page.clab.api.domain.community.accuse.adapter.out.persistence;
+import java.util.List;
+import java.util.Optional;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
@@ -9,14 +11,11 @@
import page.clab.api.domain.community.accuse.domain.Accuse;
import page.clab.api.domain.community.accuse.domain.TargetType;
-import java.util.List;
-import java.util.Optional;
-
@Component
@RequiredArgsConstructor
public class AccusePersistenceAdapter implements
- RegisterAccusePort,
- RetrieveAccusePort {
+ RegisterAccusePort,
+ RetrieveAccusePort {
private final AccuseRepository accuseRepository;
private final AccuseMapper accuseMapper;
@@ -31,41 +30,41 @@ public Accuse save(Accuse accuse) {
@Override
public void saveAll(List accuses) {
List entities = accuses.stream()
- .map(accuseMapper::toEntity)
- .toList();
+ .map(accuseMapper::toEntity)
+ .toList();
accuseRepository.saveAll(entities);
}
@Override
public Optional findByMemberIdAndTarget(String memberId, TargetType targetType, Long targetReferenceId) {
return accuseRepository.findByMemberIdAndTarget(memberId, targetType, targetReferenceId)
- .map(accuseMapper::toDomain);
+ .map(accuseMapper::toDomain);
}
@Override
public List findByTargetOrderByCreatedAtDesc(TargetType targetType, Long targetReferenceId) {
return accuseRepository.findByTargetOrderByCreatedAtDesc(targetType, targetReferenceId).stream()
- .map(accuseMapper::toDomain)
- .toList();
+ .map(accuseMapper::toDomain)
+ .toList();
}
@Override
public List findByTarget(TargetType targetType, Long targetReferenceId) {
return accuseRepository.findByTarget(targetType, targetReferenceId).stream()
- .map(accuseMapper::toDomain)
- .toList();
+ .map(accuseMapper::toDomain)
+ .toList();
}
@Override
public Page findByMemberId(String memberId, Pageable pageable) {
return accuseRepository.findByMemberId(memberId, pageable)
- .map(accuseMapper::toDomain);
+ .map(accuseMapper::toDomain);
}
@Override
public List findByMemberId(String memberId) {
return accuseRepository.findByMemberId(memberId).stream()
- .map(accuseMapper::toDomain)
- .toList();
+ .map(accuseMapper::toDomain)
+ .toList();
}
}
diff --git a/src/main/java/page/clab/api/domain/community/accuse/adapter/out/persistence/AccuseRepository.java b/src/main/java/page/clab/api/domain/community/accuse/adapter/out/persistence/AccuseRepository.java
index ddec89df1..0f46adc77 100644
--- a/src/main/java/page/clab/api/domain/community/accuse/adapter/out/persistence/AccuseRepository.java
+++ b/src/main/java/page/clab/api/domain/community/accuse/adapter/out/persistence/AccuseRepository.java
@@ -1,5 +1,7 @@
package page.clab.api.domain.community.accuse.adapter.out.persistence;
+import java.util.List;
+import java.util.Optional;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
@@ -7,9 +9,6 @@
import org.springframework.stereotype.Repository;
import page.clab.api.domain.community.accuse.domain.TargetType;
-import java.util.List;
-import java.util.Optional;
-
@Repository
public interface AccuseRepository extends JpaRepository {
diff --git a/src/main/java/page/clab/api/domain/community/accuse/adapter/out/persistence/AccuseTargetId.java b/src/main/java/page/clab/api/domain/community/accuse/adapter/out/persistence/AccuseTargetId.java
index acc15cd5d..abd1b1de6 100644
--- a/src/main/java/page/clab/api/domain/community/accuse/adapter/out/persistence/AccuseTargetId.java
+++ b/src/main/java/page/clab/api/domain/community/accuse/adapter/out/persistence/AccuseTargetId.java
@@ -1,14 +1,13 @@
package page.clab.api.domain.community.accuse.adapter.out.persistence;
import jakarta.persistence.Embeddable;
+import java.io.Serializable;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import page.clab.api.domain.community.accuse.domain.TargetType;
-import java.io.Serializable;
-
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
diff --git a/src/main/java/page/clab/api/domain/community/accuse/adapter/out/persistence/AccuseTargetPersistenceAdapter.java b/src/main/java/page/clab/api/domain/community/accuse/adapter/out/persistence/AccuseTargetPersistenceAdapter.java
index a31d0c96c..afcb35977 100644
--- a/src/main/java/page/clab/api/domain/community/accuse/adapter/out/persistence/AccuseTargetPersistenceAdapter.java
+++ b/src/main/java/page/clab/api/domain/community/accuse/adapter/out/persistence/AccuseTargetPersistenceAdapter.java
@@ -1,5 +1,6 @@
package page.clab.api.domain.community.accuse.adapter.out.persistence;
+import java.util.Optional;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
@@ -11,13 +12,11 @@
import page.clab.api.domain.community.accuse.domain.TargetType;
import page.clab.api.global.exception.NotFoundException;
-import java.util.Optional;
-
@Component
@RequiredArgsConstructor
public class AccuseTargetPersistenceAdapter implements
- RegisterAccuseTargetPort,
- RetrieveAccuseTargetPort {
+ RegisterAccuseTargetPort,
+ RetrieveAccuseTargetPort {
private final AccuseTargetRepository accuseTargetRepository;
private final AccuseTargetMapper accuseTargetMapper;
@@ -32,19 +31,21 @@ public AccuseTarget save(AccuseTarget accuseTarget) {
@Override
public Optional findById(AccuseTargetId accuseTargetId) {
return accuseTargetRepository.findById(accuseTargetId)
- .map(accuseTargetMapper::toDomain);
+ .map(accuseTargetMapper::toDomain);
}
@Override
public AccuseTarget getById(AccuseTargetId accuseTargetId) {
return accuseTargetRepository.findById(accuseTargetId)
- .map(accuseTargetMapper::toDomain)
- .orElseThrow(() -> new NotFoundException("[AccuseTarget] id: " + accuseTargetId + "에 해당하는 신고 대상이 존재하지 않습니다."));
+ .map(accuseTargetMapper::toDomain)
+ .orElseThrow(
+ () -> new NotFoundException("[AccuseTarget] id: " + accuseTargetId + "에 해당하는 신고 대상이 존재하지 않습니다."));
}
@Override
- public Page findByConditions(TargetType type, AccuseStatus status, boolean countOrder, Pageable pageable) {
+ public Page findByConditions(TargetType type, AccuseStatus status, boolean countOrder,
+ Pageable pageable) {
return accuseTargetRepository.findByConditions(type, status, countOrder, pageable)
- .map(accuseTargetMapper::toDomain);
+ .map(accuseTargetMapper::toDomain);
}
}
diff --git a/src/main/java/page/clab/api/domain/community/accuse/adapter/out/persistence/AccuseTargetRepository.java b/src/main/java/page/clab/api/domain/community/accuse/adapter/out/persistence/AccuseTargetRepository.java
index 9567cb196..d92662204 100644
--- a/src/main/java/page/clab/api/domain/community/accuse/adapter/out/persistence/AccuseTargetRepository.java
+++ b/src/main/java/page/clab/api/domain/community/accuse/adapter/out/persistence/AccuseTargetRepository.java
@@ -4,5 +4,6 @@
import org.springframework.data.querydsl.QuerydslPredicateExecutor;
public interface AccuseTargetRepository extends JpaRepository,
- AccuseTargetRepositoryCustom, QuerydslPredicateExecutor {
+ AccuseTargetRepositoryCustom, QuerydslPredicateExecutor {
+
}
diff --git a/src/main/java/page/clab/api/domain/community/accuse/adapter/out/persistence/AccuseTargetRepositoryCustom.java b/src/main/java/page/clab/api/domain/community/accuse/adapter/out/persistence/AccuseTargetRepositoryCustom.java
index 9d0fb5294..abf5f2421 100644
--- a/src/main/java/page/clab/api/domain/community/accuse/adapter/out/persistence/AccuseTargetRepositoryCustom.java
+++ b/src/main/java/page/clab/api/domain/community/accuse/adapter/out/persistence/AccuseTargetRepositoryCustom.java
@@ -6,5 +6,7 @@
import page.clab.api.domain.community.accuse.domain.TargetType;
public interface AccuseTargetRepositoryCustom {
- Page