refactor(ocr): rename findTop5 to findTop10 for headroom as frontend shows 3 by default
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -12,5 +12,5 @@ public interface OcrTrainingRunRepository extends JpaRepository<OcrTrainingRun,
|
|||||||
|
|
||||||
Optional<OcrTrainingRun> findFirstByStatus(TrainingStatus status);
|
Optional<OcrTrainingRun> findFirstByStatus(TrainingStatus status);
|
||||||
|
|
||||||
List<OcrTrainingRun> findTop5ByOrderByCreatedAtDesc();
|
List<OcrTrainingRun> findTop10ByOrderByCreatedAtDesc();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ public class OcrTrainingService {
|
|||||||
int totalOcrBlocks = (int) blockRepository.count();
|
int totalOcrBlocks = (int) blockRepository.count();
|
||||||
int availableSegBlocks = segmentationTrainingExportService.querySegmentationBlocks().size();
|
int availableSegBlocks = segmentationTrainingExportService.querySegmentationBlocks().size();
|
||||||
|
|
||||||
List<OcrTrainingRun> recentRuns = trainingRunRepository.findTop5ByOrderByCreatedAtDesc();
|
List<OcrTrainingRun> recentRuns = trainingRunRepository.findTop10ByOrderByCreatedAtDesc();
|
||||||
OcrTrainingRun lastRun = recentRuns.isEmpty() ? null : recentRuns.get(0);
|
OcrTrainingRun lastRun = recentRuns.isEmpty() ? null : recentRuns.get(0);
|
||||||
|
|
||||||
return new TrainingInfoResponse(
|
return new TrainingInfoResponse(
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class OcrTrainingServiceTest {
|
|||||||
service = new OcrTrainingService(runRepository, exportService, segExportService, ocrClient, healthClient, blockRepository, txTemplate);
|
service = new OcrTrainingService(runRepository, exportService, segExportService, ocrClient, healthClient, blockRepository, txTemplate);
|
||||||
|
|
||||||
when(blockRepository.count()).thenReturn(0L);
|
when(blockRepository.count()).thenReturn(0L);
|
||||||
when(runRepository.findTop5ByOrderByCreatedAtDesc()).thenReturn(List.of());
|
when(runRepository.findTop10ByOrderByCreatedAtDesc()).thenReturn(List.of());
|
||||||
when(segExportService.querySegmentationBlocks()).thenReturn(List.of());
|
when(segExportService.querySegmentationBlocks()).thenReturn(List.of());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user