Skip to content

Commit

Permalink
[FIX] 인터뷰 API 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
unanchoi committed Jan 15, 2024
1 parent 213a10a commit 30d51da
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package com.startlion.startlionserver.repository;

import com.startlion.startlionserver.domain.entity.GraduateInterview;
import com.startlion.startlionserver.domain.enums.IntervieweePart;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface GraduateInterviewJpaRepository extends JpaRepository<GraduateInterview, Long> {
List<GraduateInterview> findByPart(String part);
List<GraduateInterview> findAllByPart(IntervieweePart part);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.startlion.startlionserver.service;

import com.startlion.startlionserver.domain.entity.GraduateInterview;
import com.startlion.startlionserver.domain.enums.IntervieweePart;
import com.startlion.startlionserver.dto.response.interview.InterviewDetailResponse;
import com.startlion.startlionserver.dto.response.interview.InterviewResponse;
import com.startlion.startlionserver.dto.response.interviewanswer.InterviewAnswerResponse;
Expand Down Expand Up @@ -40,10 +41,12 @@ public List<InterviewResponse> getInterviews(String part) {
return graduateInterviewJpaRepository.findAll().stream()
.map(InterviewResponse::of)
.collect(Collectors.toList());
} else {
return graduateInterviewJpaRepository.findAllByPart(IntervieweePart.valueOf(part)).stream()
.map(InterviewResponse::of)
.collect(Collectors.toList());
}
return interviewQueryRepository.findAllByPart(part).stream()
.map(InterviewResponse::of)
.collect(Collectors.toList());

}

@Transactional
Expand Down

0 comments on commit 30d51da

Please sign in to comment.