Skip to content

Commit

Permalink
Merge pull request #54 from YAPP-Github/feat/PC-580-profile-talk-guides
Browse files Browse the repository at this point in the history
[PC-580] 프로필 가치관 톡 조회 응답 형식 변경
  • Loading branch information
Lujaec authored Feb 14, 2025
2 parents 7770fa0 + 66e16ea commit 8114f28
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
package org.yapp.domain.profile.presentation.response;

import java.util.List;
import org.yapp.core.domain.profile.ProfileValueTalk;
import org.yapp.core.domain.value.ValueTalk;

public record ProfileValueTalkResponse(
String title,
String category,
Long profileValueTalkId,
String answer,
String summary
String summary,
String placeholder,
List<String> guides
) {

public ProfileValueTalkResponse(ProfileValueTalk profileValueTalk) {
this(
profileValueTalk.getValueTalk().getTitle(),
profileValueTalk.getValueTalk().getCategory(),
public static ProfileValueTalkResponse from(ProfileValueTalk profileValueTalk) {
ValueTalk valueTalk = profileValueTalk.getValueTalk();

return new ProfileValueTalkResponse(
valueTalk.getTitle(),
valueTalk.getCategory(),
profileValueTalk.getId(),
profileValueTalk.getAnswer(),
profileValueTalk.getSummary()
profileValueTalk.getSummary(),
valueTalk.getPlaceholder(),
valueTalk.getGuides()
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public record ProfileValueTalkResponses(List<ProfileValueTalkResponse> responses

public static ProfileValueTalkResponses from(List<ProfileValueTalk> profileValueTalks) {
List<ProfileValueTalkResponse> profileValueTalkResponses = profileValueTalks.stream()
.map(ProfileValueTalkResponse::new).toList();
.map(ProfileValueTalkResponse::from).toList();

return new ProfileValueTalkResponses(profileValueTalkResponses);
}
Expand Down

0 comments on commit 8114f28

Please sign in to comment.