Skip to content

Commit

Permalink
refactor: 축제 생성 시 이름 "테코대학교 20770630 축제" 와 같은 포맷으로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
seokjin8678 committed Apr 14, 2024
1 parent df22104 commit c717a6d
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@
import com.festago.school.domain.School;
import java.time.Clock;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.concurrent.atomic.AtomicLong;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

@Component
@RequiredArgsConstructor
public class MockFestivalsGenerator {

private static final AtomicLong festivalSequence = new AtomicLong();

private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyyMMdd");
private final Clock clock;
private final MockFestivalDateGenerator festivalDateGenerator;

Expand All @@ -25,7 +24,7 @@ public List<Festival> generate(List<School> schools, int duration) {
LocalDate startDate = festivalDateGenerator.generateStartDate(duration, now);
LocalDate endDate = festivalDateGenerator.generateEndDate(duration, now, startDate);
return new Festival(
school.getName() + " 축제 " + festivalSequence.incrementAndGet(),
school.getName() + " " + startDate.format(DATE_TIME_FORMATTER) + " 축제",
startDate,
endDate,
school
Expand Down

0 comments on commit c717a6d

Please sign in to comment.