Skip to content

Commit

Permalink
refactor(Convention): 코드 컨벤션 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
limehee committed Jul 4, 2024
1 parent e2425a2 commit 454b3b0
Show file tree
Hide file tree
Showing 54 changed files with 166 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@

public interface RetrieveAccusePort {
Optional<Accuse> findByMemberIdAndTarget(String memberId, TargetType targetType, Long targetReferenceId);

List<Accuse> findByTargetOrderByCreatedAtDesc(TargetType targetType, Long targetReferenceId);

List<Accuse> findByTarget(TargetType targetType, Long targetReferenceId);

Page<Accuse> findByMemberId(String memberId, Pageable pageable);

List<Accuse> findByMemberId(String memberId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

public interface RetrieveAccuseTargetPort {
Optional<AccuseTarget> findById(AccuseTargetId accuseTargetId);

AccuseTarget findByIdOrThrow(AccuseTargetId accuseTargetId);

Page<AccuseTarget> findByConditions(TargetType type, AccuseStatus status, boolean countOrder, Pageable pageable);
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
@Repository
public interface AbsentRepository extends JpaRepository<Absent, Long> {
Page<Absent> findAllByActivityGroup(ActivityGroup activityGroup, Pageable pageable);

Absent findByActivityGroupAndAbsenteeAndAbsentDate(ActivityGroup activityGroup, Member absentee, LocalDate absentDate);
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ public ActivityGroupDetails fetchActivityGroupDetails(Long activityGroupId) {
BooleanBuilder boardCondition = new BooleanBuilder();
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)
);
ActivityGroupBoardCategory.NOTICE,
ActivityGroupBoardCategory.WEEKLY_ACTIVITY,
ActivityGroupBoardCategory.ASSIGNMENT)
);

List<ActivityGroupBoard> boards = queryFactory.selectFrom(qActivityGroupBoard)
.where(boardCondition)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@

public interface AttendanceRepository extends JpaRepository<Attendance, Long> {
Page<Attendance> findAllByMemberAndActivityGroup(Member member, ActivityGroup activityGroup, Pageable pageable);

Page<Attendance> findAllByActivityGroup(ActivityGroup activityGroup, Pageable pageable);

Attendance findByActivityGroupAndMemberAndActivityDate(ActivityGroup activityGroup, Member member, LocalDate activityDate);

boolean existsByActivityGroupAndActivityDate(ActivityGroup activityGroup, LocalDate activityDate);
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,18 @@
@Repository
public interface GroupMemberRepository extends JpaRepository<GroupMember, GroupMemberId>, GroupMemberRepositoryCustom, QuerydslPredicateExecutor<GroupMember> {
List<GroupMember> findAllByMember(Member member);

boolean existsByMemberAndActivityGroupId(Member member, Long activityGroupId);

Optional<GroupMember> findByActivityGroupIdAndRole(Long activityGroupId, ActivityGroupRole role);

Optional<GroupMember> findByActivityGroupAndMember(ActivityGroup activityGroup, Member member);

List<GroupMember> findAllByActivityGroupIdOrderByMember_IdAsc(Long activityGroupId);

Page<GroupMember> findAllByActivityGroupId(Long activityGroupId, Pageable pageable);

Page<GroupMember> findAllByActivityGroupIdAndStatus(Long activityGroupId, GroupMemberStatus status, org.springframework.data.domain.Pageable pageable);

boolean existsByActivityGroupAndMember(ActivityGroup activityGroup, Member member);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
@Repository
public interface GroupScheduleRepository extends JpaRepository<GroupSchedule, Long> {
List<GroupSchedule> findAllByActivityGroupIdOrderByIdDesc(Long activityGroupId);

Page<GroupSchedule> findAllByActivityGroupId(Long activityGroupId, Pageable pageable);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

public interface RetrieveActivityPhotoPort {
Optional<ActivityPhoto> findById(Long activityPhotoId);

ActivityPhoto findByIdOrThrow(Long activityPhotoId);

Page<ActivityPhoto> findByConditions(Boolean isPublic, Pageable pageable);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@

public interface RetrieveApplicationPort {
Optional<Application> findById(ApplicationId applicationId);

Application findByIdOrThrow(ApplicationId applicationId);

Page<Application> findByConditions(Long recruitmentId, String studentId, Boolean isPass, Pageable pageable);

Page<Application> findAllByIsDeletedTrue(Pageable pageable);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@

public interface RetrieveAwardPort {
Optional<Award> findById(Long awardId);

Award findByIdOrThrow(Long awardId);

Page<Award> findByConditions(String memberId, Long year, Pageable pageable);

Page<Award> findAllByIsDeletedTrue(Pageable pageable);

Page<Award> findByMemberId(String memberId, Pageable pageable);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@

public interface RemoveBlacklistIpPort {
void delete(BlacklistIp blacklistIp);

void deleteAll();
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@

public interface RetrieveBlacklistIpPort {
List<BlacklistIp> findAll();

Page<BlacklistIp> findAll(Pageable pageable);

Optional<BlacklistIp> findByIpAddress(String ipAddress);

BlacklistIp findByIpAddressOrThrow(String ipAddress);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@

public interface RetrieveBlogPort {
Optional<Blog> findById(Long blogId);

Blog findByIdOrThrow(Long blogId);

Page<Blog> findByConditions(String title, String memberName, Pageable pageable);

Page<Blog> findAllByIsDeletedTrue(Pageable pageable);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@

public interface RetrieveBoardsUseCase {
PagedResponseDto<BoardListResponseDto> retrieveBoards(Pageable pageable);

Board findByIdOrThrow(Long boardId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@

public interface RetrieveBoardEmojiPort {
List<Tuple> findEmojiClickCountsByBoardId(Long boardId, String memberId);

Optional<BoardEmoji> findByBoardIdAndMemberIdAndEmoji(Long boardId, String memberId, String emoji);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@

public interface RetrieveBoardPort {
Optional<Board> findById(Long boardId);

Board findByIdOrThrow(Long boardId);

Page<Board> findAll(Pageable pageable);

Page<Board> findAllByCategory(BoardCategory category, Pageable pageable);

Page<Board> findAllByIsDeletedTrue(Pageable pageable);

Page<Board> findAllByMemberId(String memberId, Pageable pageable);
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@

public interface RetrieveBookLoanRecordPort {
Optional<BookLoanRecord> findById(Long bookLoanRecordId);

BookLoanRecord findByIdOrThrow(Long bookLoanRecordId);

Page<BookLoanRecordResponseDto> findByConditions(Long bookId, String borrowerId, BookLoanStatus status, Pageable pageable);

Page<BookLoanRecordOverdueResponseDto> findOverdueBookLoanRecords(Pageable pageable);

Optional<BookLoanRecord> findByBookAndReturnedAtIsNullAndStatus(Book book, BookLoanStatus bookLoanStatus);

BookLoanRecord findByBookAndReturnedAtIsNullAndStatusOrThrow(Book book, BookLoanStatus bookLoanStatus);

Optional<BookLoanRecord> findByBookAndBorrowerIdAndStatus(Book book, String borrowerId, BookLoanStatus bookLoanStatus);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@

public interface RetrieveBookPort {
Optional<Book> findById(Long bookId);

Book findByIdOrThrow(Long bookId);

Page<Book> findAllByIsDeletedTrue(Pageable pageable);

Page<Book> findByConditions(String title, String category, String publisher, String borrowerId, String borrowerName, Pageable pageable);

int countByBorrowerId(String borrowerId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@

public interface BookLoanRecordRepository extends JpaRepository<BookLoanRecord, Long>, BookLoanRecordRepositoryCustom {
Optional<BookLoanRecord> findByBookAndReturnedAtIsNullAndStatus(Book book, BookLoanStatus bookLoanStatus);

Optional<BookLoanRecord> findByBookAndBorrowerIdAndStatus(Book book, String borrowerId, BookLoanStatus bookLoanStatus);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@

public interface BookLoanRecordRepositoryCustom {
Page<BookLoanRecordResponseDto> findByConditions(Long bookId, String borrowerId, BookLoanStatus status, Pageable pageable);

Page<BookLoanRecordOverdueResponseDto> findOverdueBookLoanRecords(Pageable pageable);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@

public interface RetrieveCommentsUseCase {
PagedResponseDto<CommentResponseDto> retrieveComments(Long boardId, Pageable pageable);

Comment findByIdOrThrow(Long commentId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@

public interface RetrieveCommentPort {
Optional<Comment> findById(Long commentId);

Comment findByIdOrThrow(Long commentId);

Page<Comment> findAllByIsDeletedTrueAndBoardId(Long boardId, Pageable pageable);

Page<Comment> findAllByBoardIdAndParentIsNull(Long boardId, Pageable pageable);

Page<Comment> findAllByWriterId(String memberId, Pageable pageable);

Long countByBoard(Board board);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@

public interface RetrieveDonationPort {
Optional<Donation> findById(Long donationId);

Donation findByIdOrThrow(Long donationId);

Page<Donation> findAllByIsDeletedTrue(Pageable pageable);

Page<Donation> findByConditions(String memberId, String name, LocalDate startDate, LocalDate endDate, Pageable pageable);

Page<Donation> findByMemberId(String memberId, Pageable pageable);
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@

public interface RetrieveJobPostingPort {
Optional<JobPosting> findById(Long jobPostingId);

JobPosting findByIdOrThrow(Long jobPostingId);

Page<JobPosting> findAllByIsDeletedTrue(Pageable pageable);

Page<JobPosting> findByConditions(String title, String companyName, CareerLevel careerLevel, EmploymentType employmentType, Pageable pageable);

Optional<JobPosting> findByJobPostingUrl(String jobPostingUrl);
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@

public interface ManageAccountLockUseCase {
void handleAccountLockInfo(String memberId) throws MemberLockedException, LoginFailedException;

void handleLoginFailure(HttpServletRequest request, String memberId) throws MemberLockedException, LoginFailedException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

public interface ManageAuthenticatorUseCase {
boolean isAuthenticatorValid(String memberId, String totp);

boolean isAuthenticatorExist(String memberId);

String generateSecretKey(String memberId);

String resetAuthenticator(String memberId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@

public interface ManageLoginUseCase {
LoginResult login(HttpServletRequest request, LoginRequestDto requestDto) throws LoginFailedException, MemberLockedException;

LoginResult authenticate(HttpServletRequest request, TwoFactorAuthenticationRequestDto requestDto) throws LoginFailedException, MemberLockedException;

String resetAuthenticator(String memberId);

String revokeToken(String memberId);

TokenHeader reissueToken(HttpServletRequest request);

List<String> retrieveCurrentLoggedInUsers();
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@

public interface ManageRedisTokenUseCase {
RedisToken findByAccessToken(String accessToken);

RedisToken findByRefreshToken(String refreshToken);

List<String> getCurrentLoggedInUsers();

void saveToken(String memberId, Role role, TokenInfo tokenInfo, String ip);

void deleteByAccessToken(String accessToken);

void deleteByMemberId(String memberId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@

public interface RemoveRedisTokenPort {
void delete(RedisToken redisToken);

void deleteByMemberId(String memberId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

public interface RetrieveAccountLockInfoPort {
Optional<AccountLockInfo> findById(Long id);

Optional<AccountLockInfo> findByMemberId(String memberId);

Page<AccountLockInfo> findByLockUntil(LocalDateTime lockUntil, Pageable pageable);
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

public interface RetrieveAuthenticatorPort {
Optional<Authenticator> findById(String memberId);

Authenticator findByIdOrThrow(String memberId);

boolean existsById(String memberId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@

public interface RetrieveRedisTokenPort {
Optional<RedisToken> findById(String id);

Optional<RedisToken> findByAccessToken(String accessToken);

Optional<RedisToken> findByRefreshToken(String refreshToken);

List<RedisToken> findAll();
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
@Repository
public interface AccountLockInfoRepository extends JpaRepository<AccountLockInfo, Long> {
Optional<AccountLockInfo> findByMemberId(String memberId);

Page<AccountLockInfo> findByLockUntil(LocalDateTime banDate, Pageable pageable);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
@Repository
public interface RedisTokenRepository extends CrudRepository<RedisToken, String> {
Optional<RedisToken> findByAccessToken(String accessToken);

Optional<RedisToken> findByRefreshToken(String refreshToken);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@

public interface RegisterMembersByRecruitmentUseCase {
List<String> registerMembersByRecruitment(Long recruitmentId);

String registerMembersByRecruitment(Long recruitmentId, String memberId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,24 @@

public interface RetrieveMemberInfoUseCase {
List<MemberEmailInfoDto> getMembers();

List<String> getMemberIds();

List<String> getAdminIds();

List<String> getSuperAdminIds();

MemberBasicInfoDto getMemberBasicInfoById(String memberId);

MemberBasicInfoDto getCurrentMemberBasicInfo();

MemberDetailedInfoDto getMemberDetailedInfoById(String memberId);

MemberDetailedInfoDto getCurrentMemberDetailedInfo();

MemberBorrowerInfoDto getCurrentMemberBorrowerInfo();

MemberLoginInfoDto getMemberLoginInfoById(String memberId);

MemberPositionInfoDto getCurrentMemberPositionInfo();
}
Loading

0 comments on commit 454b3b0

Please sign in to comment.