-
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.
Browse files
Browse the repository at this point in the history
feat: v2 엔드 포인트 및 모델 추가
- Loading branch information
Showing
7 changed files
with
80 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
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
...in/feed/dto/response/FeedGetResponse.java → ...feed/dto/response/v1/FeedGetResponse.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
37 changes: 37 additions & 0 deletions
37
...ain/java/com/depromeet/stonebed/domain/feed/dto/response/v2/FeedContentGetResponseV2.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,37 @@ | ||
package com.depromeet.stonebed.domain.feed.dto.response.v2; | ||
|
||
import com.depromeet.stonebed.domain.feed.dto.FindFeedDto; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import java.time.LocalDate; | ||
|
||
public record FeedContentGetResponseV2( | ||
@Schema(description = "미션 ID", example = "1") Long missionId, | ||
@Schema(description = "미션 제목", example = "산책하기") String missionTitle, | ||
@Schema(description = "미션 완료 메시지", example = "산책하기 미션을 수행했어요!") | ||
String missionCompleteMessage, | ||
@Schema(description = "미션 기록 ID", example = "1") Long missionRecordId, | ||
@Schema(description = "작성자 ID", example = "1") Long authorId, | ||
@Schema(description = "작성자 프로필 닉네임") String authorProfileNickname, | ||
@Schema(description = "작성자 프로필 이미지 URL") String authorProfileImageUrl, | ||
@Schema(description = "미션 기록 이미지 URL", example = "example.jpeg") | ||
String missionRecordImageUrl, | ||
@Schema(description = "미션 기록 생성일") LocalDate createdDate, | ||
@Schema(description = "부스트") Long totalBoostCount, | ||
@Schema(description = "댓글 수", example = "12") Integer totalCommentCount, | ||
@Schema(description = "미션 기록 컨텐츠") String content) { | ||
public static FeedContentGetResponseV2 from(FindFeedDto missionRecord) { | ||
return new FeedContentGetResponseV2( | ||
missionRecord.mission().getId(), | ||
missionRecord.mission().getTitle(), | ||
missionRecord.mission().getCompleteMessage(), | ||
missionRecord.missionRecord().getId(), | ||
missionRecord.author().getId(), | ||
missionRecord.author().getProfile().getNickname(), | ||
missionRecord.author().getProfile().getProfileImageUrl(), | ||
missionRecord.missionRecord().getImageUrl(), | ||
missionRecord.missionRecord().getCreatedAt().toLocalDate(), | ||
missionRecord.totalBoostCount(), | ||
missionRecord.totalCommentCount(), | ||
missionRecord.missionRecord().getContent()); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/com/depromeet/stonebed/domain/feed/dto/response/v2/FeedGetResponseV2.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,12 @@ | ||
package com.depromeet.stonebed.domain.feed.dto.response.v2; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import java.util.List; | ||
|
||
public record FeedGetResponseV2( | ||
List<FeedContentGetResponseV2> list, | ||
@Schema(description = "커서 위치", example = "1") String nextCursor) { | ||
public static FeedGetResponseV2 from(List<FeedContentGetResponseV2> list, String nextCursor) { | ||
return new FeedGetResponseV2(list, nextCursor); | ||
} | ||
} |
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