Skip to content

Commit

Permalink
Merge pull request #88 from WinnerCat/fix/#87-today-error-choi76
Browse files Browse the repository at this point in the history
Fix/#87 today error choi76
  • Loading branch information
y2hscmtk authored Aug 3, 2024
2 parents bc88c95 + 1960a99 commit 175fa9c
Show file tree
Hide file tree
Showing 16 changed files with 8 additions and 7 deletions.
Binary file modified .gradle/8.8/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified .gradle/8.8/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified .gradle/8.8/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/8.8/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified .gradle/8.8/fileHashes/resourceHashesCache.bin
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file modified .gradle/file-system.probe
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified build/tmp/compileJava/previous-compilation-data.bin
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class TodayErrorDto {
public static class ErrorCount {
private Long totalCount;
@Builder.Default
private List<ErrorDto> top5Articles = new ArrayList<>();
private List<ErrorDto> ranking = new ArrayList<>();
}

@Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public ResponseEntity<?> getArticleRecommendByTag(String tagName, Pageable pagea
}

/**
* 오늘 해결한 총 에러와, 상위 태그 5개 반환
* 오늘 해결한 총 에러와, 상위 태그 4개 반환
*/
@Override
@Transactional(readOnly = true)
Expand All @@ -354,16 +354,16 @@ public ResponseEntity<?> getTodayFixErrorInfo() {
// 가장 많이 작성된 태그 순으로 정렬
List<Object[]> topTags = articleTagRepository.findTopTagsByArticles(todayArticles);
// 반환 DTO 생성
List<TodayErrorDto.ErrorDto> top5Articles = new ArrayList<>();
topTags.stream().limit(5).forEach(tag -> {
top5Articles.add(TodayErrorDto.ErrorDto.builder()
List<TodayErrorDto.ErrorDto> top4Articles = new ArrayList<>();
topTags.stream().limit(4).forEach(tag -> {
top4Articles.add(TodayErrorDto.ErrorDto.builder()
.tagName((String) tag[0])
.count(((Number) tag[1]).longValue())
.build());
});
TodayErrorDto.ErrorCount result = TodayErrorDto.ErrorCount.builder()
.totalCount(totalCount)
.top5Articles(top5Articles)
.ranking(top4Articles)
.build();

return ResponseEntity.ok(ApiResponse.onSuccess(result));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ public String[] permitAllPaths() {
return new String[]{
"/login", "/join", "/oauth2/**", "/ci",
"/api/article/today-error", "/api/scream/**",
"/api/article/all", "/api/article/tag/**"
"/api/article/all", "/api/article/tag/**",
"/api/article/today-error"
};
}
}

0 comments on commit 175fa9c

Please sign in to comment.