-
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: 종료미션 중간 커밋 2024.01.15 * feat: 종료미션 보관함 v1 * fix: long casting 이슈 해결 * feat: 2024.01.18 임시 커밋(스케줄러 작업 이후 진행) * fix: spotlessApply * fix: durationStatus 조건으로 변경 * fix: 종료미션 조건 수정 * fix: spotlessApply * feat: 종료미션 slice -> list * feat: 종료미션 달성률 포함 추가 및 개선 * fix: 날짜 between 계산 수정
- Loading branch information
Showing
5 changed files
with
127 additions
and
2 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
43 changes: 43 additions & 0 deletions
43
src/main/java/com/depromeet/domain/mission/dto/response/FinishedMissionResponse.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,43 @@ | ||
package com.depromeet.domain.mission.dto.response; | ||
|
||
import com.depromeet.domain.mission.domain.Mission; | ||
import com.depromeet.domain.mission.domain.MissionCategory; | ||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import java.time.LocalDateTime; | ||
|
||
public record FinishedMissionResponse( | ||
@Schema(description = "미션 ID", defaultValue = "1") Long missionId, | ||
@Schema(description = "미션 이름", defaultValue = "default name") String name, | ||
@Schema(description = "미션 내용", defaultValue = "default content") String content, | ||
@Schema(description = "미션 카테고리", defaultValue = "STUDY") MissionCategory category, | ||
@Schema(description = "미션 달성률", defaultValue = "1.1") double missionAttainRate, | ||
@JsonFormat( | ||
shape = JsonFormat.Shape.STRING, | ||
pattern = "yyyy-MM-dd HH:mm:ss", | ||
timezone = "Asia/Seoul") | ||
@Schema( | ||
description = "미션 시작 시간", | ||
defaultValue = "2024-01-01 00:34: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-15 00:34:00", | ||
type = "string") | ||
LocalDateTime finishedAt) { | ||
public static FinishedMissionResponse of(Mission mission, double missionAttainRate) { | ||
return new FinishedMissionResponse( | ||
mission.getId(), | ||
mission.getName(), | ||
mission.getContent(), | ||
mission.getCategory(), | ||
missionAttainRate, | ||
mission.getStartedAt(), | ||
mission.getFinishedAt()); | ||
} | ||
} |