forked from 9oormthon-univ/2024_DANPOONG_TEAM_5_BE
-
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.
- Loading branch information
Showing
23 changed files
with
341 additions
and
81 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
22 changes: 22 additions & 0 deletions
22
src/main/java/com/jangburich/domain/menu/domain/MenuResponse.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,22 @@ | ||
package com.jangburich.domain.menu.domain; | ||
|
||
import com.querydsl.core.annotations.QueryProjection; | ||
|
||
public record MenuResponse( | ||
Long id, | ||
Long storeId, | ||
String name, | ||
String description, | ||
String imageUrl, | ||
Integer price | ||
) { | ||
@QueryProjection | ||
public MenuResponse(Long id, Long storeId, String name, String description, String imageUrl, Integer price) { | ||
this.id = id; | ||
this.storeId = storeId; | ||
this.name = name; | ||
this.description = description; | ||
this.imageUrl = imageUrl; | ||
this.price = price; | ||
} | ||
} |
12 changes: 0 additions & 12 deletions
12
src/main/java/com/jangburich/domain/menu/domain/repository/MenuRepository.java
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
src/main/java/com/jangburich/domain/menu/repository/MenuRepository.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,13 @@ | ||
package com.jangburich.domain.menu.repository; | ||
|
||
import org.springframework.data.domain.Page; | ||
import org.springframework.data.domain.Pageable; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import com.jangburich.domain.menu.domain.Menu; | ||
import com.jangburich.domain.menu.domain.MenuResponse; | ||
import com.jangburich.domain.store.domain.Store; | ||
|
||
public interface MenuRepository extends JpaRepository<Menu, Long> { | ||
Page<MenuResponse> findAllByStore(Store store, Pageable pageable); | ||
} |
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
26 changes: 24 additions & 2 deletions
26
src/main/java/com/jangburich/domain/order/domain/repository/OrdersRepository.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,33 @@ | ||
package com.jangburich.domain.order.domain.repository; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
|
||
import com.jangburich.domain.order.domain.OrderStatus; | ||
import com.jangburich.domain.order.domain.Orders; | ||
import com.querydsl.jpa.impl.JPAQueryFactory; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.query.Param; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface OrdersRepository extends JpaRepository<Orders, Long>, OrdersQueryDslRepository { | ||
@Query(value = "SELECT * FROM orders WHERE store_id = :storeId AND updated_at < :updatedAt AND order_status = :orderStatus", | ||
nativeQuery = true) | ||
List<Orders> findOrdersByStoreAndDateAndStatusNative( | ||
@Param("storeId") Long storeId, | ||
@Param("updatedAt") LocalDateTime updatedAt, | ||
@Param("orderStatus") String orderStatus); | ||
|
||
@Query("SELECT o FROM Orders o " + | ||
"WHERE o.store.id = :storeId " + | ||
"AND o.updatedAt >= :startOfDay " + | ||
"AND o.updatedAt < :endOfDay " + | ||
"AND o.orderStatus = :orderStatus") | ||
List<Orders> findOrdersByStoreAndTodayDateAndStatus( | ||
@Param("storeId") Long storeId, | ||
@Param("startOfDay") LocalDateTime startOfDay, | ||
@Param("endOfDay") LocalDateTime endOfDay, | ||
@Param("orderStatus") OrderStatus orderStatus); | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...n/dto/condition/StoreSearchCondition.java โ ...e/dto/condition/StoreSearchCondition.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
2 changes: 1 addition & 1 deletion
2
...ndition/StoreSearchConditionWithType.java โ ...ndition/StoreSearchConditionWithType.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
30 changes: 30 additions & 0 deletions
30
src/main/java/com/jangburich/domain/store/dto/response/OrdersDetailResponse.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,30 @@ | ||
package com.jangburich.domain.store.dto.response; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
@RequiredArgsConstructor | ||
public class OrdersDetailResponse { | ||
private Long id; | ||
private String teamName; | ||
private String teamUserName; | ||
private List<Menu> menus; | ||
private LocalDateTime dateTime; | ||
private Integer amount; | ||
private Integer totalPrice; | ||
private Integer discountPrice; | ||
|
||
@Getter | ||
@Setter | ||
public static class Menu { | ||
private String menuName; | ||
private Integer amount; | ||
} | ||
} | ||
|
18 changes: 18 additions & 0 deletions
18
src/main/java/com/jangburich/domain/store/dto/response/OrdersGetResponse.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,18 @@ | ||
package com.jangburich.domain.store.dto.response; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
@RequiredArgsConstructor | ||
public class OrdersGetResponse { | ||
private Long id; | ||
private String menuNames; | ||
private LocalDateTime date; | ||
private Integer count; | ||
private Integer price; | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/jangburich/domain/store/dto/response/OrdersTodayResponse.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,13 @@ | ||
package com.jangburich.domain.store.dto.response; | ||
|
||
import java.util.List; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
public class OrdersTodayResponse { | ||
private Integer totalPrice; | ||
private List<OrdersGetResponse> ordersGetResponses; | ||
} |
2 changes: 1 addition & 1 deletion
2
.../response/PaymentGroupDetailResponse.java โ .../response/PaymentGroupDetailResponse.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
Oops, something went wrong.