Skip to content

Commit 39b8054

Browse files
committed
hotfix: fonts/progress modify
fonts/progress return fonts about top 10 recent fonts
1 parent 349d590 commit 39b8054

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

src/main/java/org/fontory/fontorybe/font/infrastructure/FontJpaRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public interface FontJpaRepository extends JpaRepository<FontEntity, Long> {
1616
@Query("SELECT f FROM FontEntity f WHERE f.memberId = :memberId ORDER BY f.createdAt DESC")
1717
List<FontEntity> findTop5ByMemberIdOrderByCreatedAtDesc(@Param("memberId") Long memberId, Pageable pageable);
1818

19-
List<FontEntity> findTop5ByMemberIdOrderByCreatedAtDesc(Long memberId);
19+
List<FontEntity> findTop10ByMemberIdOrderByCreatedAtDesc(Long memberId);
2020
Page<FontEntity> findAllByMemberIdAndStatus(Long memberId, PageRequest pageRequest, FontStatus status);
2121
Page<FontEntity> findByNameContainingAndStatus(String name, PageRequest pageRequest, FontStatus status);
2222
List<FontEntity> findTop3ByMemberIdAndIdNotAndStatusOrderByCreatedAtDesc(Long memberId, Long fontId, FontStatus status);

src/main/java/org/fontory/fontorybe/font/infrastructure/FontRepositoryImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public Font save(Font font) {
4949
* @return 최근 생성된 폰트 목록 (최대 5개)
5050
*/
5151
@Override
52-
public List<Font> findTop5ByMemberIdOrderByCreatedAtDesc(Long memberId) {
53-
List<FontEntity> fontEntities = fontJpaRepository.findTop5ByMemberIdOrderByCreatedAtDesc(memberId);
52+
public List<Font> findTop10ByMemberIdOrderByCreatedAtDesc(Long memberId) {
53+
List<FontEntity> fontEntities = fontJpaRepository.findTop10ByMemberIdOrderByCreatedAtDesc(memberId);
5454

5555
return fontEntities.stream()
5656
.map(FontEntity::toModel)

src/main/java/org/fontory/fontorybe/font/service/FontServiceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public Font create(Long memberId, FontCreateDTO fontCreateDTO, FileUploadResult
111111
@Transactional(readOnly = true)
112112
public List<FontProgressResponse> getFontProgress(Long memberId) {
113113
log.info("Service executing: Fetching font progress for member ID: {}", memberId);
114-
List<Font> fonts = fontRepository.findTop5ByMemberIdOrderByCreatedAtDesc(memberId);
114+
List<Font> fonts = fontRepository.findTop10ByMemberIdOrderByCreatedAtDesc(memberId);
115115
log.debug("Service detail: Found {} fonts for progress display", fonts.size());
116116

117117
List<FontProgressResponse> result = fonts.stream()

src/main/java/org/fontory/fontorybe/font/service/port/FontRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
public interface FontRepository {
1111
Font save(Font font);
12-
List<Font> findTop5ByMemberIdOrderByCreatedAtDesc(Long memberId);
12+
List<Font> findTop10ByMemberIdOrderByCreatedAtDesc(Long memberId);
1313
Optional<Font> findById(Long id);
1414
Page<Font> findAllByMemberIdAndStatus(Long memberId, PageRequest pageRequest, FontStatus status);
1515
void deleteById(Long id);

src/test/java/org/fontory/fontorybe/integration/font/FontServiceIntegrationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ void createFontSuccess() {
122122
@Test
123123
@DisplayName("font - getFontProgress success test")
124124
void getFontProgressSuccess() {
125-
for (int i = 1; i <= 6; i++) {
125+
for (int i = 1; i <= 10; i++) {
126126
fontService.create(
127127
existMemberId,
128128
FontCreateDTO.builder()
@@ -139,7 +139,7 @@ void getFontProgressSuccess() {
139139

140140
// then
141141
assertThat(result).isNotNull();
142-
assertThat(result).hasSizeLessThanOrEqualTo(5);
142+
assertThat(result).hasSizeLessThanOrEqualTo(10);
143143

144144
result.forEach(font -> assertThat(font.getStatus()).isEqualTo(FontStatus.PROGRESS));
145145
}

src/test/java/org/fontory/fontorybe/unit/mock/FakeFontRepository.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ public Font save(Font font) {
5858
}
5959

6060
@Override
61-
public List<Font> findTop5ByMemberIdOrderByCreatedAtDesc(Long memberId) {
61+
public List<Font> findTop10ByMemberIdOrderByCreatedAtDesc(Long memberId) {
6262
return data.stream()
6363
.filter(font -> font.getMemberId().equals(memberId))
6464
.sorted((f1, f2) -> f2.getCreatedAt().compareTo(f1.getCreatedAt()))
65-
.limit(5)
65+
.limit(10)
6666
.collect(Collectors.toList());
6767
}
6868

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
truncate table font;
1+
truncate table `font`;
22
truncate table `member`;
33
truncate table `provide`;

0 commit comments

Comments
 (0)