Package inha.git.question.api.mapper
Interface QuestionMapper
public interface QuestionMapper
QuestionMapper는 Question 엔티티와 관련된 데이터 변환 기능을 제공.
-
Method Summary
Modifier and TypeMethodDescriptiondefault QuestionCommentLikecreateQuestionCommentLike(User user, QuestionComment questionComment) default QuestionFieldcreateQuestionField(Question question, Field field) QuestionField를 생성합니다.default QuestionLikecreateQuestionLike(User user, Question question) QuestionLike를 생성합니다.default QuestionReplyCommentLikecreateQuestionReplyCommentLike(User user, QuestionReplyComment questionReplyComment) QuestionReplyCommentLike를 생성합니다.createQuestionRequestToQuestion(CreateQuestionRequest createQuestionRequest, User user, Semester semester, Category category) CreateQuestionRequest를 Question으로 변환합니다.Field를 SearchFieldResponse로 변환합니다.questionToQuestionResponse(Question question) Question을 QuestionResponse로 변환합니다.questionToSearchQuestionResponse(Question question, List<SearchFieldResponse> fieldList, SearchUserResponse author, SearchSemesterResponse semester, SearchLikeState likeState) Question을 SearchQuestionResponse로 변환합니다.toCommentResponse(QuestionComment questionComment) QuestionComment를 CommentResponse로 변환합니다.toCommentWithRepliesResponse(QuestionComment questionComment, Boolean likeState, List<SearchReplyCommentResponse> replies) QuestionComment 엔티티를 CommentWithRepliesResponse로 변환toQuestionComment(CreateCommentRequest createCommentRequest, User user, Question question) CreateCommentRequest를 QuestionComment로 변환합니다.toQuestionReplyComment(CreateReplyCommentRequest createReplyCommentRequest, User user, QuestionComment questionComment) CreateReplyCommentRequest를 QuestionReplyComment로 변환합니다.toReplyCommentResponse(QuestionReplyComment questionReplyComment) QuestionReplyComment를 ReplyCommentResponse로 변환합니다.toSearchReplyCommentResponse(QuestionReplyComment questionReplyComment, boolean likeState) QuestionReplyComment 엔티티를 SearchReplyCommentResponse로 변환voidupdateQuestionRequestToQuestion(UpdateQuestionRequest updateQuestionRequest, Question question, Semester semester, Category category) CreateQuestionRequest를 Question으로 업데이트합니다.default SearchUserResponseuserToSearchUserResponse(User user) User 엔티티를 SearchUserResponse로 변환
-
Method Details
-
createQuestionRequestToQuestion
Question createQuestionRequestToQuestion(CreateQuestionRequest createQuestionRequest, User user, Semester semester, Category category) CreateQuestionRequest를 Question으로 변환합니다.- Parameters:
createQuestionRequest- CreateQuestionRequestuser- User- Returns:
- Question
-
questionToQuestionResponse
Question을 QuestionResponse로 변환합니다.- Parameters:
question- Question- Returns:
- QuestionResponse
-
createQuestionField
QuestionField를 생성합니다.- Parameters:
question- Questionfield- Field- Returns:
- QuestionField
-
updateQuestionRequestToQuestion
void updateQuestionRequestToQuestion(UpdateQuestionRequest updateQuestionRequest, Question question, Semester semester, Category category) CreateQuestionRequest를 Question으로 업데이트합니다.- Parameters:
updateQuestionRequest- UpdateQuestionRequestquestion- Question
-
projectFieldToSearchFieldResponse
Field를 SearchFieldResponse로 변환합니다.- Parameters:
field- Field- Returns:
- SearchFieldResponse
-
questionToSearchQuestionResponse
SearchQuestionResponse questionToSearchQuestionResponse(Question question, List<SearchFieldResponse> fieldList, SearchUserResponse author, SearchSemesterResponse semester, SearchLikeState likeState) Question을 SearchQuestionResponse로 변환합니다.- Parameters:
question- QuestionfieldList- Listauthor- SearchUserResponsesemester- SearchSemesterResponse- Returns:
- SearchQuestionResponse
-
userToSearchUserResponse
User 엔티티를 SearchUserResponse로 변환- Parameters:
user- 사용자 엔티티- Returns:
- SearchUserResponse
-
toQuestionComment
QuestionComment toQuestionComment(CreateCommentRequest createCommentRequest, User user, Question question) CreateCommentRequest를 QuestionComment로 변환합니다.- Parameters:
createCommentRequest- CreateCommentRequestuser- Userquestion- Question- Returns:
- QuestionComment
-
toCommentResponse
QuestionComment를 CommentResponse로 변환합니다.- Parameters:
questionComment- QuestionComment- Returns:
- CommentResponse
-
toQuestionReplyComment
QuestionReplyComment toQuestionReplyComment(CreateReplyCommentRequest createReplyCommentRequest, User user, QuestionComment questionComment) CreateReplyCommentRequest를 QuestionReplyComment로 변환합니다.- Parameters:
createReplyCommentRequest- CreateReplyCommentRequestuser- UserquestionComment- QuestionComment- Returns:
- QuestionReplyComment
-
toReplyCommentResponse
QuestionReplyComment를 ReplyCommentResponse로 변환합니다.- Parameters:
questionReplyComment- QuestionReplyComment- Returns:
- ReplyCommentResponse
-
toCommentWithRepliesResponse
CommentWithRepliesResponse toCommentWithRepliesResponse(QuestionComment questionComment, Boolean likeState, List<SearchReplyCommentResponse> replies) QuestionComment 엔티티를 CommentWithRepliesResponse로 변환- Parameters:
questionComment- 질문 댓글 엔티티likeState- 좋아요 상태replies- 답글- Returns:
- CommentWithRepliesResponse
-
toSearchReplyCommentResponse
SearchReplyCommentResponse toSearchReplyCommentResponse(QuestionReplyComment questionReplyComment, boolean likeState) QuestionReplyComment 엔티티를 SearchReplyCommentResponse로 변환- Parameters:
questionReplyComment- 질문 답글 엔티티likeState- 좋아요 상태- Returns:
- SearchReplyCommentResponse
-
createQuestionCommentLike
-
createQuestionReplyCommentLike
default QuestionReplyCommentLike createQuestionReplyCommentLike(User user, QuestionReplyComment questionReplyComment) QuestionReplyCommentLike를 생성합니다.- Parameters:
user- UserquestionReplyComment- QuestionReplyComment- Returns:
- QuestionReplyCommentLike
-
createQuestionLike
QuestionLike를 생성합니다.- Parameters:
user- Userquestion- Question- Returns:
- QuestionLike
-
questionToSearchLikeState
-