-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #210 from mju-likelion/feature/lost-item-get-api-#209
Feature/#209 분실물 상세 조회 API 개발
- Loading branch information
Showing
9 changed files
with
151 additions
and
4 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
30 changes: 30 additions & 0 deletions
30
src/main/java/org/mju_likelion/festival/lost_item/domain/LostItemDetail.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,30 @@ | ||
package org.mju_likelion.festival.lost_item.domain; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.UUID; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public class LostItemDetail { | ||
|
||
private final UUID id; | ||
private final String title; | ||
private final String content; | ||
private final String imageUrl; | ||
private final LocalDateTime createdAt; | ||
private final Boolean isFounded; | ||
|
||
@Override | ||
public String toString() { | ||
return "SimpleLostItem{" + | ||
"id=" + id + '\'' + | ||
", title='" + title + '\'' + | ||
", content='" + content + '\'' + | ||
", imageUrl='" + imageUrl + '\'' + | ||
", createdAt=" + createdAt + '\'' + | ||
", isFounded=" + isFounded + | ||
'}'; | ||
} | ||
} |
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
53 changes: 53 additions & 0 deletions
53
src/main/java/org/mju_likelion/festival/lost_item/dto/response/LostItemDetailResponse.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,53 @@ | ||
package org.mju_likelion.festival.lost_item.dto.response; | ||
|
||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; | ||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; | ||
import java.time.LocalDateTime; | ||
import java.util.UUID; | ||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import org.mju_likelion.festival.lost_item.domain.LostItemDetail; | ||
|
||
@Getter | ||
@AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
@NoArgsConstructor | ||
public class LostItemDetailResponse { | ||
|
||
private UUID id; | ||
private String title; | ||
private String content; | ||
private String imageUrl; | ||
@JsonSerialize(using = LocalDateTimeSerializer.class) | ||
@JsonDeserialize(using = LocalDateTimeDeserializer.class) | ||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm") | ||
private LocalDateTime createdAt; | ||
private Boolean isFounded; | ||
|
||
public static LostItemDetailResponse from(final LostItemDetail lostItemDetail) { | ||
return new LostItemDetailResponse( | ||
lostItemDetail.getId(), | ||
lostItemDetail.getTitle(), | ||
lostItemDetail.getContent(), | ||
lostItemDetail.getImageUrl(), | ||
lostItemDetail.getCreatedAt(), | ||
lostItemDetail.getIsFounded() | ||
); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "SimpleLostItem{" + | ||
"id=" + id + '\'' + | ||
", title='" + title + '\'' + | ||
", content='" + content + '\'' + | ||
", imageUrl='" + imageUrl + '\'' + | ||
", createdAt=" + createdAt + '\'' + | ||
", isFounded=" + isFounded + | ||
'}'; | ||
} | ||
} |
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