Skip to content

Commit

Permalink
Merge pull request #14 from onetime-with-members/feature/#9/schedule-api
Browse files Browse the repository at this point in the history
[Refactor] : 요일 & 날짜 스케줄 응답 형식 통일
  • Loading branch information
bbbang105 authored Aug 19, 2024
2 parents dd235a1 + b42c48d commit 23dd087
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/main/java/side/onetime/dto/EventDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import side.onetime.domain.Event;
import side.onetime.global.common.constant.Category;

import java.time.LocalTime;
import java.util.List;
import java.util.UUID;

Expand Down
8 changes: 7 additions & 1 deletion src/main/java/side/onetime/dto/ScheduleDto.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package side.onetime.dto;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import lombok.AllArgsConstructor;
Expand All @@ -10,7 +11,6 @@
import side.onetime.domain.Member;
import side.onetime.domain.Selection;

import java.time.LocalTime;
import java.util.ArrayList;
import java.util.List;

Expand All @@ -24,6 +24,7 @@ public class ScheduleDto {
public static class CreateDayScheduleRequest {
private String eventId;
private String memberId;
@JsonProperty("schedules")
private List<DaySchedule> daySchedules;
}

Expand All @@ -34,6 +35,7 @@ public static class CreateDayScheduleRequest {
@JsonNaming(value = PropertyNamingStrategies.SnakeCaseStrategy.class)
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class DaySchedule {
@JsonProperty("time_point")
private String day;
private List<String> times;

Expand All @@ -58,6 +60,7 @@ public static DaySchedule of(List<Selection> selections) {
public static class CreateDateScheduleRequest {
private String eventId;
private String memberId;
@JsonProperty("schedules")
private List<DateSchedule> dateSchedules;
}

Expand All @@ -68,6 +71,7 @@ public static class CreateDateScheduleRequest {
@JsonNaming(value = PropertyNamingStrategies.SnakeCaseStrategy.class)
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class DateSchedule {
@JsonProperty("time_point")
private String date;
private List<String> times;

Expand All @@ -91,6 +95,7 @@ public static DateSchedule of(List<Selection> selections) {
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class PerDaySchedulesResponse {
private String name;
@JsonProperty("schedules")
private List<DaySchedule> daySchedules;

public static PerDaySchedulesResponse of(Member member, List<DaySchedule> daySchedules) {
Expand All @@ -109,6 +114,7 @@ public static PerDaySchedulesResponse of(Member member, List<DaySchedule> daySch
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class PerDateSchedulesResponse {
private String name;
@JsonProperty("schedules")
private List<DateSchedule> dateSchedules;

public static PerDateSchedulesResponse of(Member member, List<DateSchedule> dateSchedules) {
Expand Down

0 comments on commit 23dd087

Please sign in to comment.