diff --git a/backend/src/main/java/com/festago/application/StageService.java b/backend/src/main/java/com/festago/application/StageService.java index 80c578308..4b90e7cb9 100644 --- a/backend/src/main/java/com/festago/application/StageService.java +++ b/backend/src/main/java/com/festago/application/StageService.java @@ -25,16 +25,15 @@ public StageService(StageRepository stageRepository, FestivalRepository festival public StageResponse create(StageCreateRequest request) { Festival festival = findFestivalById(request.festivalId()); - Stage newStage = stageRepository.save(toStageEntity(request, festival)); + Stage newStage = stageRepository.save(new Stage( + request.startTime(), + request.lineUp(), + request.ticketOpenTime(), + festival)); + return StageResponse.from(newStage); } - private Stage toStageEntity(StageCreateRequest request, Festival festival) { - return request.lineUp() == null ? - new Stage(request.startTime(), request.ticketOpenTime(), festival) : - new Stage(request.startTime(), request.lineUp(), request.ticketOpenTime(), festival); - } - private Festival findFestivalById(Long festivalId) { return festivalRepository.findById(festivalId) .orElseThrow(() -> new NotFoundException(ErrorCode.FESTIVAL_NOT_FOUND)); diff --git a/backend/src/main/java/com/festago/application/StudentService.java b/backend/src/main/java/com/festago/application/StudentService.java index ac666c9f5..ea52de469 100644 --- a/backend/src/main/java/com/festago/application/StudentService.java +++ b/backend/src/main/java/com/festago/application/StudentService.java @@ -78,8 +78,7 @@ private School findSchool(Long schoolId) { public void verificate(Long memberId, StudentVerificateRequest request) { validateStudent(memberId); Member member = findMember(memberId); - StudentCode studentCode = studentCodeRepository.findByCodeAndMember(new VerificationCode(request.code()), - member) + StudentCode studentCode = studentCodeRepository.findByCodeAndMember(new VerificationCode(request.code()), member) .orElseThrow(() -> new BadRequestException(ErrorCode.INVALID_STUDENT_VERIFICATION_CODE)); studentRepository.save(new Student(member, studentCode.getSchool(), studentCode.getUsername())); studentCodeRepository.deleteByMember(member);