-
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.
Browse files
Browse the repository at this point in the history
Feat/#37 포토부스 검색 API
- Loading branch information
Showing
9 changed files
with
93 additions
and
3 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
domain/src/main/java/com/pocket/domain/dto/photobooth/PhotoBoothSearchDto.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,7 @@ | ||
package com.pocket.domain.dto.photobooth; | ||
|
||
public record PhotoBoothSearchDto( | ||
Long id, | ||
String name | ||
) { | ||
} |
11 changes: 11 additions & 0 deletions
11
domain/src/main/java/com/pocket/domain/port/photobooth/PhotoBoothSearchPort.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,11 @@ | ||
package com.pocket.domain.port.photobooth; | ||
|
||
import com.pocket.domain.dto.photobooth.PhotoBoothSearchDto; | ||
|
||
import java.util.List; | ||
|
||
public interface PhotoBoothSearchPort { | ||
|
||
List<PhotoBoothSearchDto> searchPhotoBooth(String keyword); | ||
|
||
} |
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
11 changes: 11 additions & 0 deletions
11
domain/src/main/java/com/pocket/domain/usecase/photobooth/PhotoBoothSearchUseCase.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,11 @@ | ||
package com.pocket.domain.usecase.photobooth; | ||
|
||
import com.pocket.domain.dto.photobooth.PhotoBoothSearchDto; | ||
|
||
import java.util.List; | ||
|
||
public interface PhotoBoothSearchUseCase { | ||
|
||
List<PhotoBoothSearchDto> searchPhotoBooth(String keyword); | ||
|
||
} |
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
31 changes: 31 additions & 0 deletions
31
...src/main/java/com/pocket/outbound/adapter/photobooth/adapter/PhotoBoothSerachAdapter.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,31 @@ | ||
package com.pocket.outbound.adapter.photobooth.adapter; | ||
|
||
|
||
import com.pocket.core.aop.annotation.AdapterService; | ||
import com.pocket.domain.dto.photobooth.PhotoBoothSearchDto; | ||
import com.pocket.domain.port.photobooth.PhotoBoothSearchPort; | ||
import com.pocket.outbound.entity.photobooth.JpaPhotoBooth; | ||
import com.pocket.outbound.repository.photobooth.PhotoBoothRepository; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
@AdapterService | ||
@RequiredArgsConstructor | ||
public class PhotoBoothSerachAdapter implements PhotoBoothSearchPort { | ||
|
||
private final PhotoBoothRepository photoBoothRepository; | ||
|
||
public List<PhotoBoothSearchDto> searchPhotoBooth(String keyword) { | ||
List<JpaPhotoBooth> photoBoothList = photoBoothRepository.findByPhotoBoothNameContaining(keyword); | ||
|
||
return photoBoothList.stream() | ||
.map(jpaPhotoBooth -> new PhotoBoothSearchDto( | ||
jpaPhotoBooth.getId(), | ||
jpaPhotoBooth.getPhotoBooth().getName())) | ||
.collect(Collectors.toList()); | ||
} | ||
|
||
} |
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