11package com .example .springserver ;
22
3+ import com .example .springserver .domain .caregiver .entity .*;
4+ import com .example .springserver .domain .caregiver .entity .enums .CertType ;
5+ import com .example .springserver .domain .caregiver .entity .enums .Level ;
6+ import com .example .springserver .domain .caregiver .entity .enums .ScheduleAvailability ;
7+ import com .example .springserver .domain .caregiver .repository .*;
8+ import com .example .springserver .domain .center .entity .*;
9+ import com .example .springserver .domain .center .entity .enums .CareType ;
10+ import com .example .springserver .domain .center .entity .enums .ElderRate ;
11+ import com .example .springserver .domain .center .entity .enums .Inmate ;
12+ import com .example .springserver .domain .center .entity .enums .Week ;
13+ import com .example .springserver .domain .center .repository .*;
14+ import com .example .springserver .domain .location .entity .Location ;
15+ import com .example .springserver .repository .location .LocationRepository ;
16+ import net .datafaker .Faker ;
17+ import org .springframework .beans .factory .annotation .Autowired ;
318import org .springframework .boot .ApplicationArguments ;
419import org .springframework .boot .ApplicationRunner ;
520import org .springframework .stereotype .Component ;
621import org .springframework .transaction .annotation .Transactional ;
722
23+ import java .time .LocalDate ;
24+ import java .util .*;
25+ import java .util .stream .IntStream ;
26+
827@ Transactional
928@ Component
1029public class MockDataGenerator implements ApplicationRunner {
11- //
30+
1231 @ Override
1332 public void run (ApplicationArguments args ) throws Exception {
1433// System.out.println("Mock 데이터 생성 메서드 실행...");
1534// createMockData();
35+ // System.out.println("Mock 데이터 생성 메서드 끝...");
1636 }
1737//
1838// /* 애플리케이션 실행 시점에 Mock 데이터 생성 */
@@ -52,7 +72,7 @@ public void run(ApplicationArguments args) throws Exception {
5272// }
5373//
5474// // 3. 요양보호사 데이터 생성
55- // for (int i = 0; i < 50 ; i++) { // 요양보호사 60건
75+ // for (int i = 0; i < 1500 ; i++) { // 요양보호사 60건
5676// careGiver();
5777// }
5878//
@@ -63,7 +83,7 @@ public void run(ApplicationArguments args) throws Exception {
6383// }
6484//
6585// // 5. 구직 조건, 근무지 데이터 생성
66- // for (int i = 0; i < 50 ; i++) { // 구직 조건 50건
86+ // for (int i = 0; i < 1500 ; i++) { // 구직 조건 50건
6787// jobCondition(i+1);
6888// workLocation();
6989// }
@@ -138,7 +158,7 @@ public void run(ApplicationArguments args) throws Exception {
138158// void recruitCondition(int i) {
139159// Elder elder = elderRepository.findById(Long.valueOf(i))
140160// .orElseThrow(() -> new RuntimeException("===== elder 중복 ====="));
141- // Location recruitLocation = locationRepository.findByLocationId(faker.random().nextLong(1000, 3000 ));
161+ // Location recruitLocation = locationRepository.findByLocationId(faker.random().nextLong(1,50 ));
142162// List<CareType> careTypes = Collections.singletonList(faker.options().option(CareType.class));
143163// boolean flexibleSchedule = faker.bool().bool(); // 시간 협의 여부
144164// List<RecruitTime> recruitTimes = new ArrayList<>();
@@ -179,7 +199,7 @@ public void run(ApplicationArguments args) throws Exception {
179199// Elder elder = elderRepository.findById(Long.valueOf(i))
180200// .orElseThrow(() -> new RuntimeException("===== elder 중복 ====="));
181201// List<CareType> careTypes = Collections.singletonList(faker.options().option(CareType.class));
182- // Location careLocation = locationRepository.findByLocationId(faker.random().nextLong(1000, 3000 ));
202+ // Location careLocation = locationRepository.findByLocationId(faker.random().nextLong(1,1000 ));
183203// boolean flexibleSchedule = faker.bool().bool(); // 시간 협의 여부
184204// boolean mealAssistance = faker.bool().bool();
185205// boolean toiletAssistance = faker.bool().bool();
@@ -278,7 +298,7 @@ public void run(ApplicationArguments args) throws Exception {
278298// }
279299//
280300// void workLocation() {
281- // Location locationId = locationRepository.findByLocationId((long) faker.number().numberBetween(1000, 3000 ));
301+ // Location locationId = locationRepository.findByLocationId((long) faker.number().numberBetween(1, 10 ));
282302// JobCondition jobCondition = jobConditionRepository.findRandom().get();
283303//
284304// WorkLocation workLocation = new WorkLocation(locationId, jobCondition);
0 commit comments