Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] 질문 답변 조회 기능 #30

Merged
merged 5 commits into from
Mar 9, 2024
Merged

[FEAT] 질문 답변 조회 기능 #30

merged 5 commits into from
Mar 9, 2024

Conversation

PgmJun
Copy link
Member

@PgmJun PgmJun commented Mar 3, 2024

✒️ 관련 이슈번호

🔑 Key Changes

  1. 질문에 대한 답변 조회 기능 구현

📸 Screenshot

📢 To Reviewers

  • LikeRepositoryJpaRepository<Member, Repository> 로 되어있는데, 이 부분을 바로 다음 PR에서 처리했습니다.
    이 부분에 대해서는 신경 안쓰셔도 될 것 같습니다!

@PgmJun PgmJun added the ✨ Feat 기능 개발 label Mar 3, 2024
@PgmJun PgmJun self-assigned this Mar 3, 2024
@PgmJun PgmJun changed the title [FEAT] [FEAT] 질문에 대한 답변 조회 기능 Mar 3, 2024
@PgmJun PgmJun changed the title [FEAT] 질문에 대한 답변 조회 기능 [FEAT] 질문 답변 조회 기능 Mar 3, 2024
Comment on lines +21 to +34
@Id @GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "answer_id")
var id: Long? = null,

@ManyToOne(fetch = FetchType.LAZY, cascade = [CascadeType.ALL])
@JoinColumn(name = "member_id", nullable = false)
private var member: Member,
@ManyToOne(fetch = FetchType.LAZY, cascade = [CascadeType.ALL])
@JoinColumn(name = "member_id", nullable = false)
var member: Member,

@ManyToOne(fetch = FetchType.LAZY, cascade = [CascadeType.ALL])
@JoinColumn(name = "question_id", nullable = false)
private var question: Question,
@ManyToOne(fetch = FetchType.LAZY, cascade = [CascadeType.ALL])
@JoinColumn(name = "question_id", nullable = false)
var question: Question,

@Column(name = "answer_content", nullable = false)
private var content: String,
@Column(name = "answer_content", nullable = false)
var content: String,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

인텔리제이 기본 포매터인가용?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

인텔리제이 기본 포매터+Tap size 4칸 으로 설정해주면 될 것 같아요!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 기본 포매터로 가는군요! 확인이엽!

Comment on lines 14 to 20
@Transactional(readOnly = true)
fun findAnswerInfoById(id: Long): AnswerInfoResponse {
val answer = answerExplorer.findAnswerById(id)
val question = questionExplorer.findQuestionById(answer.getQuestionId())

return AnswerInfoResponse.of(question, answer)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그 나만보기 설정한 답변 같은 경우에는 본인이 작성한 글인지 validation 과정이 필요할 것 같아요.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

적용 완료했습니다:) 머지할게요!

@orijoon98
Copy link
Member

추가로 대환이형이 적용한 entity 에 _id 패턴이나, retriever, explorer 등 네이밍 컨벤션도 맞춰서 머지하면 좋을 것 같습니다.

Comment on lines +21 to +34
@Id @GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "answer_id")
var id: Long? = null,

@ManyToOne(fetch = FetchType.LAZY, cascade = [CascadeType.ALL])
@JoinColumn(name = "member_id", nullable = false)
private var member: Member,
@ManyToOne(fetch = FetchType.LAZY, cascade = [CascadeType.ALL])
@JoinColumn(name = "member_id", nullable = false)
var member: Member,

@ManyToOne(fetch = FetchType.LAZY, cascade = [CascadeType.ALL])
@JoinColumn(name = "question_id", nullable = false)
private var question: Question,
@ManyToOne(fetch = FetchType.LAZY, cascade = [CascadeType.ALL])
@JoinColumn(name = "question_id", nullable = false)
var question: Question,

@Column(name = "answer_content", nullable = false)
private var content: String,
@Column(name = "answer_content", nullable = false)
var content: String,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

인텔리제이 기본 포매터+Tap size 4칸 으로 설정해주면 될 것 같아요!

private val answerService: AnswerService
) {
@Auth
@Operation(summary = "답변 조회")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

명세서와 동일하게 [인증] 질문 답변 조회 로 바꿔주면 좋을 것 같습니다!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

체킹 감사합니다:)

@PgmJun
Copy link
Member Author

PgmJun commented Mar 9, 2024

추가로 대환이형이 적용한 entity 에 _id 패턴이나, retriever, explorer 등 네이밍 컨벤션도 맞춰서 머지하면 좋을 것 같습니다.

하나의 기능인데 지금 api가 많아져서 PR이 복잡하게 나눠졌네요 다 끝나고 수정하겠습니다..!
explorer validator 등은 최대한 적용해볼게용

@PgmJun PgmJun merged commit 9a3c41c into develop Mar 9, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feat 기능 개발
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] 질문에 대한 답변 조회
3 participants