-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Feat: challenge, goal 달성 퍼센테이지 계산 구현 * Test: challenge, goal 달성 퍼센테이지 계산 테스트(러닝 데이터 추가 시) * Feat: 챌린지, 목표 달성 결과 response dto 통합 * Feat: 챌린지, 목표 달성 결과 response dto 통합으로 RunningRecordResultResponseV2 수정 * Fix: 러닝 추가(목표 모드) 시 request goalValues에대한 validation 추가 * Fix: 러닝 기록 저장 시(챌린지 모드) 사용하지 않는 챌린지 일경우 예외처리 추가 * Fix: 챌린지, 목표 러닝 결과 response 통합으로 러닝 기록조회 서비스 함수 수정, 컨트롤러 response(v1) 수정 * Fix: 러닝 루트 리턴시 위도값이 경도 값으로 리턴되는 오류 수정 * Feat: 러닝 기록 조회(V2) 구현 * Docs: 러닝 기록 추가(V2) 문서 수정
- Loading branch information
Showing
14 changed files
with
612 additions
and
163 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
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
36 changes: 23 additions & 13 deletions
36
src/main/java/com/dnd/runus/presentation/v1/running/dto/ChallengeDto.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 |
---|---|---|
@@ -1,21 +1,31 @@ | ||
package com.dnd.runus.presentation.v1.running.dto; | ||
|
||
import com.dnd.runus.domain.challenge.achievement.ChallengeAchievement; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import jakarta.validation.constraints.NotBlank; | ||
|
||
public record ChallengeDto( | ||
@Schema(description = "챌린지 ID") | ||
long challengeId, | ||
@NotBlank | ||
@Schema(description = "챌린지 이름", example = "오늘 30분 동안 뛰기") | ||
String title, | ||
@NotBlank | ||
@Schema(description = "챌린지 결과 문구", example = "성공했어요!") | ||
String subTitle, | ||
@NotBlank | ||
@Schema(description = "챌린지 아이콘 이미지 URL") | ||
String iconUrl, | ||
@Schema(description = "챌린지 성공 여부") | ||
boolean isSuccess | ||
@Schema(description = "챌린지 ID") | ||
long challengeId, | ||
@NotBlank | ||
@Schema(description = "챌린지 이름", example = "오늘 30분 동안 뛰기") | ||
String title, | ||
@NotBlank | ||
@Schema(description = "챌린지 결과 문구", example = "성공했어요!") | ||
String subTitle, | ||
@NotBlank | ||
@Schema(description = "챌린지 아이콘 이미지 URL") | ||
String iconUrl, | ||
@Schema(description = "챌린지 성공 여부") | ||
boolean isSuccess | ||
) { | ||
public static ChallengeDto from(ChallengeAchievement achievement) { | ||
return new ChallengeDto( | ||
achievement.challenge().challengeId(), | ||
achievement.challenge().name(), | ||
achievement.description(), | ||
achievement.challenge().imageUrl(), | ||
achievement.isSuccess() | ||
); | ||
} | ||
} |
27 changes: 18 additions & 9 deletions
27
src/main/java/com/dnd/runus/presentation/v1/running/dto/GoalResultDto.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 |
---|---|---|
@@ -1,17 +1,26 @@ | ||
package com.dnd.runus.presentation.v1.running.dto; | ||
|
||
import com.dnd.runus.domain.goalAchievement.GoalAchievement; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import jakarta.validation.constraints.NotBlank; | ||
|
||
public record GoalResultDto( | ||
@Schema(description = "설정된 목표 제목", example = "2.5km 달성") | ||
String title, | ||
@Schema(description = "설정된 목표 결과 문구", example = "성공했어요!") | ||
String subTitle, | ||
@NotBlank | ||
@Schema(description = "챌린지 아이콘 이미지 URL") | ||
String iconUrl, | ||
@Schema(description = "설정된 목표 성공 여부") | ||
boolean isSuccess | ||
@Schema(description = "설정된 목표 제목", example = "2.5km 달성") | ||
String title, | ||
@Schema(description = "설정된 목표 결과 문구", example = "성공했어요!") | ||
String subTitle, | ||
@NotBlank | ||
@Schema(description = "챌린지 아이콘 이미지 URL") | ||
String iconUrl, | ||
@Schema(description = "설정된 목표 성공 여부") | ||
boolean isSuccess | ||
) { | ||
public static GoalResultDto from(GoalAchievement achievement) { | ||
return new GoalResultDto( | ||
achievement.getTitle(), | ||
achievement.getDescription(), | ||
achievement.getIconUrl(), | ||
achievement.isAchieved() | ||
); | ||
} | ||
} |
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
Oops, something went wrong.