Skip to content

Commit d134e80

Browse files
committed
feat(schedule): DTO에 JPQL 보조 생성자 추가
1 parent f0f73f5 commit d134e80

File tree

4 files changed

+68
-1
lines changed

4 files changed

+68
-1
lines changed

src/main/java/back/kalender/domain/schedule/controller/ScheduleController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public class ScheduleController {
6464
content = @Content(examples = @ExampleObject(value = """
6565
{
6666
"error": {
67-
"code": "INVALID_INPUT_VALUE",
67+
"code": "002",
6868
"status": "400",
6969
"message": "유효하지 않은 입력값입니다."
7070
}

src/main/java/back/kalender/domain/schedule/dto/response/DailyScheduleItem.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,25 @@ public record DailyScheduleItem(
3131
@Schema(description = "일정 장소 (선택 사항)", example = "KBS 신관 공개홀")
3232
Optional<String> location
3333
) {
34+
public DailyScheduleItem(
35+
Long scheduleId,
36+
String artistName,
37+
String title,
38+
ScheduleCategory scheduleCategory,
39+
LocalDateTime scheduleTime,
40+
Long performanceId,
41+
String link,
42+
String location
43+
) {
44+
this(
45+
scheduleId,
46+
artistName,
47+
title,
48+
scheduleCategory,
49+
scheduleTime,
50+
Optional.ofNullable(performanceId),
51+
Optional.ofNullable(link),
52+
Optional.ofNullable(location)
53+
);
54+
}
3455
}

src/main/java/back/kalender/domain/schedule/dto/response/MonthlyScheduleItem.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,27 @@ public record MonthlyScheduleItem(
3535
@Schema(description = "일정 장소 (선택 사항)", example = "고척 스카이돔")
3636
Optional<String> location
3737
) {
38+
public MonthlyScheduleItem(
39+
Long scheduleId,
40+
Long artistId,
41+
String artistName,
42+
String title,
43+
ScheduleCategory scheduleCategory,
44+
LocalDateTime scheduleTime,
45+
Long performanceId,
46+
LocalDate date,
47+
String location
48+
) {
49+
this(
50+
scheduleId,
51+
artistId,
52+
artistName,
53+
title,
54+
scheduleCategory,
55+
scheduleTime,
56+
Optional.ofNullable(performanceId),
57+
date,
58+
Optional.ofNullable(location)
59+
);
60+
}
3861
}

src/main/java/back/kalender/domain/schedule/dto/response/UpcomingEventItem.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,27 @@ public record UpcomingEventItem(
3434
@Schema(description = "일정 장소 (선택 사항)", example = "코엑스 라이브플라자")
3535
Optional<String> location
3636
) {
37+
public UpcomingEventItem(
38+
Long scheduleId,
39+
String artistName,
40+
String title,
41+
ScheduleCategory scheduleCategory,
42+
LocalDateTime scheduleTime,
43+
Long performanceId,
44+
String link,
45+
Long daysUntilEvent,
46+
String location
47+
) {
48+
this(
49+
scheduleId,
50+
artistName,
51+
title,
52+
scheduleCategory,
53+
scheduleTime,
54+
Optional.ofNullable(performanceId),
55+
Optional.ofNullable(link),
56+
daysUntilEvent,
57+
Optional.ofNullable(location)
58+
);
59+
}
3760
}

0 commit comments

Comments
 (0)