-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UI 관련 API 수정 요청 반영, PetVideo 조회 로직의 오류 수정 등
UI 관련 API 수정 요청 반영, PetVideo 조회 로직의 오류 수정 등
- Loading branch information
Showing
9 changed files
with
65 additions
and
54 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
34 changes: 18 additions & 16 deletions
34
animory/src/main/java/com/daggle/animory/domain/pet/dto/response/NewPetDto.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,30 +1,32 @@ | ||
package com.daggle.animory.domain.pet.dto.response; | ||
|
||
import com.daggle.animory.domain.pet.entity.AdoptionStatus; | ||
import com.daggle.animory.domain.pet.entity.Pet; | ||
import com.daggle.animory.domain.pet.entity.Sex; | ||
import com.daggle.animory.domain.pet.util.PetAgeToBirthDateConverter; | ||
import lombok.Builder; | ||
|
||
@Builder | ||
public record NewPetDto( | ||
Integer petId, | ||
String petName, | ||
String petAge, | ||
String profileImageUrl, | ||
String adoptionStatus, | ||
Integer shelterId, | ||
String shelterName | ||
Integer petId, | ||
String petName, | ||
String petAge, | ||
Sex sex, | ||
String profileImageUrl, | ||
String adoptionStatus, | ||
Integer shelterId, | ||
String shelterName | ||
) { | ||
|
||
public static NewPetDto fromEntity(final Pet pet) { | ||
return NewPetDto.builder() | ||
.petId(pet.getId()) | ||
.petName(pet.getName()) | ||
.petAge(PetAgeToBirthDateConverter.birthDateToAge(pet.getBirthDate())) | ||
.profileImageUrl(pet.getProfileImageUrl()) | ||
.adoptionStatus(pet.getAdoptionStatus().getMessage()) | ||
.shelterId(pet.getShelter().getId()) | ||
.shelterName(pet.getShelter().getName()) | ||
.build(); | ||
.petId(pet.getId()) | ||
.petName(pet.getName()) | ||
.petAge(PetAgeToBirthDateConverter.birthDateToAge(pet.getBirthDate())) | ||
.sex(pet.getSex()) | ||
.profileImageUrl(pet.getProfileImageUrl()) | ||
.adoptionStatus(pet.getAdoptionStatus().getMessage()) | ||
.shelterId(pet.getShelter().getId()) | ||
.shelterName(pet.getShelter().getName()) | ||
.build(); | ||
} | ||
} |
33 changes: 18 additions & 15 deletions
33
animory/src/main/java/com/daggle/animory/domain/pet/dto/response/SosPetDto.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,31 +1,34 @@ | ||
package com.daggle.animory.domain.pet.dto.response; | ||
|
||
import com.daggle.animory.domain.pet.entity.Pet; | ||
import com.daggle.animory.domain.pet.entity.Sex; | ||
import com.daggle.animory.domain.pet.util.PetAgeToBirthDateConverter; | ||
import lombok.Builder; | ||
|
||
import java.time.LocalDate; | ||
|
||
@Builder | ||
public record SosPetDto( | ||
Integer petId, | ||
String petName, | ||
String petAge, | ||
String profileImageUrl, | ||
LocalDate protectionExpirationDate, | ||
Integer shelterId, | ||
String shelterName | ||
Integer petId, | ||
String petName, | ||
String petAge, | ||
Sex sex, | ||
String profileImageUrl, | ||
LocalDate protectionExpirationDate, | ||
Integer shelterId, | ||
String shelterName | ||
) { | ||
|
||
public static SosPetDto fromEntity(final Pet pet) { | ||
return SosPetDto.builder() | ||
.petId(pet.getId()) | ||
.petName(pet.getName()) | ||
.petAge(PetAgeToBirthDateConverter.birthDateToAge(pet.getBirthDate())) | ||
.profileImageUrl(pet.getProfileImageUrl()) | ||
.protectionExpirationDate(pet.getProtectionExpirationDate()) | ||
.shelterId(pet.getShelter().getId()) | ||
.shelterName(pet.getShelter().getName()) | ||
.build(); | ||
.petId(pet.getId()) | ||
.petName(pet.getName()) | ||
.petAge(PetAgeToBirthDateConverter.birthDateToAge(pet.getBirthDate())) | ||
.sex(pet.getSex()) | ||
.profileImageUrl(pet.getProfileImageUrl()) | ||
.protectionExpirationDate(pet.getProtectionExpirationDate()) | ||
.shelterId(pet.getShelter().getId()) | ||
.shelterName(pet.getShelter().getName()) | ||
.build(); | ||
} | ||
} |
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
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