Skip to content

Commit

Permalink
Merge pull request #41 from anxi01/feature/판매점-검색시-storeId-추가-반환
Browse files Browse the repository at this point in the history
Feature : 판매점 검색시 storeId 추가 반환
  • Loading branch information
anxi01 authored Mar 30, 2024
2 parents d6e2843 + e9397f8 commit e4c9b18
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public static class SearchLocalItem {
private int mapx;
private int mapy;
private boolean selling;
private long storeId;

public String getTitle() {
return deleteHtmlTags(this.title);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ public StoreListResponse search(String query) {

if (isSelling) {
item.setSellingTrue();

Store store = storeRepository.findByNameAndMapxAndMapyAndSellingIsTrue(
item.getTitle(), item.getMapx(), item.getMapy());

item.setStoreId(store.getId());
}

storeInfos.add(item);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ public interface StoreRepository extends JpaRepository<Store, Long> {
Boolean existsByNameAndMapxAndMapyAndSellingIsTrue(String name, int mapx, int mapy);

List<Store> findAllByUser(User user);

Store findByNameAndMapxAndMapyAndSellingIsTrue(String title, int mapx, int mapy);
}

0 comments on commit e4c9b18

Please sign in to comment.