Skip to content

Commit

Permalink
refactor: challenge refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
pjm2571 committed Dec 1, 2024
1 parent 855a358 commit 4081c0a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
import java.util.Optional;

public interface AlgorithmRepository extends JpaRepository<Algorithm, Long> {
Algorithm findFirstByOrderByUsedAtDesc();
Algorithm findFirstByOrderByUsedAtAsc();
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class ChallengeService {
@Transactional
public void createChallenge() {
// 1) 알고리즘 DB에서 오래된 순으로 정렬 후, 제일 오래된 값을 가져온다.
Algorithm algorithm = algorithmRepository.findFirstByOrderByUsedAtDesc();
Algorithm algorithm = algorithmRepository.findFirstByOrderByUsedAtAsc();

// 2) ChatGPT API 요청 생성 ( algorithm + model )
ChatGPTRequest request = ChatGPTRequest.createCodingTestPrompt(
Expand Down

0 comments on commit 4081c0a

Please sign in to comment.