Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
ParkSangsin committed Aug 17, 2024
1 parent 3ff368b commit 51a661e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 178 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ dependencies {
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'

implementation 'javax.annotation:javax.annotation-api:1.3.2'
}

tasks.named('test') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,182 +74,4 @@ public void updateTopHashtags() {
}
System.out.println("updatePerfTopHashtags finished");
}


@PostConstruct // 실행시킬 때마다 DB에 예시 데이터 들어감. 본격적으로 DB에 데이터 넣기 전까지 사용할 예정.
public void data() {
System.out.println("Starting data initialization");
try {
// hall 객체 생성
Hall hall = Hall.builder()
.sidonm("서울")
.gugunnm("서울")
.streetAddress("서울시 중구 퇴계로 387")
.hallName("충무아트센터 대극장")
.build();
hallRepository.save(hall);

// performance 객체 생성
Performance p1 = Performance.builder()
.title("데스노트")
.performanceType(PerformanceType.PLAY)
.hall(hall)
.startDate("20230731")
.endDate("20230731")
.duration("160")
.lowestPrice("10000")
.highestPrice("150000")
.poster("포스터.img")
.ratingAverage(0.0)
.reviewCount(0L)
.ticketingLink("http://example.com/tickets")
.price("100000")
.build();
performanceRepository.save(p1);

// pair 객체 생성
Pair pair1 = Pair.builder()
.performance(p1)
.actor1Name("이동훈")
.actor2Name("박상신")
.ratingAverage(0.0)
.reviewCount(0L)
.build();
pairRepository.save(pair1);

Pair pair2 = Pair.builder()
.performance(p1)
.actor1Name("이동훈")
.actor2Name("이은석")
.ratingAverage(0.0)
.reviewCount(0L)
.build();
pairRepository.save(pair2);

// actor 객체 생성
Actor a1 = Actor.builder()
.actorName("이동훈")
.actorProfile("이동훈.img")
.build();
actorRepository.save(a1);

Actor a2 = Actor.builder()
.actorName("박상신")
.actorProfile("박상신.img")
.build();
actorRepository.save(a2);

Actor a22 = Actor.builder()
.actorName("이은석")
.actorProfile("이은석.img")
.build();
actorRepository.save(a22);

// perf_actor 객체 생성
PerformanceActor pa1 = PerformanceActor.builder()
.performance(p1)
.actor(a1)
.characterName("엘")
.build();
performanceActorRepository.save(pa1);

PerformanceActor pa2 = PerformanceActor.builder()
.performance(p1)
.actor(a2)
.characterName("라이토")
.build();
performanceActorRepository.save(pa2);

PerformanceActor pa22 = PerformanceActor.builder()
.performance(p1)
.actor(a22)
.characterName("라이토")
.build();
performanceActorRepository.save(pa22);

// ------------------------------------------------------------------
// performance 객체 생성
Performance p2 = Performance.builder()
.title("시카고")
.performanceType(PerformanceType.PLAY)
.hall(hall)
.startDate("20230731")
.endDate("20230731")
.duration("160")
.lowestPrice("100000")
.highestPrice("150000")
.poster("포스터.img")
.ratingAverage(0.0)
.reviewCount(0L)
.ticketingLink("http://example.com/tickets")
.price("100000")
.build();
performanceRepository.save(p2);

// pair 객체 생성
Pair pair13 = Pair.builder()
.performance(p2)
.actor1Name("이동훈1")
.actor2Name("박상신1")
.ratingAverage(0.0)
.reviewCount(0L)
.build();
pairRepository.save(pair13);

Pair pair23 = Pair.builder()
.performance(p2)
.actor1Name("이동훈1")
.actor2Name("이은석1")
.ratingAverage(0.0)
.reviewCount(0L)
.build();
pairRepository.save(pair23);

// actor 객체 생성
Actor a13 = Actor.builder()
.actorName("이동훈1")
.actorProfile("이동훈1.img")
.build();
actorRepository.save(a13);

Actor a23 = Actor.builder()
.actorName("박상신1")
.actorProfile("박상신1.img")
.build();
actorRepository.save(a23);

Actor a223 = Actor.builder()
.actorName("이은석1")
.actorProfile("이은석1.img")
.build();
actorRepository.save(a223);

// perf_actor 객체 생성
PerformanceActor pa13 = PerformanceActor.builder()
.performance(p2)
.actor(a13)
.characterName("배역1")
.build();
performanceActorRepository.save(pa13);

PerformanceActor pa23 = PerformanceActor.builder()
.performance(p2)
.actor(a23)
.characterName("배역2")
.build();
performanceActorRepository.save(pa23);

PerformanceActor pa223 = PerformanceActor.builder()
.performance(p2)
.actor(a223)
.characterName("배역2")
.build();
performanceActorRepository.save(pa223);

} catch (Exception e) {
System.out.println("Error initializing data: " + e.getMessage());
e.printStackTrace();
}
}

}

0 comments on commit 51a661e

Please sign in to comment.