Skip to content

Commit

Permalink
[MERGE/#124] 후배의 나의 약속 조회 시 응답 값에 약속 별로 선배 Id 추가
Browse files Browse the repository at this point in the history
[FEAT] #124 - 후배의 나의 약속 조회 시 응답 값에 약속 별로 선배 Id 추가
  • Loading branch information
ckkim817 authored Jul 19, 2024
2 parents 0d3d560 + cb8d37d commit 59f3fc9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class AppointmentCard implements Comparable<AppointmentCard> {

private Long appointmentId;
private AppointmentStatus appointmentStatus;
private Long seniorId;
private String nickname;
private String image;
private String field;
Expand All @@ -40,6 +41,7 @@ public class AppointmentCard implements Comparable<AppointmentCard> {
private AppointmentCard(
Long appointmentId,
AppointmentStatus appointmentStatus,
Long seniorId,
String nickname,
String image,
String field,
Expand All @@ -58,6 +60,7 @@ private AppointmentCard(
) {
this.appointmentId = appointmentId;
this.appointmentStatus = appointmentStatus;
this.seniorId = seniorId;
this.nickname = nickname;
this.image = image;
this.field = field;
Expand Down Expand Up @@ -99,6 +102,7 @@ public int compareTo(AppointmentCard other) {
public static AppointmentCard create(
Long appointmentId,
AppointmentStatus appointmentStatus,
Long seniorId,
String nickname,
String image,
String field,
Expand All @@ -118,6 +122,7 @@ public static AppointmentCard create(
return AppointmentCard.builder()
.appointmentId(appointmentId)
.appointmentStatus(appointmentStatus)
.seniorId(seniorId)
.nickname(nickname)
.image(image)
.field(field)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ public AppointmentResponse getAppointment() {

private AppointmentCard createAppointmentCard(Member user, Appointment appointment) {
// init
Long seniorId = null;
String nickname, image, field, department = null;
List<String> topic = null;
String personalTopic = null;
Expand All @@ -212,6 +213,7 @@ private AppointmentCard createAppointmentCard(Member user, Appointment appointme
if (user.getSenior() == null) {
Senior senior = appointment.getSenior();
Member seniorMember = senior.getMember();
seniorId = senior.getId();
nickname = seniorMember.getNickname();
image = seniorMember.getImage();
field = seniorMember.getField();
Expand Down Expand Up @@ -245,6 +247,7 @@ private AppointmentCard createAppointmentCard(Member user, Appointment appointme
return AppointmentCard.create(
appointment.getId(),
appointment.getAppointmentStatus(),
seniorId,
nickname,
image,
field,
Expand Down

0 comments on commit 59f3fc9

Please sign in to comment.