Skip to content

Commit

Permalink
chore: Answer 닉네임 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
jihyo-j committed May 21, 2024
1 parent bc6269c commit a9afdd5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ public class AnswerCreateRequest {



public AnswerCreateRequest(Long questionId, String content, String nickname,
public AnswerCreateRequest(Long questionId, String content,
Boolean profileOnOff, String linkAttachments,
String musicName, String musicSinger, String musicAudioUrl, String imageUrl, boolean updateImage) {
this.questionId = questionId;
this.content = content;
this.nickname = nickname;
this.profileOnOff = profileOnOff;
this.linkAttachments = linkAttachments;
this.musicName = musicName;
Expand All @@ -36,10 +35,10 @@ public AnswerCreateRequest(Long questionId, String content, String nickname,

}

public static AnswerCreateRequest of(Long questionId, String content, String nickname,
public static AnswerCreateRequest of(Long questionId, String content,
Boolean profileOnOff, String linkAttachments,
String musicName, String musicSinger, String musicAudioUrl, String imageUrl, boolean updateImage) {
return new AnswerCreateRequest(questionId, content, nickname, profileOnOff, linkAttachments,
return new AnswerCreateRequest(questionId, content, profileOnOff, linkAttachments,
musicName, musicSinger, musicAudioUrl, imageUrl, updateImage);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public class AnswerDetailResponse {
private Long memberId;
private String content;
private String nickname;
private String memberNickname;
private Boolean profileOnOff;
private String linkAttachments;
private String musicName;
Expand All @@ -25,7 +24,7 @@ public class AnswerDetailResponse {


public AnswerDetailResponse(Long answerId, Long questionId, String questionContent, Long memberId,
String nickname, String content, String memberNickname, Boolean profileOnOff,
String content, String nickname, Boolean profileOnOff,
String linkAttachments, String musicName, String musicSinger, String musicAudioUrl,
String imageUrl, LocalDateTime createdDate) {

Expand All @@ -36,7 +35,6 @@ public AnswerDetailResponse(Long answerId, Long questionId, String questionConte
this.memberId = memberId;
this.content = content;
this.nickname = nickname;
this.memberNickname = memberNickname;
this.profileOnOff = profileOnOff;
this.linkAttachments = linkAttachments;
this.musicName = musicName;
Expand All @@ -47,10 +45,10 @@ public AnswerDetailResponse(Long answerId, Long questionId, String questionConte
}

public static AnswerDetailResponse of(Long answerId, Long questionId, String questionContent, Long memberId,
String content, String nickname, String memberNickname, Boolean profileOnOff,
String content, String nickname, Boolean profileOnOff,
String linkAttachments, String musicName, String musicSinger, String musicAudioUrl,
String imageUrl, LocalDateTime createdDate) {
return new AnswerDetailResponse(answerId, questionId, questionContent, memberId, content, nickname, memberNickname,
return new AnswerDetailResponse(answerId, questionId, questionContent, memberId, content, nickname,
profileOnOff, linkAttachments, musicName, musicSinger, musicAudioUrl, imageUrl, createdDate);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ public Answer toEntity(AnswerCreateRequest request, Question question, Member me
.musicAudioUrl(request.getMusicAudioUrl())
.build();

String senderNickname = question.getSender().getNickname();

// Answer 엔티티 생성 및 Music 설정
Answer answer = Answer.builder()
.question(question)
.member(member)
.content(request.getContent())
.nickname(request.getNickname())
.nickname(senderNickname)
.linkAttachments(request.getLinkAttachments())
.profileOnOff(request.getProfileOnOff())
.createdDate(LocalDateTime.now())
Expand All @@ -47,14 +49,14 @@ public AnswerDetailResponse toDomain(Answer answer) {
Member member = answer.getMember();
Question question = answer.getQuestion();


return AnswerDetailResponse.of(
answer.getId(),
question.getId(),
question.getContent(),
member.getId(),
answer.getContent(),
answer.getNickname(),
member.getNickname(),
answer.isProfileOnOff(),
answer.getLinkAttachments(),
music != null ? music.getMusicName() : null,
Expand Down

0 comments on commit a9afdd5

Please sign in to comment.