-
Notifications
You must be signed in to change notification settings - Fork 1
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 #26 from 9oormthon-univ/feat/store
[FEAT] 가게 검색 구현
- Loading branch information
Showing
21 changed files
with
286 additions
and
27 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
11 changes: 11 additions & 0 deletions
11
src/main/java/com/groom/swipo/domain/payment/dto/request/PaymentCompleteRequest.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,9 +1,20 @@ | ||
package com.groom.swipo.domain.payment.dto.request; | ||
|
||
import com.groom.swipo.domain.payment.entity.Pay; | ||
import com.groom.swipo.domain.payment.entity.Paylist; | ||
import com.groom.swipo.domain.store.entity.Store; | ||
|
||
public record PaymentCompleteRequest( | ||
Long storeId, | ||
String password, | ||
Integer amount, | ||
Integer usedPoints | ||
) { | ||
public Paylist toEntity(Pay pay, Store store) { | ||
return Paylist.builder() | ||
.value(amount - usedPoints) | ||
.pay(pay) | ||
.store(store) | ||
.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
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
36 changes: 36 additions & 0 deletions
36
src/main/java/com/groom/swipo/domain/store/dto/StoreDetail.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,36 @@ | ||
package com.groom.swipo.domain.store.dto; | ||
|
||
import java.util.List; | ||
|
||
import com.groom.swipo.domain.store.entity.Store; | ||
|
||
import lombok.Builder; | ||
|
||
@Builder | ||
public record StoreDetail( | ||
Long storeId, | ||
String name, | ||
String address, | ||
Integer percent, | ||
Double stars, | ||
boolean isWish, | ||
Integer reviewsNum, | ||
String review, | ||
Integer imagesNum, | ||
List<String> imageUrls | ||
) { | ||
public static StoreDetail of(Store store, Double stars, boolean isWish, String review, List<String> images) { | ||
return StoreDetail.builder() | ||
.storeId(store.getId()) | ||
.name(store.getName()) | ||
.address(store.getAddress()) | ||
.percent(store.getPercent()) | ||
.stars(stars) | ||
.isWish(isWish) | ||
.reviewsNum(store.getReviews().size()) | ||
.review(review) | ||
.imagesNum(images.size()) | ||
.imageUrls(images) | ||
.build(); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/com/groom/swipo/domain/store/dto/response/StoreSearchResponse.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,21 @@ | ||
package com.groom.swipo.domain.store.dto.response; | ||
|
||
import java.util.List; | ||
|
||
import com.groom.swipo.domain.store.dto.StoreDetail; | ||
import com.groom.swipo.global.common.PageInfo; | ||
|
||
import lombok.Builder; | ||
|
||
@Builder | ||
public record StoreSearchResponse( | ||
PageInfo pageInfo, | ||
List<StoreDetail> stores | ||
) { | ||
public static StoreSearchResponse of(PageInfo pageInfo, List<StoreDetail> stores) { | ||
return StoreSearchResponse.builder() | ||
.pageInfo(pageInfo) | ||
.stores(stores) | ||
.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
5 changes: 5 additions & 0 deletions
5
src/main/java/com/groom/swipo/domain/store/entity/enums/StoreCategory.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,5 @@ | ||
package com.groom.swipo.domain.store.entity.enums; | ||
|
||
public enum StoreCategory { | ||
CAFE, DESSERT, RESTAURANT, MART, PROP, LODGMENT | ||
} |
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
Oops, something went wrong.