From 0966f4629c8866d071968a054bb1fc1c6eac2f70 Mon Sep 17 00:00:00 2001 From: rivertw777 <105557972+rivertw777@users.noreply.github.com> Date: Thu, 9 Jan 2025 04:52:58 +0900 Subject: [PATCH] =?UTF-8?q?[feat]=20=EA=B3=B5=EC=97=B0=20=EB=8D=94?= =?UTF-8?q?=EB=AF=B8=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../performance/domain/DataInitializer.java | 35 ++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/services/performance/src/main/java/com/ticketPing/performance/domain/DataInitializer.java b/services/performance/src/main/java/com/ticketPing/performance/domain/DataInitializer.java index 68201cbe..951d81be 100644 --- a/services/performance/src/main/java/com/ticketPing/performance/domain/DataInitializer.java +++ b/services/performance/src/main/java/com/ticketPing/performance/domain/DataInitializer.java @@ -26,7 +26,7 @@ public class DataInitializer implements CommandLineRunner { @Override @Transactional - public void run(String... args) throws Exception { + public void run(String... args) { if (performanceHallRepository.count() > 0) { Performance performance = performanceRepository.findByName("햄릿"); if(performance != null) { @@ -45,7 +45,7 @@ public void run(String... args) throws Exception { // 공연 더미 데이터 생성 Performance performance1 = Performance.createTestData( "햄릿", - "https://fastly.picsum.photos/id/53/250/400.jpg?hmac=XvJLere1krZjwF7Vy_J4hZpWHL9R-Ic6Hup4lQb62Yw", + "https://image.kmib.co.kr/online_image/2017/0622/201706222053_61170011561894_1.jpg", 120, LocalDateTime.now().minusDays(5), LocalDateTime.now().plusDays(10), @@ -58,7 +58,7 @@ public void run(String... args) throws Exception { Performance performance2 = Performance.createTestData( "라이온 킹", - "https://fastly.picsum.photos/id/110/250/400.jpg?hmac=zs2-YrgHbuu-kSuG4dw1bynTUoD6VpOEJguE3j9NOtQ", + "https://image.yes24.com/themusical/upFiles/Themusical/Play/post_%EB%9D%BC%EC%9D%B4%EC%98%A8%ED%82%B9-.JPG", 120, LocalDateTime.now().plusDays(5), LocalDateTime.now().plusDays(15), @@ -69,6 +69,19 @@ public void run(String... args) throws Exception { hall2); performance2 = performanceRepository.save(performance2); + Performance performance3 = Performance.createTestData( + "데스노트", + "https://image.yes24.com/themusical/fileStorage/ThemusicalAdmin/Play/Image/20230207843266905c36ce1ad354a823e902457bc904d112.jpg", + 120, + LocalDateTime.now().minusDays(7), + LocalDateTime.now().plusDays(13), + LocalDate.now().plusDays(7), + LocalDate.now().plusDays(13), + 19, + UUID.randomUUID(), + hall1); + performance3 = performanceRepository.save(performance3); + // 공연 일정 더미 데이터 생성 Schedule schedule1 = Schedule.createTestData(LocalDate.now().plusDays(5), performance1); performance1.addSchedule(schedule1); @@ -79,6 +92,9 @@ public void run(String... args) throws Exception { Schedule schedule3 = Schedule.createTestData(LocalDate.now().plusDays(15), performance2); performance2.addSchedule(schedule3); + Schedule schedule4 = Schedule.createTestData(LocalDate.now().plusDays(5), performance2); + performance3.addSchedule(schedule4); + // 좌석 가격 더미 데이터 생성 SeatCost seatCost1 = SeatCost.createTestData("S", 120000, performance1); performance1.addSeatCost(seatCost1); @@ -98,13 +114,24 @@ public void run(String... args) throws Exception { SeatCost seatCost6 = SeatCost.createTestData("B", 80000, performance2); performance2.addSeatCost(seatCost6); + SeatCost seatCost7 = SeatCost.createTestData("S", 150000, performance3); + performance3.addSeatCost(seatCost7); + + SeatCost seatCost8 = SeatCost.createTestData("A", 110000, performance3); + performance3.addSeatCost(seatCost8); + + SeatCost seatCost9 = SeatCost.createTestData("B", 80000, performance3); + performance3.addSeatCost(seatCost9); + // 좌석 더미 데이터 생성 createSeats(schedule1); createSeats(schedule2); createSeats(schedule3); + createSeats(schedule4); - // 공연1 좌석 캐싱 + // 공연 좌석 캐싱 performanceService.cacheAllSeatsForPerformance(performance1.getId()); + performanceService.cacheAllSeatsForPerformance(performance3.getId()); } private void createSeats(Schedule schedule) {