Skip to content

Commit

Permalink
fix: 빌드 오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
rlaisqls committed Oct 31, 2023
1 parent 7dd768b commit f8b279d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ class QuestionSets (

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "post_id", columnDefinition = "BIGINT",nullable = false)
var postId: Post,
var post: Post,

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "problem_id", columnDefinition = "BIGINT", nullable = false)
var problemId: Problem,
var problem: Problem,

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "author_id", columnDefinition = "BIGINT", nullable = false)
val authorId: User,
val author: User,
)
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ class CustomQuestionSetsRepositoryImpl(

private fun <T> JPAQuery<T>.getQuestionSetDto(user: User): MutableList<QuestionSetDto> {
val author = QUser("writer")
return leftJoin(questionTags).on(questionTags.problems.eq(questionSets.problemId))
return leftJoin(questionTags).on(questionTags.problems.eq(questionSets.problem))
.leftJoin(tags).on(tags.id.eq(questionTags.id.tagId))
.leftJoin(questionSolvingHistory)
.on(questionSolvingHistory.userId.id.eq(user.id)).on(questionSolvingHistory.problem.eq(questionSets.problemId))
.innerJoin(author).on(author.id.eq(questionSets.authorId.id))
.on(questionSolvingHistory.userId.id.eq(user.id)).on(questionSolvingHistory.problem.eq(questionSets.problem))
.innerJoin(author).on(author.id.eq(questionSets.author.id))
// .rightJoin(favorite).on(favorite.questions.id.eq(questions.id))
// .rightJoin(answers).on(answers.writer.eq(user).and(answers.questions.eq(questions)))
.transform(
Expand Down Expand Up @@ -119,7 +119,7 @@ class CustomQuestionSetsRepositoryImpl(
val author = QUser("writer")
val liked = QLike("liked")
val favorite = QFavorite("favorite")
return@run leftJoin(questionTags).on(questionTags.problems.eq(questionSets.problemId))
return@run leftJoin(questionTags).on(questionTags.problems.eq(questionSets.problem))
.leftJoin(tags).on(tags.id.eq(questionTags.id.tagId))
.innerJoin(author).on(author.id.eq(questionSets.author.id))
.leftJoin(liked).on(liked.id.userId.eq(user.id)).on(liked.post.eq(questionSets.post))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ class QuestionService(
fun registerQuestionSet(request: QuestionSetsRequest): RegisterQuestionSetsResponse{
val user = SecurityUtil.getCurrentUser()

val postId = postRepository.save(Post())
val problemId = problemRepository.save(Problem(type = ProblemType.SET))
val post = postRepository.save(Post())
val problem = problemRepository.save(Problem(type = ProblemType.SET))

val sets = questionSetsRepository.save(
QuestionSets(
Expand All @@ -298,16 +298,16 @@ class QuestionService(
category = request.category,
likeCount = 0,
viewCount = 0,
postId = postId,
problemId = problemId,
authorId = user,
post = post,
problem = problem,
author = user,
)
)

saveTag(
category = request.category,
tags = request.tag,
problems = sets.problemId
problems = sets.problem
)

val questions = questionsRepository.findByIdIn(request.questionId)
Expand Down Expand Up @@ -386,7 +386,7 @@ class QuestionService(
questionSolvingHistoryRepository.save(
QuestionSolvingHistory(
userId = user,
problem = questionSet.problemId
problem = questionSet.problem
)
)
}
Expand Down

0 comments on commit f8b279d

Please sign in to comment.