Skip to content

Commit

Permalink
feat: ScheduleFindResponse.java 구현
Browse files Browse the repository at this point in the history
Resolves: #38
  • Loading branch information
jiwon83 committed Nov 23, 2024
1 parent ed2643d commit 3378cff
Showing 1 changed file with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.wypl.wyplcore.schedule.data.response;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.wypl.jpacalendardomain.calendar.domain.Schedule;

import java.time.LocalDateTime;

public record ScheduleFindResponse(

@JsonProperty("schedule_id")
long scheduleId,

@JsonProperty("title")
String title,

@JsonProperty("description")
String description,

@JsonProperty("start_date_time")
LocalDateTime startDateTime,

@JsonProperty("end_date_time")
LocalDateTime endDateTime

) {


public static ScheduleFindResponse of(Schedule schedule, LocalDateTime startDateTime, LocalDateTime endDateTime) {
return new ScheduleFindResponse(
schedule.getId(),
schedule.getTitle(),
schedule.getDescription(),
startDateTime,
endDateTime
);
}
}

0 comments on commit 3378cff

Please sign in to comment.