Skip to content

Commit 23a9ff2

Browse files
authored
feat: 내가 그린 코스 조회 시 distance도 반환 (#141)
1 parent ffc9b06 commit 23a9ff2

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/main/java/org/runnect/server/course/dto/response/CourseResponse.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ public class CourseResponse {
1515
private Long id;
1616
private String image;
1717
private LocalDateTime createdAt;
18+
private Float distance;
1819
private String title;
1920
private DepartureResponse departure;
2021

21-
public static CourseResponse of(Long id, String image, LocalDateTime createdAt, String title,
22-
DepartureResponse departure) {
23-
return new CourseResponse(id, image, createdAt, title, departure);
22+
public static CourseResponse of(Long id, String image, LocalDateTime createdAt, Float distance,
23+
String title, DepartureResponse departure) {
24+
return new CourseResponse(id, image, createdAt, distance, title, departure);
2425
}
2526

2627
}

src/main/java/org/runnect/server/course/service/CourseService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ public CourseGetByUserResponseDto getCourseByUser(Long userId) {
8383
course.getId(),
8484
course.getImage(),
8585
course.getCreatedAt(),
86+
course.getDistance(),
8687
course.getTitle(),
8788
DepartureResponse.from(course)
8889
)).collect(Collectors.toList());
@@ -103,6 +104,7 @@ public CourseGetByUserResponseDto getPrivateCourseByUser(Long userId) {
103104
course.getId(),
104105
course.getImage(),
105106
course.getCreatedAt(),
107+
course.getDistance(),
106108
course.getTitle(),
107109
DepartureResponse.from(course)
108110
)).collect(Collectors.toList());

0 commit comments

Comments
 (0)