-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 해당하는 루틴의 상세 데이터를 반환 - 루틴 내부의 운동을 찾을 수 없는 경우 예외 추가
- Loading branch information
Showing
10 changed files
with
233 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/com/ogjg/daitgym/domain/routine/ExerciseDetail.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 107 additions & 0 deletions
107
src/main/java/com/ogjg/daitgym/routine/dto/RoutineDetailsResponseDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
package com.ogjg.daitgym.routine.dto; | ||
|
||
import lombok.Builder; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
|
||
public class RoutineDetailsResponseDto { | ||
|
||
private String writer; | ||
private String writerImg; | ||
private LocalDateTime createdAt; | ||
private String title; | ||
private String description; | ||
private boolean liked; | ||
private int likeCounts; | ||
private int scrapCounts; | ||
private RoutineDto routine; | ||
|
||
@Builder | ||
public RoutineDetailsResponseDto(String writer, String writerImg, LocalDateTime createdAt, String title, String description, boolean liked, int likeCounts, int scrapCounts, RoutineDto routine) { | ||
this.writer = writer; | ||
this.writerImg = writerImg; | ||
this.createdAt = createdAt; | ||
this.title = title; | ||
this.description = description; | ||
this.liked = liked; | ||
this.likeCounts = likeCounts; | ||
this.scrapCounts = scrapCounts; | ||
this.routine = routine; | ||
} | ||
|
||
public static class RoutineDto { | ||
private Long id; | ||
private List<DayDto> days; | ||
|
||
@Builder | ||
public RoutineDto(Long id, List<DayDto> days) { | ||
this.id = id; | ||
this.days = days; | ||
} | ||
} | ||
|
||
public static class DayDto { | ||
private Long id; | ||
private int order; | ||
private boolean isSpread; | ||
private List<ExerciseDto> exercises; | ||
|
||
@Builder | ||
public DayDto(Long id, int order, boolean isSpread, List<ExerciseDto> exercises) { | ||
this.id = id; | ||
this.order = order; | ||
this.isSpread = isSpread; | ||
this.exercises = exercises; | ||
} | ||
} | ||
|
||
public static class ExerciseDto { | ||
private Long id; | ||
private int order; | ||
private String name; | ||
private String part; | ||
private RestTimeDto restTime; | ||
private List<ExerciseSets> exerciseSets; | ||
|
||
@Builder | ||
public ExerciseDto(Long id, int order, String name, String part, RestTimeDto restTime, List<ExerciseSets> exerciseSets) { | ||
this.id = id; | ||
this.order = order; | ||
this.name = name; | ||
this.part = part; | ||
this.restTime = restTime; | ||
this.exerciseSets = exerciseSets; | ||
} | ||
} | ||
|
||
public static class RestTimeDto { | ||
private int hours; | ||
private int minutes; | ||
private int seconds; | ||
|
||
@Builder | ||
public RestTimeDto(int hours, int minutes, int seconds) { | ||
this.hours = hours; | ||
this.minutes = minutes; | ||
this.seconds = seconds; | ||
} | ||
} | ||
|
||
public static class ExerciseSets { | ||
private Long id; | ||
private int order; | ||
private int weights; | ||
private int counts; | ||
private boolean completed; | ||
|
||
@Builder | ||
public ExerciseSets(Long id, int order, int weights, int counts, boolean completed) { | ||
this.id = id; | ||
this.order = order; | ||
this.weights = weights; | ||
this.counts = counts; | ||
this.completed = completed; | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/com/ogjg/daitgym/routine/exception/NoExerciseInRoutine.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.ogjg.daitgym.routine.exception; | ||
|
||
import com.ogjg.daitgym.common.exception.CustomException; | ||
import com.ogjg.daitgym.common.exception.ErrorCode; | ||
import com.ogjg.daitgym.common.exception.ErrorData; | ||
|
||
public class NoExerciseInRoutine extends CustomException { | ||
public NoExerciseInRoutine() { | ||
super(ErrorCode.NO_EXERCISE_IN_ROUTINE); | ||
} | ||
|
||
public NoExerciseInRoutine(String message) { | ||
super(ErrorCode.NO_EXERCISE_IN_ROUTINE, message); | ||
} | ||
|
||
public NoExerciseInRoutine(ErrorData errorData) { | ||
super(ErrorCode.NO_EXERCISE_IN_ROUTINE, errorData); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters