-
Notifications
You must be signed in to change notification settings - Fork 4
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 #83 from ajy9851/feat/58/get-my-orders
feat: ๊ฐ๊ฒฉ ์์ ๊ธฐ๋ฅ
- Loading branch information
Showing
16 changed files
with
270 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
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
11 changes: 11 additions & 0 deletions
11
src/main/java/com/ordertogether/team14_be/order/details/dto/get/GetCreatorOrderInfoRes.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.ordertogether.team14_be.order.details.dto.get; | ||
|
||
import java.util.List; | ||
|
||
public record GetCreatorOrderInfoRes( | ||
String category, | ||
String storeName, | ||
int minimumOrderAmount, | ||
String pickUpLocation, | ||
String deliveryStatus, | ||
List<MemberBriefInfo> memberInfo) {} |
7 changes: 7 additions & 0 deletions
7
src/main/java/com/ordertogether/team14_be/order/details/dto/get/GetOrdersInfoReq.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.ordertogether.team14_be.order.details.dto.get; | ||
|
||
import java.util.List; | ||
|
||
public record GetOrdersInfoReq( | ||
Integer page, Integer size, List<String> sort // ์ฒซ ๋ฒ์งธ - ์ ๋ ฌํ ํ๋๋ช (DB ๊ธฐ์ค), ๋ ๋ฒ์งธ - ์ ๋ ฌ ์์(desc, asc) | ||
) {} |
5 changes: 5 additions & 0 deletions
5
src/main/java/com/ordertogether/team14_be/order/details/dto/get/GetOrdersInfoRes.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.ordertogether.team14_be.order.details.dto.get; | ||
|
||
import java.util.List; | ||
|
||
public record GetOrdersInfoRes(int totalPages, long totalElements, List<OrderInfo> ordersInfo) {} |
9 changes: 9 additions & 0 deletions
9
...in/java/com/ordertogether/team14_be/order/details/dto/get/GetParticipantOrderInfoRes.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,9 @@ | ||
package com.ordertogether.team14_be.order.details.dto.get; | ||
|
||
public record GetParticipantOrderInfoRes( | ||
String category, | ||
String storeName, | ||
int minimumOrderAmount, | ||
String pickUpLocation, | ||
String deliveryStatus, | ||
int price) {} |
3 changes: 3 additions & 0 deletions
3
src/main/java/com/ordertogether/team14_be/order/details/dto/get/MemberBriefInfo.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,3 @@ | ||
package com.ordertogether.team14_be.order.details.dto.get; | ||
|
||
public record MemberBriefInfo(long memberId, String deliveryName, int price, boolean isPayed) {} |
27 changes: 27 additions & 0 deletions
27
src/main/java/com/ordertogether/team14_be/order/details/dto/get/OrderInfo.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,27 @@ | ||
package com.ordertogether.team14_be.order.details.dto.get; | ||
|
||
import com.ordertogether.team14_be.order.details.entity.OrderDetail; | ||
import com.ordertogether.team14_be.spot.entity.Spot; | ||
|
||
public record OrderInfo( | ||
Long id, | ||
String category, | ||
String storeName, | ||
int minimumOrderAmount, | ||
String pickUpLocation, | ||
String deliveryStatus, | ||
int price, | ||
boolean isCreator) { | ||
|
||
public OrderInfo(Long memberId, OrderDetail order, Spot spot) { | ||
this( | ||
order.getId(), | ||
spot.getCategory().toString(), | ||
spot.getStoreName(), | ||
spot.getMinimumOrderAmount(), | ||
spot.getPickUpLocation(), | ||
spot.getDeliveryStatus(), | ||
order.getPrice(), | ||
spot.getMember().getId().equals(memberId)); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
src/main/java/com/ordertogether/team14_be/order/details/dto/update/UpdateOrderPriceReq.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.ordertogether.team14_be.order.details.dto.update; | ||
|
||
public record UpdateOrderPriceReq(Long orderId, int price) { | ||
|
||
} |
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
16 changes: 15 additions & 1 deletion
16
...main/java/com/ordertogether/team14_be/order/details/repository/OrderDetailRepository.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,8 +1,22 @@ | ||
package com.ordertogether.team14_be.order.details.repository; | ||
|
||
import com.ordertogether.team14_be.member.persistence.entity.Member; | ||
import com.ordertogether.team14_be.order.details.entity.OrderDetail; | ||
import com.ordertogether.team14_be.spot.entity.Spot; | ||
import java.util.List; | ||
import java.util.Optional; | ||
import org.springframework.data.domain.Page; | ||
import org.springframework.data.domain.Pageable; | ||
import org.springframework.data.jpa.repository.EntityGraph; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface OrderDetailRepository extends JpaRepository<OrderDetail, Long> {} | ||
public interface OrderDetailRepository extends JpaRepository<OrderDetail, Long> { | ||
@EntityGraph(attributePaths = {"spot"}) | ||
Page<OrderDetail> findAllByMember(Member member, Pageable pageable); | ||
|
||
Optional<OrderDetail> findBySpotAndMember(Spot spot, Member member); | ||
|
||
List<OrderDetail> findAllBySpot(Spot spot); | ||
} |
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.