forked from kookmin-sw/cap-template
-
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.
Feat : 실종자 상세정보 및 검색기록 리스트 가져오기 api 추가
Feat : 실종자 상세정보 및 검색기록 리스트 가져오기 api 추가
- Loading branch information
Showing
9 changed files
with
143 additions
and
41 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
server/src/main/java/com/capstone/server/dto/MissingPeopleDetailResponseDto.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.capstone.server.dto; | ||
|
||
|
||
import com.capstone.server.model.MissingPeopleEntity; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
|
||
import java.time.LocalDate; | ||
import java.time.LocalDateTime; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
public class MissingPeopleDetailResponseDto { | ||
private Long id; | ||
private String missingPeopleName; | ||
private String gender; | ||
private String status; | ||
private LocalDate birthdate; | ||
private LocalDateTime missingAt; | ||
private String missingLocation; | ||
private String missingPeopleType; | ||
private String profileImage; | ||
//보호자 정보 | ||
private String guardianName; | ||
private String phoneNumber; | ||
private String relationship; | ||
//착장정보 | ||
private final String koQuery; | ||
|
||
protected MissingPeopleDetailResponseDto(MissingPeopleEntity missingPeopleEntity) { | ||
this.id = missingPeopleEntity.getId(); | ||
this.missingPeopleName = missingPeopleEntity.getName(); | ||
// TODO : 숫자로 변경 요망 | ||
this.gender = missingPeopleEntity.getGender().getValue(); | ||
this.status = missingPeopleEntity.getStatus().getValue(); | ||
this.birthdate = missingPeopleEntity.getBirthdate(); | ||
this.missingAt = missingPeopleEntity.getMissingAt(); | ||
this.missingLocation = missingPeopleEntity.getMissingLocation(); | ||
this.missingPeopleType = missingPeopleEntity.getMissingPeopleType().getKor(); | ||
this.profileImage = missingPeopleEntity.getProfileImage(); | ||
this.koQuery = missingPeopleEntity.getKoQuery(); | ||
} | ||
|
||
public static MissingPeopleDetailResponseDto fromEntity(MissingPeopleEntity missingPeopleEntity) { | ||
return new MissingPeopleDetailResponseDto(missingPeopleEntity); | ||
} | ||
} |
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
24 changes: 24 additions & 0 deletions
24
server/src/main/java/com/capstone/server/dto/SearchHistoryListDto.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,24 @@ | ||
package com.capstone.server.dto; | ||
|
||
|
||
import com.capstone.server.model.SearchHistoryEntity; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
public class SearchHistoryListDto { | ||
private Long searchId; | ||
private LocalDateTime createdAt; | ||
|
||
public SearchHistoryListDto(SearchHistoryEntity searchHistory) { | ||
this.searchId = searchHistory.getId(); | ||
this.createdAt = searchHistory.getCreatedAt(); | ||
} | ||
|
||
public static SearchHistoryListDto fromEntity(SearchHistoryEntity searchHistory) { | ||
return new SearchHistoryListDto(searchHistory); | ||
} | ||
} |
7 changes: 3 additions & 4 deletions
7
server/src/main/java/com/capstone/server/repository/GuardianRepository.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,11 +1,10 @@ | ||
package com.capstone.server.repository; | ||
|
||
import com.capstone.server.model.GuardianEntity; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import com.capstone.server.model.GuardianEntity; | ||
|
||
@Repository | ||
public interface GuardianRepository extends JpaRepository<GuardianEntity, Long>{ | ||
|
||
public interface GuardianRepository extends JpaRepository<GuardianEntity, Long> { | ||
GuardianEntity findByMissingPeopleEntityId(Long id); | ||
} |
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
8 changes: 5 additions & 3 deletions
8
server/src/main/java/com/capstone/server/repository/SearchHistoryRepository.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,11 +1,13 @@ | ||
package com.capstone.server.repository; | ||
|
||
import com.capstone.server.model.SearchHistoryEntity; | ||
import org.springframework.data.domain.Page; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import com.capstone.server.model.SearchHistoryEntity; | ||
import java.util.List; | ||
|
||
@Repository | ||
public interface SearchHistoryRepository extends JpaRepository<SearchHistoryEntity, Long>{ | ||
|
||
public interface SearchHistoryRepository extends JpaRepository<SearchHistoryEntity, Long> { | ||
List<SearchHistoryEntity> findByMissingPeopleEntityId(Long id); | ||
} |
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