@RequiredArgsConstructor
@Component
public class ApplicationRunner implements CommandLineRunner {
private final DailyStatRepository dailyStatRepository;
@Override
public void run(String... args) throws Exception {
DailyStat stat1 = new DailyStat("HTTP", LocalDateTime.now());
DailyStat stat2 = new DailyStat("HTTP", LocalDateTime.now());
DailyStat stat3 = new DailyStat("HTTP", LocalDateTime.now());
DailyStat stat4 = new DailyStat("HTTP", LocalDateTime.now());
DailyStat stat5 = new DailyStat("HTTP", LocalDateTime.now());
DailyStat stat6 = new DailyStat("HTTP", LocalDateTime.now());
DailyStat stat7 = new DailyStat("HTTP", LocalDateTime.now());
DailyStat stat8 = new DailyStat("JAVA", LocalDateTime.now());
DailyStat stat9 = new DailyStat("JAVA", LocalDateTime.now());
DailyStat stat10 = new DailyStat("Kotiln", LocalDateTime.now());
DailyStat stat11 = new DailyStat("Database", LocalDateTime.now());
DailyStat stat12 = new DailyStat("OS", LocalDateTime.now());
dailyStatRepository.saveAll(List.of(stat1, stat2, stat3, stat4, stat5, stat6, stat7
, stat8, stat9, stat10, stat11, stat12));
}
}
'Spring관련 기술 > 서버개발' 카테고리의 다른 글
MQ pubsub 간단 정리 (1) | 2024.09.29 |
---|---|
Kakao 도서 정보 이용 AccessDeniedError 발생 (1) | 2024.08.31 |
MethodArgumentTypeMismatchException (0) | 2024.08.30 |
MissingServletRequestParameterException (0) | 2024.08.30 |
NoResourceFoundException (0) | 2024.08.30 |