-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
@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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
인텔리제이 기본 포매터인가용?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
인텔리제이 기본 포매터+Tap size 4칸 으로 설정해주면 될 것 같아요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아 기본 포매터로 가는군요! 확인이엽!
@Transactional(readOnly = true) | ||
fun findAnswerInfoById(id: Long): AnswerInfoResponse { | ||
val answer = answerExplorer.findAnswerById(id) | ||
val question = questionExplorer.findQuestionById(answer.getQuestionId()) | ||
|
||
return AnswerInfoResponse.of(question, answer) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
그 나만보기 설정한 답변 같은 경우에는 본인이 작성한 글인지 validation 과정이 필요할 것 같아요.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
적용 완료했습니다:) 머지할게요!
추가로 대환이형이 적용한 entity 에 _id 패턴이나, retriever, explorer 등 네이밍 컨벤션도 맞춰서 머지하면 좋을 것 같습니다. |
@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, |
There was a problem hiding this comment.
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 = "답변 조회") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
명세서와 동일하게 [인증] 질문 답변 조회 로 바꿔주면 좋을 것 같습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
체킹 감사합니다:)
하나의 기능인데 지금 api가 많아져서 PR이 복잡하게 나눠졌네요 다 끝나고 수정하겠습니다..! |
✒️ 관련 이슈번호
🔑 Key Changes
📸 Screenshot
📢 To Reviewers
LikeRepository
에JpaRepository<Member, Repository>
로 되어있는데, 이 부분을 바로 다음 PR에서 처리했습니다.이 부분에 대해서는 신경 안쓰셔도 될 것 같습니다!