-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feature: 퀴즈 조회 api 구현. * feature: 퀴즈 repository 코드 수정
- Loading branch information
1 parent
e9bba3c
commit 6820c2a
Showing
10 changed files
with
65 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 0 additions & 3 deletions
3
src/main/java/com/goldbalance/dive/domain/article/domain/ArticleQueryOption.java
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
src/main/java/com/goldbalance/dive/domain/article/dto/request/ArticleQueryOption.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.goldbalance.dive.domain.article.dto.request; | ||
|
||
import com.goldbalance.dive.domain.article.domain.Category; | ||
import com.goldbalance.dive.domain.article.domain.Duration; | ||
|
||
public record ArticleQueryOption(String keyword, Category category, Duration duration) {} |
5 changes: 2 additions & 3 deletions
5
...e/repository/ArticleCustomRepository.java → ...tory/article/ArticleCustomRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
...pository/ArticleCustomRepositoryImpl.java → .../article/ArticleCustomRepositoryImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...article/repository/ArticleRepository.java → ...repository/article/ArticleRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
src/main/java/com/goldbalance/dive/domain/article/repository/quiz/QuizCustomRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.goldbalance.dive.domain.article.repository.quiz; | ||
|
||
import com.goldbalance.dive.domain.article.domain.Quiz; | ||
import java.util.List; | ||
|
||
public interface QuizCustomRepository { | ||
List<Quiz> searchQuiz(Long articleId); | ||
} |
22 changes: 22 additions & 0 deletions
22
...in/java/com/goldbalance/dive/domain/article/repository/quiz/QuizCustomRepositoryImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.goldbalance.dive.domain.article.repository.quiz; | ||
|
||
import static com.goldbalance.dive.domain.article.domain.QQuiz.quiz; | ||
|
||
import com.goldbalance.dive.domain.article.domain.Quiz; | ||
import com.querydsl.jpa.impl.JPAQueryFactory; | ||
import java.util.List; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@RequiredArgsConstructor | ||
public class QuizCustomRepositoryImpl implements QuizCustomRepository { | ||
|
||
private final JPAQueryFactory queryFactory; | ||
|
||
@Override | ||
public List<Quiz> searchQuiz(Long articleId) { | ||
return queryFactory | ||
.selectFrom(quiz) | ||
.where(quiz.article.id.eq(articleId)) | ||
.fetch(); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/java/com/goldbalance/dive/domain/article/repository/quiz/QuizRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.goldbalance.dive.domain.article.repository.quiz; | ||
|
||
import com.goldbalance.dive.domain.article.domain.Quiz; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface QuizRepository extends JpaRepository<Quiz, Long>, QuizCustomRepository {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters