Skip to content

Commit

Permalink
[chore] #71 현재 핫한 오픈톡 api 200개에서 50개로 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
hyeesw committed Oct 3, 2024
1 parent e51aff9 commit c785a95
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
@Repository
public interface MessageRepository extends JpaRepository<Message, Long> {
List<Message> findTop200ByOrderByCreatedAtDesc();
List<Message> findTop50ByOrderByCreatedAtDesc();

// 특정 opentalk Id 를 갖는 데이터 조회 (페이지네이션)
Page<Message> findAllByOpentalk(Opentalk opentalk, Pageable pageable);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class OpentalkService {
/* message 테이블에서 최근 200개 데이터 조회 -> opentalkId 기준으로 count 해서 가장 빈번하게 나오는 top 5 id 반환*/
public List<Long> getHotOpentalkIds() {
log.trace("OpentalkService > hotOpentalk()");
List<Message> recent200Messages = messageRepository.findTop200ByOrderByCreatedAtDesc();
List<Message> recent200Messages = messageRepository.findTop50ByOrderByCreatedAtDesc();

// (key : opentalk_id, value : 출현빈도)
Map<Long, Long> opentalkIdCountMap = recent200Messages.stream().collect(
Expand Down

0 comments on commit c785a95

Please sign in to comment.