Skip to content

Commit

Permalink
[refactor] BookmarkRepository, ViewRepository 필요 없는 함수 삭제 (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
elive7 committed Jul 12, 2024
1 parent 66bb058 commit a8f2a4c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,4 @@ public Slice<BookmarkEntity> findAllByUserOrderByIdDesc(UserEntity userEntity, l

return new SliceImpl<>(bookmarkEntities, pageable, QueryDslUtils.hasNext(pageable, bookmarkEntities));
}

public Map<KeywordEntity, Long> countAllByUserIdGroupByKeyword(long userId) {
List<Tuple> results = jpaQueryFactory
.select(uploadEntity.keyword, bookmarkEntity.count())
.from(bookmarkEntity)
.join(bookmarkEntity.record, recordEntity)
.join(recordEntity.uploads, uploadEntity)
.where(bookmarkEntity.user.id.eq(userId))
.groupBy(uploadEntity.keyword)
.fetch();

return results.stream()
.collect(Collectors.toMap(
tuple -> tuple.get(uploadEntity.keyword),
tuple -> tuple.get(viewEntity.count())));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,4 @@
public class ViewQueryDslRepository {

private final JPAQueryFactory jpaQueryFactory;

public Map<KeywordEntity, Long> countAllByUserIdGroupByKeyword(long userId) {
List<Tuple> results = jpaQueryFactory
.select(uploadEntity.keyword, viewEntity.count())
.from(viewEntity)
.join(viewEntity.record, recordEntity)
.join(recordEntity.uploads, uploadEntity)
.where(viewEntity.user.id.eq(userId))
.groupBy(uploadEntity.keyword)
.fetch();

return results.stream()
.collect(Collectors.toMap(
tuple -> tuple.get(uploadEntity.keyword),
tuple -> tuple.get(viewEntity.count())));
}
}

0 comments on commit a8f2a4c

Please sign in to comment.