-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 미션 내역 상세 조회 * fix: duration toMinutes로 변경 * fix: description 수정 * fix: MISSION_RECORD_USER_MISMATCH statusCode 400 -> 403
- Loading branch information
Showing
6 changed files
with
98 additions
and
9 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
47 changes: 47 additions & 0 deletions
47
...in/java/com/depromeet/domain/missionRecord/dto/response/MissionRecordFindOneResponse.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,47 @@ | ||
package com.depromeet.domain.missionRecord.dto.response; | ||
|
||
import com.depromeet.domain.missionRecord.domain.MissionRecord; | ||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import java.time.Duration; | ||
import java.time.LocalDateTime; | ||
|
||
public record MissionRecordFindOneResponse( | ||
@Schema(description = "미션 기록 ID", defaultValue = "1") Long recordId, | ||
@Schema(description = "미션 기록 일지", defaultValue = "default MissionRecord Remark") | ||
String remark, | ||
@Schema( | ||
description = "미션 기록 인증 사진 Url", | ||
defaultValue = "https://ik.imagekit.io/demo/medium_cafe_B1iTdD0C.jpg") | ||
String imageUrl, | ||
@Schema(description = "미션 수행한 시간", defaultValue = "21") long duration, | ||
@Schema(description = "미션 시작한 지 N일차", defaultValue = "3") long sinceDay, | ||
@JsonFormat( | ||
shape = JsonFormat.Shape.STRING, | ||
pattern = "yyyy-MM-dd HH:mm:ss", | ||
timezone = "Asia/Seoul") | ||
@Schema( | ||
description = "미션 기록 시작 시간", | ||
defaultValue = "2023-01-03 00:00:00", | ||
type = "string") | ||
LocalDateTime startedAt, | ||
@JsonFormat( | ||
shape = JsonFormat.Shape.STRING, | ||
pattern = "yyyy-MM-dd HH:mm:ss", | ||
timezone = "Asia/Seoul") | ||
@Schema( | ||
description = "미션 기록 종료 시간", | ||
defaultValue = "2024-01-03 00:34:00", | ||
type = "string") | ||
LocalDateTime finishedAt) { | ||
public static MissionRecordFindOneResponse from(MissionRecord missionRecord) { | ||
return new MissionRecordFindOneResponse( | ||
missionRecord.getId(), | ||
missionRecord.getRemark(), | ||
missionRecord.getImageUrl(), | ||
missionRecord.getDuration().toMinutes(), | ||
Duration.between(missionRecord.getStartedAt(), LocalDateTime.now()).toDays(), | ||
missionRecord.getStartedAt(), | ||
missionRecord.getFinishedAt()); | ||
} | ||
} |
34 changes: 28 additions & 6 deletions
34
src/main/java/com/depromeet/domain/missionRecord/dto/response/MissionRecordFindResponse.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
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