diff --git a/application/build.gradle b/application/build.gradle new file mode 100644 index 0000000000..408c3c4ca5 --- /dev/null +++ b/application/build.gradle @@ -0,0 +1,3 @@ +bootJar { enabled = false } + +jar { enabled = true } diff --git a/src/main/java/kitchenpos/application/MenuGroupService.java b/application/src/main/java/kitchenpos/application/menu/MenuGroupService.java similarity index 75% rename from src/main/java/kitchenpos/application/MenuGroupService.java rename to application/src/main/java/kitchenpos/application/menu/MenuGroupService.java index 36993cc0cb..121a4bfd74 100644 --- a/src/main/java/kitchenpos/application/MenuGroupService.java +++ b/application/src/main/java/kitchenpos/application/menu/MenuGroupService.java @@ -1,10 +1,10 @@ -package kitchenpos.application; +package kitchenpos.application.menu; import java.util.stream.Collectors; -import kitchenpos.application.dto.request.CreateMenuGroupDto; -import kitchenpos.application.dto.response.MenuGroupDto; -import kitchenpos.domain.menu.MenuGroup; -import kitchenpos.domain.menu.repository.MenuGroupRepository; +import kitchenpos.application.menu.dto.request.CreateMenuGroupDto; +import kitchenpos.application.menu.dto.response.MenuGroupDto; +import kitchenpos.core.domain.menu.MenuGroup; +import kitchenpos.core.repository.menu.MenuGroupRepository; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; diff --git a/src/main/java/kitchenpos/application/MenuService.java b/application/src/main/java/kitchenpos/application/menu/MenuService.java similarity index 78% rename from src/main/java/kitchenpos/application/MenuService.java rename to application/src/main/java/kitchenpos/application/menu/MenuService.java index 7d44c7e315..b1e8e8cee6 100644 --- a/src/main/java/kitchenpos/application/MenuService.java +++ b/application/src/main/java/kitchenpos/application/menu/MenuService.java @@ -1,20 +1,20 @@ -package kitchenpos.application; +package kitchenpos.application.menu; import java.util.ArrayList; import java.util.stream.Collectors; -import kitchenpos.application.dto.request.CreateMenuDto; -import kitchenpos.application.dto.request.CreateMenuProductDto; -import kitchenpos.application.dto.response.MenuDto; -import kitchenpos.domain.menu.MenuHistory; -import kitchenpos.domain.menu.MenuProduct; -import kitchenpos.domain.menu.ProductQuantities; -import kitchenpos.domain.menu.repository.MenuGroupRepository; -import kitchenpos.domain.menu.repository.MenuHistoryRepository; -import kitchenpos.domain.menu.repository.MenuProductRepository; -import kitchenpos.domain.menu.repository.MenuRepository; -import kitchenpos.domain.menu.Menu; -import kitchenpos.domain.menu.ProductQuantity; -import kitchenpos.domain.menu.repository.ProductRepository; +import kitchenpos.application.menu.dto.request.CreateMenuDto; +import kitchenpos.application.menu.dto.request.CreateMenuProductDto; +import kitchenpos.application.menu.dto.response.MenuDto; +import kitchenpos.core.domain.menu.MenuHistory; +import kitchenpos.core.domain.menu.MenuProduct; +import kitchenpos.core.domain.menu.ProductQuantities; +import kitchenpos.core.repository.menu.MenuGroupRepository; +import kitchenpos.core.repository.menu.MenuHistoryRepository; +import kitchenpos.core.repository.menu.MenuProductRepository; +import kitchenpos.core.repository.menu.MenuRepository; +import kitchenpos.core.domain.menu.Menu; +import kitchenpos.core.domain.menu.ProductQuantity; +import kitchenpos.core.repository.menu.ProductRepository; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; diff --git a/src/main/java/kitchenpos/application/ProductService.java b/application/src/main/java/kitchenpos/application/menu/ProductService.java similarity index 76% rename from src/main/java/kitchenpos/application/ProductService.java rename to application/src/main/java/kitchenpos/application/menu/ProductService.java index f5d9c4635b..99fb10af63 100644 --- a/src/main/java/kitchenpos/application/ProductService.java +++ b/application/src/main/java/kitchenpos/application/menu/ProductService.java @@ -1,10 +1,10 @@ -package kitchenpos.application; +package kitchenpos.application.menu; import java.util.stream.Collectors; -import kitchenpos.application.dto.request.CreateProductDto; -import kitchenpos.application.dto.response.ProductDto; -import kitchenpos.domain.menu.Product; -import kitchenpos.domain.menu.repository.ProductRepository; +import kitchenpos.application.menu.dto.request.CreateProductDto; +import kitchenpos.application.menu.dto.response.ProductDto; +import kitchenpos.core.domain.menu.Product; +import kitchenpos.core.repository.menu.ProductRepository; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; diff --git a/src/main/java/kitchenpos/application/dto/request/CreateMenuDto.java b/application/src/main/java/kitchenpos/application/menu/dto/request/CreateMenuDto.java similarity index 87% rename from src/main/java/kitchenpos/application/dto/request/CreateMenuDto.java rename to application/src/main/java/kitchenpos/application/menu/dto/request/CreateMenuDto.java index af0a488f79..2d306ea732 100644 --- a/src/main/java/kitchenpos/application/dto/request/CreateMenuDto.java +++ b/application/src/main/java/kitchenpos/application/menu/dto/request/CreateMenuDto.java @@ -1,9 +1,9 @@ -package kitchenpos.application.dto.request; +package kitchenpos.application.menu.dto.request; import java.math.BigDecimal; import java.util.List; -import kitchenpos.domain.menu.Menu; -import kitchenpos.domain.menu.ProductQuantities; +import kitchenpos.core.domain.menu.Menu; +import kitchenpos.core.domain.menu.ProductQuantities; public class CreateMenuDto { diff --git a/src/main/java/kitchenpos/application/dto/request/CreateMenuGroupDto.java b/application/src/main/java/kitchenpos/application/menu/dto/request/CreateMenuGroupDto.java similarity index 80% rename from src/main/java/kitchenpos/application/dto/request/CreateMenuGroupDto.java rename to application/src/main/java/kitchenpos/application/menu/dto/request/CreateMenuGroupDto.java index f60a3df795..7adb84a2df 100644 --- a/src/main/java/kitchenpos/application/dto/request/CreateMenuGroupDto.java +++ b/application/src/main/java/kitchenpos/application/menu/dto/request/CreateMenuGroupDto.java @@ -1,4 +1,4 @@ -package kitchenpos.application.dto.request; +package kitchenpos.application.menu.dto.request; public class CreateMenuGroupDto { diff --git a/src/main/java/kitchenpos/application/dto/request/CreateMenuProductDto.java b/application/src/main/java/kitchenpos/application/menu/dto/request/CreateMenuProductDto.java similarity index 88% rename from src/main/java/kitchenpos/application/dto/request/CreateMenuProductDto.java rename to application/src/main/java/kitchenpos/application/menu/dto/request/CreateMenuProductDto.java index 9b69ae7c45..1407a3639d 100644 --- a/src/main/java/kitchenpos/application/dto/request/CreateMenuProductDto.java +++ b/application/src/main/java/kitchenpos/application/menu/dto/request/CreateMenuProductDto.java @@ -1,4 +1,4 @@ -package kitchenpos.application.dto.request; +package kitchenpos.application.menu.dto.request; public class CreateMenuProductDto { diff --git a/src/main/java/kitchenpos/application/dto/request/CreateProductDto.java b/application/src/main/java/kitchenpos/application/menu/dto/request/CreateProductDto.java similarity index 83% rename from src/main/java/kitchenpos/application/dto/request/CreateProductDto.java rename to application/src/main/java/kitchenpos/application/menu/dto/request/CreateProductDto.java index 7e50b39f34..dda053201f 100644 --- a/src/main/java/kitchenpos/application/dto/request/CreateProductDto.java +++ b/application/src/main/java/kitchenpos/application/menu/dto/request/CreateProductDto.java @@ -1,7 +1,7 @@ -package kitchenpos.application.dto.request; +package kitchenpos.application.menu.dto.request; import java.math.BigDecimal; -import kitchenpos.domain.menu.Product; +import kitchenpos.core.domain.menu.Product; public class CreateProductDto { diff --git a/src/main/java/kitchenpos/application/dto/response/MenuDto.java b/application/src/main/java/kitchenpos/application/menu/dto/response/MenuDto.java similarity index 90% rename from src/main/java/kitchenpos/application/dto/response/MenuDto.java rename to application/src/main/java/kitchenpos/application/menu/dto/response/MenuDto.java index 72aa442047..b80127ad8a 100644 --- a/src/main/java/kitchenpos/application/dto/response/MenuDto.java +++ b/application/src/main/java/kitchenpos/application/menu/dto/response/MenuDto.java @@ -1,10 +1,10 @@ -package kitchenpos.application.dto.response; +package kitchenpos.application.menu.dto.response; import java.math.BigDecimal; import java.util.List; import java.util.stream.Collectors; -import kitchenpos.domain.menu.Menu; -import kitchenpos.domain.menu.MenuProduct; +import kitchenpos.core.domain.menu.Menu; +import kitchenpos.core.domain.menu.MenuProduct; public class MenuDto { diff --git a/src/main/java/kitchenpos/application/dto/response/MenuGroupDto.java b/application/src/main/java/kitchenpos/application/menu/dto/response/MenuGroupDto.java similarity index 82% rename from src/main/java/kitchenpos/application/dto/response/MenuGroupDto.java rename to application/src/main/java/kitchenpos/application/menu/dto/response/MenuGroupDto.java index ff073acc4f..897c4c93fa 100644 --- a/src/main/java/kitchenpos/application/dto/response/MenuGroupDto.java +++ b/application/src/main/java/kitchenpos/application/menu/dto/response/MenuGroupDto.java @@ -1,6 +1,6 @@ -package kitchenpos.application.dto.response; +package kitchenpos.application.menu.dto.response; -import kitchenpos.domain.menu.MenuGroup; +import kitchenpos.core.domain.menu.MenuGroup; public class MenuGroupDto { diff --git a/src/main/java/kitchenpos/application/dto/response/MenuProductDto.java b/application/src/main/java/kitchenpos/application/menu/dto/response/MenuProductDto.java similarity index 90% rename from src/main/java/kitchenpos/application/dto/response/MenuProductDto.java rename to application/src/main/java/kitchenpos/application/menu/dto/response/MenuProductDto.java index d518e4fced..9d80db48e9 100644 --- a/src/main/java/kitchenpos/application/dto/response/MenuProductDto.java +++ b/application/src/main/java/kitchenpos/application/menu/dto/response/MenuProductDto.java @@ -1,6 +1,6 @@ -package kitchenpos.application.dto.response; +package kitchenpos.application.menu.dto.response; -import kitchenpos.domain.menu.MenuProduct; +import kitchenpos.core.domain.menu.MenuProduct; public class MenuProductDto { diff --git a/src/main/java/kitchenpos/application/dto/response/ProductDto.java b/application/src/main/java/kitchenpos/application/menu/dto/response/ProductDto.java similarity index 86% rename from src/main/java/kitchenpos/application/dto/response/ProductDto.java rename to application/src/main/java/kitchenpos/application/menu/dto/response/ProductDto.java index 344c6f56a5..dac72b293a 100644 --- a/src/main/java/kitchenpos/application/dto/response/ProductDto.java +++ b/application/src/main/java/kitchenpos/application/menu/dto/response/ProductDto.java @@ -1,7 +1,7 @@ -package kitchenpos.application.dto.response; +package kitchenpos.application.menu.dto.response; import java.math.BigDecimal; -import kitchenpos.domain.menu.Product; +import kitchenpos.core.domain.menu.Product; public class ProductDto { diff --git a/src/main/java/kitchenpos/application/OrderService.java b/application/src/main/java/kitchenpos/application/order/OrderService.java similarity index 81% rename from src/main/java/kitchenpos/application/OrderService.java rename to application/src/main/java/kitchenpos/application/order/OrderService.java index 66584f1fe2..910c68394d 100644 --- a/src/main/java/kitchenpos/application/OrderService.java +++ b/application/src/main/java/kitchenpos/application/order/OrderService.java @@ -1,19 +1,19 @@ -package kitchenpos.application; +package kitchenpos.application.order; import java.util.ArrayList; -import kitchenpos.application.dto.request.CreateOrderDto; -import kitchenpos.application.dto.request.CreateOrderLineItemDto; -import kitchenpos.application.dto.response.OrderDto; -import kitchenpos.application.dto.request.UpdateOrderStatusDto; -import kitchenpos.domain.menu.Menu; -import kitchenpos.domain.menu.MenuHistory; -import kitchenpos.domain.menu.repository.MenuHistoryRepository; -import kitchenpos.domain.menu.repository.MenuRepository; -import kitchenpos.domain.order.Order; -import kitchenpos.domain.order.OrderLineItem; -import kitchenpos.domain.order.repository.OrderLineItemRepository; -import kitchenpos.domain.order.repository.OrderRepository; -import kitchenpos.domain.table.repository.OrderTableRepository; +import kitchenpos.application.order.dto.request.CreateOrderDto; +import kitchenpos.application.order.dto.request.CreateOrderLineItemDto; +import kitchenpos.application.order.dto.response.OrderDto; +import kitchenpos.application.order.dto.request.UpdateOrderStatusDto; +import kitchenpos.core.domain.menu.Menu; +import kitchenpos.core.domain.menu.MenuHistory; +import kitchenpos.core.repository.menu.MenuHistoryRepository; +import kitchenpos.core.repository.menu.MenuRepository; +import kitchenpos.core.domain.order.Order; +import kitchenpos.core.domain.order.OrderLineItem; +import kitchenpos.core.repository.order.OrderLineItemRepository; +import kitchenpos.core.repository.order.OrderRepository; +import kitchenpos.core.repository.table.OrderTableRepository; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; diff --git a/src/main/java/kitchenpos/application/dto/request/CreateOrderDto.java b/application/src/main/java/kitchenpos/application/order/dto/request/CreateOrderDto.java similarity index 91% rename from src/main/java/kitchenpos/application/dto/request/CreateOrderDto.java rename to application/src/main/java/kitchenpos/application/order/dto/request/CreateOrderDto.java index c6f1a80caa..7d6980c4df 100644 --- a/src/main/java/kitchenpos/application/dto/request/CreateOrderDto.java +++ b/application/src/main/java/kitchenpos/application/order/dto/request/CreateOrderDto.java @@ -1,4 +1,4 @@ -package kitchenpos.application.dto.request; +package kitchenpos.application.order.dto.request; import java.util.List; diff --git a/src/main/java/kitchenpos/application/dto/request/CreateOrderLineItemDto.java b/application/src/main/java/kitchenpos/application/order/dto/request/CreateOrderLineItemDto.java similarity index 88% rename from src/main/java/kitchenpos/application/dto/request/CreateOrderLineItemDto.java rename to application/src/main/java/kitchenpos/application/order/dto/request/CreateOrderLineItemDto.java index c894f2ee3a..4b4e778767 100644 --- a/src/main/java/kitchenpos/application/dto/request/CreateOrderLineItemDto.java +++ b/application/src/main/java/kitchenpos/application/order/dto/request/CreateOrderLineItemDto.java @@ -1,4 +1,4 @@ -package kitchenpos.application.dto.request; +package kitchenpos.application.order.dto.request; public class CreateOrderLineItemDto { diff --git a/src/main/java/kitchenpos/application/dto/response/OrderLineItemDto.java b/application/src/main/java/kitchenpos/application/order/dto/request/OrderLineItemDto.java similarity index 90% rename from src/main/java/kitchenpos/application/dto/response/OrderLineItemDto.java rename to application/src/main/java/kitchenpos/application/order/dto/request/OrderLineItemDto.java index 572b9f5bc1..5e65636869 100644 --- a/src/main/java/kitchenpos/application/dto/response/OrderLineItemDto.java +++ b/application/src/main/java/kitchenpos/application/order/dto/request/OrderLineItemDto.java @@ -1,6 +1,6 @@ -package kitchenpos.application.dto.response; +package kitchenpos.application.order.dto.request; -import kitchenpos.domain.order.OrderLineItem; +import kitchenpos.core.domain.order.OrderLineItem; public class OrderLineItemDto { diff --git a/src/main/java/kitchenpos/application/dto/request/UpdateOrderStatusDto.java b/application/src/main/java/kitchenpos/application/order/dto/request/UpdateOrderStatusDto.java similarity index 56% rename from src/main/java/kitchenpos/application/dto/request/UpdateOrderStatusDto.java rename to application/src/main/java/kitchenpos/application/order/dto/request/UpdateOrderStatusDto.java index ea2a00f19f..6d7f8b6be5 100644 --- a/src/main/java/kitchenpos/application/dto/request/UpdateOrderStatusDto.java +++ b/application/src/main/java/kitchenpos/application/order/dto/request/UpdateOrderStatusDto.java @@ -1,15 +1,15 @@ -package kitchenpos.application.dto.request; +package kitchenpos.application.order.dto.request; -import kitchenpos.domain.order.OrderStatus; +import kitchenpos.core.domain.order.OrderStatus; public class UpdateOrderStatusDto { private final Long orderId; private final OrderStatus orderStatus; - public UpdateOrderStatusDto(Long orderId, OrderStatus orderStatus) { + public UpdateOrderStatusDto(Long orderId, String orderStatus) { this.orderId = orderId; - this.orderStatus = orderStatus; + this.orderStatus = OrderStatus.valueOf(orderStatus); } public Long getOrderId() { diff --git a/src/main/java/kitchenpos/application/dto/response/OrderDto.java b/application/src/main/java/kitchenpos/application/order/dto/response/OrderDto.java similarity index 89% rename from src/main/java/kitchenpos/application/dto/response/OrderDto.java rename to application/src/main/java/kitchenpos/application/order/dto/response/OrderDto.java index d23df4b4e1..8e93c0b627 100644 --- a/src/main/java/kitchenpos/application/dto/response/OrderDto.java +++ b/application/src/main/java/kitchenpos/application/order/dto/response/OrderDto.java @@ -1,10 +1,11 @@ -package kitchenpos.application.dto.response; +package kitchenpos.application.order.dto.response; import java.time.LocalDateTime; import java.util.List; import java.util.stream.Collectors; -import kitchenpos.domain.order.Order; -import kitchenpos.domain.order.OrderLineItem; +import kitchenpos.application.order.dto.request.OrderLineItemDto; +import kitchenpos.core.domain.order.Order; +import kitchenpos.core.domain.order.OrderLineItem; public class OrderDto { diff --git a/src/main/java/kitchenpos/application/TableGroupService.java b/application/src/main/java/kitchenpos/application/table/TableGroupService.java similarity index 82% rename from src/main/java/kitchenpos/application/TableGroupService.java rename to application/src/main/java/kitchenpos/application/table/TableGroupService.java index 3ffc51bf01..ce036d2bee 100644 --- a/src/main/java/kitchenpos/application/TableGroupService.java +++ b/application/src/main/java/kitchenpos/application/table/TableGroupService.java @@ -1,14 +1,14 @@ -package kitchenpos.application; +package kitchenpos.application.table; -import kitchenpos.application.dto.request.CreateTableGroupDto; -import kitchenpos.application.dto.response.TableGroupDto; -import kitchenpos.domain.order.OrderStatus; -import kitchenpos.domain.order.repository.OrderRepository; -import kitchenpos.domain.table.repository.OrderTableRepository; -import kitchenpos.domain.table.repository.TableGroupRepository; -import kitchenpos.domain.table.OrderTable; -import kitchenpos.domain.table.OrderTables; -import kitchenpos.domain.table.TableGroup; +import kitchenpos.application.table.dto.request.CreateTableGroupDto; +import kitchenpos.application.table.dto.response.TableGroupDto; +import kitchenpos.core.domain.order.OrderStatus; +import kitchenpos.core.repository.order.OrderRepository; +import kitchenpos.core.repository.table.OrderTableRepository; +import kitchenpos.core.repository.table.TableGroupRepository; +import kitchenpos.core.domain.table.OrderTable; +import kitchenpos.core.domain.table.OrderTables; +import kitchenpos.core.domain.table.TableGroup; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; diff --git a/src/main/java/kitchenpos/application/TableService.java b/application/src/main/java/kitchenpos/application/table/TableService.java similarity index 80% rename from src/main/java/kitchenpos/application/TableService.java rename to application/src/main/java/kitchenpos/application/table/TableService.java index b1b6642230..9a63392c00 100644 --- a/src/main/java/kitchenpos/application/TableService.java +++ b/application/src/main/java/kitchenpos/application/table/TableService.java @@ -1,14 +1,14 @@ -package kitchenpos.application; +package kitchenpos.application.table; import java.util.stream.Collectors; -import kitchenpos.application.dto.request.CreateTableDto; -import kitchenpos.application.dto.request.EmptyTableDto; -import kitchenpos.application.dto.response.TableDto; -import kitchenpos.application.dto.request.UpdateGuestNumberDto; -import kitchenpos.domain.order.OrderStatus; -import kitchenpos.domain.order.repository.OrderRepository; -import kitchenpos.domain.table.repository.OrderTableRepository; -import kitchenpos.domain.table.OrderTable; +import kitchenpos.application.table.dto.request.CreateTableDto; +import kitchenpos.application.table.dto.request.EmptyTableDto; +import kitchenpos.application.table.dto.response.TableDto; +import kitchenpos.application.table.dto.request.UpdateGuestNumberDto; +import kitchenpos.core.domain.order.OrderStatus; +import kitchenpos.core.repository.order.OrderRepository; +import kitchenpos.core.repository.table.OrderTableRepository; +import kitchenpos.core.domain.table.OrderTable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; diff --git a/src/main/java/kitchenpos/application/dto/request/CreateTableDto.java b/application/src/main/java/kitchenpos/application/table/dto/request/CreateTableDto.java similarity index 88% rename from src/main/java/kitchenpos/application/dto/request/CreateTableDto.java rename to application/src/main/java/kitchenpos/application/table/dto/request/CreateTableDto.java index 16cbf390b8..7bea33cee9 100644 --- a/src/main/java/kitchenpos/application/dto/request/CreateTableDto.java +++ b/application/src/main/java/kitchenpos/application/table/dto/request/CreateTableDto.java @@ -1,4 +1,4 @@ -package kitchenpos.application.dto.request; +package kitchenpos.application.table.dto.request; public class CreateTableDto { diff --git a/src/main/java/kitchenpos/application/dto/request/CreateTableGroupDto.java b/application/src/main/java/kitchenpos/application/table/dto/request/CreateTableGroupDto.java similarity index 90% rename from src/main/java/kitchenpos/application/dto/request/CreateTableGroupDto.java rename to application/src/main/java/kitchenpos/application/table/dto/request/CreateTableGroupDto.java index 5f5868e000..842cf3b60e 100644 --- a/src/main/java/kitchenpos/application/dto/request/CreateTableGroupDto.java +++ b/application/src/main/java/kitchenpos/application/table/dto/request/CreateTableGroupDto.java @@ -1,4 +1,4 @@ -package kitchenpos.application.dto.request; +package kitchenpos.application.table.dto.request; import java.util.List; import org.springframework.util.CollectionUtils; diff --git a/src/main/java/kitchenpos/application/dto/request/EmptyTableDto.java b/application/src/main/java/kitchenpos/application/table/dto/request/EmptyTableDto.java similarity index 88% rename from src/main/java/kitchenpos/application/dto/request/EmptyTableDto.java rename to application/src/main/java/kitchenpos/application/table/dto/request/EmptyTableDto.java index 815b7016b0..115d8eba25 100644 --- a/src/main/java/kitchenpos/application/dto/request/EmptyTableDto.java +++ b/application/src/main/java/kitchenpos/application/table/dto/request/EmptyTableDto.java @@ -1,4 +1,4 @@ -package kitchenpos.application.dto.request; +package kitchenpos.application.table.dto.request; public class EmptyTableDto { diff --git a/src/main/java/kitchenpos/application/dto/request/UpdateGuestNumberDto.java b/application/src/main/java/kitchenpos/application/table/dto/request/UpdateGuestNumberDto.java similarity index 89% rename from src/main/java/kitchenpos/application/dto/request/UpdateGuestNumberDto.java rename to application/src/main/java/kitchenpos/application/table/dto/request/UpdateGuestNumberDto.java index b24a82d59d..4e0c9a4bc5 100644 --- a/src/main/java/kitchenpos/application/dto/request/UpdateGuestNumberDto.java +++ b/application/src/main/java/kitchenpos/application/table/dto/request/UpdateGuestNumberDto.java @@ -1,4 +1,4 @@ -package kitchenpos.application.dto.request; +package kitchenpos.application.table.dto.request; public class UpdateGuestNumberDto { diff --git a/src/main/java/kitchenpos/application/dto/response/TableDto.java b/application/src/main/java/kitchenpos/application/table/dto/response/TableDto.java similarity index 89% rename from src/main/java/kitchenpos/application/dto/response/TableDto.java rename to application/src/main/java/kitchenpos/application/table/dto/response/TableDto.java index b764b7ffd2..68fdc22607 100644 --- a/src/main/java/kitchenpos/application/dto/response/TableDto.java +++ b/application/src/main/java/kitchenpos/application/table/dto/response/TableDto.java @@ -1,6 +1,6 @@ -package kitchenpos.application.dto.response; +package kitchenpos.application.table.dto.response; -import kitchenpos.domain.table.OrderTable; +import kitchenpos.core.domain.table.OrderTable; public class TableDto { diff --git a/src/main/java/kitchenpos/application/dto/response/TableGroupDto.java b/application/src/main/java/kitchenpos/application/table/dto/response/TableGroupDto.java similarity index 87% rename from src/main/java/kitchenpos/application/dto/response/TableGroupDto.java rename to application/src/main/java/kitchenpos/application/table/dto/response/TableGroupDto.java index 8fe35c67c6..a957bff411 100644 --- a/src/main/java/kitchenpos/application/dto/response/TableGroupDto.java +++ b/application/src/main/java/kitchenpos/application/table/dto/response/TableGroupDto.java @@ -1,10 +1,10 @@ -package kitchenpos.application.dto.response; +package kitchenpos.application.table.dto.response; import java.time.LocalDateTime; import java.util.List; import java.util.stream.Collectors; -import kitchenpos.domain.table.OrderTable; -import kitchenpos.domain.table.TableGroup; +import kitchenpos.core.domain.table.OrderTable; +import kitchenpos.core.domain.table.TableGroup; public class TableGroupDto { diff --git a/application/src/test/java/kitchenpos/TestApplication.java b/application/src/test/java/kitchenpos/TestApplication.java new file mode 100644 index 0000000000..964a64fb75 --- /dev/null +++ b/application/src/test/java/kitchenpos/TestApplication.java @@ -0,0 +1,12 @@ +package kitchenpos; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +class TestApplication { + + public static void main(String[] args) { + SpringApplication.run(TestApplication.class, args); + } +} diff --git a/src/test/java/kitchenpos/application/MenuGroupServiceTest.java b/application/src/test/java/kitchenpos/application/menu/MenuGroupServiceTest.java similarity index 81% rename from src/test/java/kitchenpos/application/MenuGroupServiceTest.java rename to application/src/test/java/kitchenpos/application/menu/MenuGroupServiceTest.java index 3924ccf2e6..c0bb5b2e19 100644 --- a/src/test/java/kitchenpos/application/MenuGroupServiceTest.java +++ b/application/src/test/java/kitchenpos/application/menu/MenuGroupServiceTest.java @@ -1,12 +1,11 @@ -package kitchenpos.application; +package kitchenpos.application.menu; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertAll; import java.util.List; -import kitchenpos.application.dto.request.CreateMenuGroupDto; -import kitchenpos.application.dto.response.MenuGroupDto; -import kitchenpos.domain.menu.MenuGroup; +import kitchenpos.application.menu.dto.request.CreateMenuGroupDto; +import kitchenpos.application.menu.dto.response.MenuGroupDto; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; diff --git a/src/test/java/kitchenpos/application/MenuServiceTest.java b/application/src/test/java/kitchenpos/application/menu/MenuServiceTest.java similarity index 92% rename from src/test/java/kitchenpos/application/MenuServiceTest.java rename to application/src/test/java/kitchenpos/application/menu/MenuServiceTest.java index 9c166d63b9..f91f598ea2 100644 --- a/src/test/java/kitchenpos/application/MenuServiceTest.java +++ b/application/src/test/java/kitchenpos/application/menu/MenuServiceTest.java @@ -1,14 +1,14 @@ -package kitchenpos.application; +package kitchenpos.application.menu; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertAll; import java.math.BigDecimal; import java.util.List; -import kitchenpos.application.dto.request.CreateMenuDto; -import kitchenpos.application.dto.request.CreateMenuProductDto; -import kitchenpos.application.dto.response.MenuDto; +import kitchenpos.application.menu.dto.request.CreateMenuDto; +import kitchenpos.application.menu.dto.request.CreateMenuProductDto; +import kitchenpos.application.menu.dto.response.MenuDto; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; diff --git a/src/test/java/kitchenpos/application/ProductServiceTest.java b/application/src/test/java/kitchenpos/application/menu/ProductServiceTest.java similarity index 91% rename from src/test/java/kitchenpos/application/ProductServiceTest.java rename to application/src/test/java/kitchenpos/application/menu/ProductServiceTest.java index 3088f56bd3..19e083976c 100644 --- a/src/test/java/kitchenpos/application/ProductServiceTest.java +++ b/application/src/test/java/kitchenpos/application/menu/ProductServiceTest.java @@ -1,10 +1,9 @@ -package kitchenpos.application; +package kitchenpos.application.menu; import java.math.BigDecimal; import java.util.List; -import kitchenpos.application.dto.request.CreateProductDto; -import kitchenpos.application.dto.response.ProductDto; -import kitchenpos.domain.menu.Product; +import kitchenpos.application.menu.dto.request.CreateProductDto; +import kitchenpos.application.menu.dto.response.ProductDto; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; diff --git a/src/test/java/kitchenpos/application/OrderServiceTest.java b/application/src/test/java/kitchenpos/application/order/OrderServiceTest.java similarity index 87% rename from src/test/java/kitchenpos/application/OrderServiceTest.java rename to application/src/test/java/kitchenpos/application/order/OrderServiceTest.java index 57e0908a0c..bc691eb7b2 100644 --- a/src/test/java/kitchenpos/application/OrderServiceTest.java +++ b/application/src/test/java/kitchenpos/application/order/OrderServiceTest.java @@ -1,4 +1,4 @@ -package kitchenpos.application; +package kitchenpos.application.order; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; @@ -6,14 +6,16 @@ import java.math.BigDecimal; import java.util.List; -import kitchenpos.application.dto.request.CreateMenuDto; -import kitchenpos.application.dto.request.CreateMenuProductDto; -import kitchenpos.application.dto.request.CreateOrderDto; -import kitchenpos.application.dto.request.CreateOrderLineItemDto; -import kitchenpos.application.dto.request.CreateTableDto; -import kitchenpos.application.dto.response.OrderDto; -import kitchenpos.application.dto.request.UpdateOrderStatusDto; -import kitchenpos.domain.order.OrderStatus; +import kitchenpos.application.menu.MenuService; +import kitchenpos.application.table.TableService; +import kitchenpos.application.menu.dto.request.CreateMenuDto; +import kitchenpos.application.menu.dto.request.CreateMenuProductDto; +import kitchenpos.application.order.dto.request.CreateOrderDto; +import kitchenpos.application.order.dto.request.CreateOrderLineItemDto; +import kitchenpos.application.table.dto.request.CreateTableDto; +import kitchenpos.application.order.dto.response.OrderDto; +import kitchenpos.application.order.dto.request.UpdateOrderStatusDto; +import kitchenpos.core.domain.order.OrderStatus; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; @@ -99,7 +101,7 @@ class ChangeOrderStatusTest { List orderLineItems = List.of(new CreateOrderLineItemDto(savedMenuId, 1)); Long orderId = orderService.create(new CreateOrderDto(orderTableId, orderLineItems)).getId(); - UpdateOrderStatusDto updateOrderStatusDto = new UpdateOrderStatusDto(orderId, OrderStatus.MEAL); + UpdateOrderStatusDto updateOrderStatusDto = new UpdateOrderStatusDto(orderId, OrderStatus.MEAL.name()); OrderDto actual = orderService.changeOrderStatus(updateOrderStatusDto); assertAll( () -> assertThat(actual.getId()).isNotNull(), @@ -112,7 +114,7 @@ class ChangeOrderStatusTest { @Test void 존재하지_않는_주문인_경우_예외를_발생시킨다() { - UpdateOrderStatusDto updateOrderStatusDto = new UpdateOrderStatusDto(99999L, OrderStatus.MEAL); + UpdateOrderStatusDto updateOrderStatusDto = new UpdateOrderStatusDto(99999L, OrderStatus.MEAL.name()); assertThatThrownBy(() -> orderService.changeOrderStatus(updateOrderStatusDto)) .hasCauseInstanceOf(IllegalArgumentException.class); } diff --git a/src/test/java/kitchenpos/application/TableGroupServiceTest.java b/application/src/test/java/kitchenpos/application/table/TableGroupServiceTest.java similarity index 87% rename from src/test/java/kitchenpos/application/TableGroupServiceTest.java rename to application/src/test/java/kitchenpos/application/table/TableGroupServiceTest.java index fbad1d0ad7..0921cd90a5 100644 --- a/src/test/java/kitchenpos/application/TableGroupServiceTest.java +++ b/application/src/test/java/kitchenpos/application/table/TableGroupServiceTest.java @@ -1,4 +1,4 @@ -package kitchenpos.application; +package kitchenpos.application.table; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; @@ -6,15 +6,17 @@ import java.math.BigDecimal; import java.util.List; -import kitchenpos.application.dto.request.CreateMenuDto; -import kitchenpos.application.dto.request.CreateMenuProductDto; -import kitchenpos.application.dto.request.CreateOrderDto; -import kitchenpos.application.dto.request.CreateOrderLineItemDto; -import kitchenpos.application.dto.request.CreateTableDto; -import kitchenpos.application.dto.request.CreateTableGroupDto; -import kitchenpos.application.dto.response.TableGroupDto; -import kitchenpos.domain.table.repository.OrderTableRepository; -import kitchenpos.domain.table.OrderTable; +import kitchenpos.application.menu.MenuService; +import kitchenpos.application.order.OrderService; +import kitchenpos.application.menu.dto.request.CreateMenuDto; +import kitchenpos.application.menu.dto.request.CreateMenuProductDto; +import kitchenpos.application.order.dto.request.CreateOrderDto; +import kitchenpos.application.order.dto.request.CreateOrderLineItemDto; +import kitchenpos.application.table.dto.request.CreateTableDto; +import kitchenpos.application.table.dto.request.CreateTableGroupDto; +import kitchenpos.application.table.dto.response.TableGroupDto; +import kitchenpos.core.repository.table.OrderTableRepository; +import kitchenpos.core.domain.table.OrderTable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; diff --git a/src/test/java/kitchenpos/application/TableServiceTest.java b/application/src/test/java/kitchenpos/application/table/TableServiceTest.java similarity index 88% rename from src/test/java/kitchenpos/application/TableServiceTest.java rename to application/src/test/java/kitchenpos/application/table/TableServiceTest.java index 3e82c7f880..c28496c7dd 100644 --- a/src/test/java/kitchenpos/application/TableServiceTest.java +++ b/application/src/test/java/kitchenpos/application/table/TableServiceTest.java @@ -1,4 +1,4 @@ -package kitchenpos.application; +package kitchenpos.application.table; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; @@ -6,14 +6,16 @@ import java.math.BigDecimal; import java.util.List; -import kitchenpos.application.dto.request.CreateMenuDto; -import kitchenpos.application.dto.request.CreateMenuProductDto; -import kitchenpos.application.dto.request.CreateOrderDto; -import kitchenpos.application.dto.request.CreateOrderLineItemDto; -import kitchenpos.application.dto.request.CreateTableDto; -import kitchenpos.application.dto.request.EmptyTableDto; -import kitchenpos.application.dto.response.TableDto; -import kitchenpos.application.dto.request.UpdateGuestNumberDto; +import kitchenpos.application.menu.MenuService; +import kitchenpos.application.order.OrderService; +import kitchenpos.application.menu.dto.request.CreateMenuDto; +import kitchenpos.application.menu.dto.request.CreateMenuProductDto; +import kitchenpos.application.order.dto.request.CreateOrderDto; +import kitchenpos.application.order.dto.request.CreateOrderLineItemDto; +import kitchenpos.application.table.dto.request.CreateTableDto; +import kitchenpos.application.table.dto.request.EmptyTableDto; +import kitchenpos.application.table.dto.response.TableDto; +import kitchenpos.application.table.dto.request.UpdateGuestNumberDto; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; diff --git a/build.gradle b/build.gradle index f8d8814c52..9bdb471d07 100644 --- a/build.gradle +++ b/build.gradle @@ -1,28 +1,53 @@ plugins { id 'org.springframework.boot' version '2.3.3.RELEASE' id 'io.spring.dependency-management' version '1.0.10.RELEASE' - id 'java' } -group = 'camp.nextstep.edu' -version = '0.0.1-SNAPSHOT' -sourceCompatibility = '11' - repositories { mavenCentral() } -dependencies { - implementation 'org.springframework.boot:spring-boot-starter-actuator' - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.flywaydb:flyway-core' - runtimeOnly 'com.h2database:h2' - testImplementation('org.springframework.boot:spring-boot-starter-test') { - exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' +subprojects { + group 'camp.nextstep.edu' + version '0.0.1-SNAPSHOT' + + apply plugin: 'java' + apply plugin: 'org.springframework.boot' + apply plugin: 'io.spring.dependency-management' + + sourceCompatibility = '11' + + repositories { + mavenCentral() + } + + dependencies { + implementation 'org.springframework.boot:spring-boot-starter-data-jpa' + implementation 'org.flywaydb:flyway-core' + runtimeOnly 'com.h2database:h2' + testImplementation('org.springframework.boot:spring-boot-starter-test') { + exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' + } + } + + test { + useJUnitPlatform() + } +} + +project(':ui') { + dependencies { + implementation project(':application') + testImplementation project(':application') + + implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-actuator' } } -test { - useJUnitPlatform() +project(':application') { + dependencies { + implementation project(':core') + testImplementation project(':core') + } } diff --git a/core/build.gradle b/core/build.gradle new file mode 100644 index 0000000000..408c3c4ca5 --- /dev/null +++ b/core/build.gradle @@ -0,0 +1,3 @@ +bootJar { enabled = false } + +jar { enabled = true } diff --git a/src/main/java/kitchenpos/domain/menu/Menu.java b/core/src/main/java/kitchenpos/core/domain/menu/Menu.java similarity index 97% rename from src/main/java/kitchenpos/domain/menu/Menu.java rename to core/src/main/java/kitchenpos/core/domain/menu/Menu.java index e75e6aa328..36fa17a2b7 100644 --- a/src/main/java/kitchenpos/domain/menu/Menu.java +++ b/core/src/main/java/kitchenpos/core/domain/menu/Menu.java @@ -1,4 +1,4 @@ -package kitchenpos.domain.menu; +package kitchenpos.core.domain.menu; import java.math.BigDecimal; import javax.persistence.Column; diff --git a/src/main/java/kitchenpos/domain/menu/MenuGroup.java b/core/src/main/java/kitchenpos/core/domain/menu/MenuGroup.java similarity index 95% rename from src/main/java/kitchenpos/domain/menu/MenuGroup.java rename to core/src/main/java/kitchenpos/core/domain/menu/MenuGroup.java index a7a8c20331..5ec59ef36e 100644 --- a/src/main/java/kitchenpos/domain/menu/MenuGroup.java +++ b/core/src/main/java/kitchenpos/core/domain/menu/MenuGroup.java @@ -1,4 +1,4 @@ -package kitchenpos.domain.menu; +package kitchenpos.core.domain.menu; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/src/main/java/kitchenpos/domain/menu/MenuHistory.java b/core/src/main/java/kitchenpos/core/domain/menu/MenuHistory.java similarity index 97% rename from src/main/java/kitchenpos/domain/menu/MenuHistory.java rename to core/src/main/java/kitchenpos/core/domain/menu/MenuHistory.java index 719a1098d6..7fc069ba6a 100644 --- a/src/main/java/kitchenpos/domain/menu/MenuHistory.java +++ b/core/src/main/java/kitchenpos/core/domain/menu/MenuHistory.java @@ -1,4 +1,4 @@ -package kitchenpos.domain.menu; +package kitchenpos.core.domain.menu; import java.math.BigDecimal; import java.time.LocalDateTime; diff --git a/src/main/java/kitchenpos/domain/menu/MenuProduct.java b/core/src/main/java/kitchenpos/core/domain/menu/MenuProduct.java similarity index 96% rename from src/main/java/kitchenpos/domain/menu/MenuProduct.java rename to core/src/main/java/kitchenpos/core/domain/menu/MenuProduct.java index 8fad583b4c..7ba71f8e7d 100644 --- a/src/main/java/kitchenpos/domain/menu/MenuProduct.java +++ b/core/src/main/java/kitchenpos/core/domain/menu/MenuProduct.java @@ -1,4 +1,4 @@ -package kitchenpos.domain.menu; +package kitchenpos.core.domain.menu; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/src/main/java/kitchenpos/domain/menu/Price.java b/core/src/main/java/kitchenpos/core/domain/menu/Price.java similarity index 93% rename from src/main/java/kitchenpos/domain/menu/Price.java rename to core/src/main/java/kitchenpos/core/domain/menu/Price.java index 4e867de8bd..cc88e49ff8 100644 --- a/src/main/java/kitchenpos/domain/menu/Price.java +++ b/core/src/main/java/kitchenpos/core/domain/menu/Price.java @@ -1,7 +1,6 @@ -package kitchenpos.domain.menu; +package kitchenpos.core.domain.menu; import java.math.BigDecimal; -import java.util.List; import javax.persistence.Column; import javax.persistence.Embeddable; diff --git a/src/main/java/kitchenpos/domain/menu/Product.java b/core/src/main/java/kitchenpos/core/domain/menu/Product.java similarity index 96% rename from src/main/java/kitchenpos/domain/menu/Product.java rename to core/src/main/java/kitchenpos/core/domain/menu/Product.java index 04cddaf77f..7bd7fa726c 100644 --- a/src/main/java/kitchenpos/domain/menu/Product.java +++ b/core/src/main/java/kitchenpos/core/domain/menu/Product.java @@ -1,4 +1,4 @@ -package kitchenpos.domain.menu; +package kitchenpos.core.domain.menu; import java.math.BigDecimal; import javax.persistence.Column; diff --git a/src/main/java/kitchenpos/domain/menu/ProductQuantities.java b/core/src/main/java/kitchenpos/core/domain/menu/ProductQuantities.java similarity index 95% rename from src/main/java/kitchenpos/domain/menu/ProductQuantities.java rename to core/src/main/java/kitchenpos/core/domain/menu/ProductQuantities.java index b854be899f..0944319ac3 100644 --- a/src/main/java/kitchenpos/domain/menu/ProductQuantities.java +++ b/core/src/main/java/kitchenpos/core/domain/menu/ProductQuantities.java @@ -1,4 +1,4 @@ -package kitchenpos.domain.menu; +package kitchenpos.core.domain.menu; import java.math.BigDecimal; import java.util.List; diff --git a/src/main/java/kitchenpos/domain/menu/ProductQuantity.java b/core/src/main/java/kitchenpos/core/domain/menu/ProductQuantity.java similarity index 93% rename from src/main/java/kitchenpos/domain/menu/ProductQuantity.java rename to core/src/main/java/kitchenpos/core/domain/menu/ProductQuantity.java index 3c4ff272d5..b0d189a79f 100644 --- a/src/main/java/kitchenpos/domain/menu/ProductQuantity.java +++ b/core/src/main/java/kitchenpos/core/domain/menu/ProductQuantity.java @@ -1,4 +1,4 @@ -package kitchenpos.domain.menu; +package kitchenpos.core.domain.menu; import java.math.BigDecimal; diff --git a/src/main/java/kitchenpos/domain/order/Order.java b/core/src/main/java/kitchenpos/core/domain/order/Order.java similarity index 95% rename from src/main/java/kitchenpos/domain/order/Order.java rename to core/src/main/java/kitchenpos/core/domain/order/Order.java index f23b6ec268..17f0fb2999 100644 --- a/src/main/java/kitchenpos/domain/order/Order.java +++ b/core/src/main/java/kitchenpos/core/domain/order/Order.java @@ -1,4 +1,4 @@ -package kitchenpos.domain.order; +package kitchenpos.core.domain.order; import java.time.LocalDateTime; import javax.persistence.Column; @@ -9,7 +9,7 @@ import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; -import kitchenpos.domain.table.OrderTable; +import kitchenpos.core.domain.table.OrderTable; @Table(name = "orders") @Entity diff --git a/src/main/java/kitchenpos/domain/order/OrderLineItem.java b/core/src/main/java/kitchenpos/core/domain/order/OrderLineItem.java similarity index 92% rename from src/main/java/kitchenpos/domain/order/OrderLineItem.java rename to core/src/main/java/kitchenpos/core/domain/order/OrderLineItem.java index 3773a570d2..5e4a1899f1 100644 --- a/src/main/java/kitchenpos/domain/order/OrderLineItem.java +++ b/core/src/main/java/kitchenpos/core/domain/order/OrderLineItem.java @@ -1,11 +1,11 @@ -package kitchenpos.domain.order; +package kitchenpos.core.domain.order; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; -import kitchenpos.domain.menu.MenuHistory; +import kitchenpos.core.domain.menu.MenuHistory; @Entity public class OrderLineItem { diff --git a/src/main/java/kitchenpos/domain/order/OrderStatus.java b/core/src/main/java/kitchenpos/core/domain/order/OrderStatus.java similarity index 85% rename from src/main/java/kitchenpos/domain/order/OrderStatus.java rename to core/src/main/java/kitchenpos/core/domain/order/OrderStatus.java index c33b20ef1b..40b1ed651a 100644 --- a/src/main/java/kitchenpos/domain/order/OrderStatus.java +++ b/core/src/main/java/kitchenpos/core/domain/order/OrderStatus.java @@ -1,4 +1,4 @@ -package kitchenpos.domain.order; +package kitchenpos.core.domain.order; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/kitchenpos/domain/table/OrderTable.java b/core/src/main/java/kitchenpos/core/domain/table/OrderTable.java similarity index 98% rename from src/main/java/kitchenpos/domain/table/OrderTable.java rename to core/src/main/java/kitchenpos/core/domain/table/OrderTable.java index 5e8fc51467..281a663669 100644 --- a/src/main/java/kitchenpos/domain/table/OrderTable.java +++ b/core/src/main/java/kitchenpos/core/domain/table/OrderTable.java @@ -1,4 +1,4 @@ -package kitchenpos.domain.table; +package kitchenpos.core.domain.table; import java.util.Objects; import javax.persistence.Column; diff --git a/src/main/java/kitchenpos/domain/table/OrderTables.java b/core/src/main/java/kitchenpos/core/domain/table/OrderTables.java similarity index 96% rename from src/main/java/kitchenpos/domain/table/OrderTables.java rename to core/src/main/java/kitchenpos/core/domain/table/OrderTables.java index cd75c6c4b4..f7f76d297a 100644 --- a/src/main/java/kitchenpos/domain/table/OrderTables.java +++ b/core/src/main/java/kitchenpos/core/domain/table/OrderTables.java @@ -1,4 +1,4 @@ -package kitchenpos.domain.table; +package kitchenpos.core.domain.table; import java.util.List; diff --git a/src/main/java/kitchenpos/domain/table/TableGroup.java b/core/src/main/java/kitchenpos/core/domain/table/TableGroup.java similarity index 95% rename from src/main/java/kitchenpos/domain/table/TableGroup.java rename to core/src/main/java/kitchenpos/core/domain/table/TableGroup.java index 610e3331f4..bb97c602d8 100644 --- a/src/main/java/kitchenpos/domain/table/TableGroup.java +++ b/core/src/main/java/kitchenpos/core/domain/table/TableGroup.java @@ -1,4 +1,4 @@ -package kitchenpos.domain.table; +package kitchenpos.core.domain.table; import java.time.LocalDateTime; import javax.persistence.Column; diff --git a/src/main/java/kitchenpos/domain/menu/repository/MenuGroupRepository.java b/core/src/main/java/kitchenpos/core/repository/menu/MenuGroupRepository.java similarity index 75% rename from src/main/java/kitchenpos/domain/menu/repository/MenuGroupRepository.java rename to core/src/main/java/kitchenpos/core/repository/menu/MenuGroupRepository.java index 0b50a4fd25..16917f563c 100644 --- a/src/main/java/kitchenpos/domain/menu/repository/MenuGroupRepository.java +++ b/core/src/main/java/kitchenpos/core/repository/menu/MenuGroupRepository.java @@ -1,7 +1,7 @@ -package kitchenpos.domain.menu.repository; +package kitchenpos.core.repository.menu; import java.util.List; -import kitchenpos.domain.menu.MenuGroup; +import kitchenpos.core.domain.menu.MenuGroup; import org.springframework.data.repository.Repository; public interface MenuGroupRepository extends Repository { diff --git a/src/main/java/kitchenpos/domain/menu/repository/MenuHistoryRepository.java b/core/src/main/java/kitchenpos/core/repository/menu/MenuHistoryRepository.java similarity index 80% rename from src/main/java/kitchenpos/domain/menu/repository/MenuHistoryRepository.java rename to core/src/main/java/kitchenpos/core/repository/menu/MenuHistoryRepository.java index 3faa320d77..2378bd5f54 100644 --- a/src/main/java/kitchenpos/domain/menu/repository/MenuHistoryRepository.java +++ b/core/src/main/java/kitchenpos/core/repository/menu/MenuHistoryRepository.java @@ -1,8 +1,8 @@ -package kitchenpos.domain.menu.repository; +package kitchenpos.core.repository.menu; import java.util.Optional; -import kitchenpos.domain.menu.Menu; -import kitchenpos.domain.menu.MenuHistory; +import kitchenpos.core.domain.menu.Menu; +import kitchenpos.core.domain.menu.MenuHistory; import org.springframework.data.repository.Repository; public interface MenuHistoryRepository extends Repository { diff --git a/src/main/java/kitchenpos/domain/menu/repository/MenuProductRepository.java b/core/src/main/java/kitchenpos/core/repository/menu/MenuProductRepository.java similarity index 76% rename from src/main/java/kitchenpos/domain/menu/repository/MenuProductRepository.java rename to core/src/main/java/kitchenpos/core/repository/menu/MenuProductRepository.java index f70ee0c66f..1adacab5a5 100644 --- a/src/main/java/kitchenpos/domain/menu/repository/MenuProductRepository.java +++ b/core/src/main/java/kitchenpos/core/repository/menu/MenuProductRepository.java @@ -1,7 +1,7 @@ -package kitchenpos.domain.menu.repository; +package kitchenpos.core.repository.menu; import java.util.List; -import kitchenpos.domain.menu.MenuProduct; +import kitchenpos.core.domain.menu.MenuProduct; import org.springframework.data.repository.Repository; public interface MenuProductRepository extends Repository { diff --git a/src/main/java/kitchenpos/domain/menu/repository/MenuRepository.java b/core/src/main/java/kitchenpos/core/repository/menu/MenuRepository.java similarity index 84% rename from src/main/java/kitchenpos/domain/menu/repository/MenuRepository.java rename to core/src/main/java/kitchenpos/core/repository/menu/MenuRepository.java index 5adf037db1..38ae0a2518 100644 --- a/src/main/java/kitchenpos/domain/menu/repository/MenuRepository.java +++ b/core/src/main/java/kitchenpos/core/repository/menu/MenuRepository.java @@ -1,8 +1,8 @@ -package kitchenpos.domain.menu.repository; +package kitchenpos.core.repository.menu; import java.util.List; import java.util.Optional; -import kitchenpos.domain.menu.Menu; +import kitchenpos.core.domain.menu.Menu; import org.springframework.data.repository.Repository; public interface MenuRepository extends Repository { diff --git a/src/main/java/kitchenpos/domain/menu/repository/ProductRepository.java b/core/src/main/java/kitchenpos/core/repository/menu/ProductRepository.java similarity index 83% rename from src/main/java/kitchenpos/domain/menu/repository/ProductRepository.java rename to core/src/main/java/kitchenpos/core/repository/menu/ProductRepository.java index d5869ed4fc..34908ef04c 100644 --- a/src/main/java/kitchenpos/domain/menu/repository/ProductRepository.java +++ b/core/src/main/java/kitchenpos/core/repository/menu/ProductRepository.java @@ -1,8 +1,8 @@ -package kitchenpos.domain.menu.repository; +package kitchenpos.core.repository.menu; import java.util.List; import java.util.Optional; -import kitchenpos.domain.menu.Product; +import kitchenpos.core.domain.menu.Product; import org.springframework.data.repository.Repository; public interface ProductRepository extends Repository { diff --git a/src/main/java/kitchenpos/domain/order/repository/OrderLineItemRepository.java b/core/src/main/java/kitchenpos/core/repository/order/OrderLineItemRepository.java similarity index 76% rename from src/main/java/kitchenpos/domain/order/repository/OrderLineItemRepository.java rename to core/src/main/java/kitchenpos/core/repository/order/OrderLineItemRepository.java index c13ff90e84..273ae5a15a 100644 --- a/src/main/java/kitchenpos/domain/order/repository/OrderLineItemRepository.java +++ b/core/src/main/java/kitchenpos/core/repository/order/OrderLineItemRepository.java @@ -1,7 +1,7 @@ -package kitchenpos.domain.order.repository; +package kitchenpos.core.repository.order; import java.util.List; -import kitchenpos.domain.order.OrderLineItem; +import kitchenpos.core.domain.order.OrderLineItem; import org.springframework.data.repository.Repository; public interface OrderLineItemRepository extends Repository { diff --git a/src/main/java/kitchenpos/domain/order/repository/OrderRepository.java b/core/src/main/java/kitchenpos/core/repository/order/OrderRepository.java similarity index 82% rename from src/main/java/kitchenpos/domain/order/repository/OrderRepository.java rename to core/src/main/java/kitchenpos/core/repository/order/OrderRepository.java index 07e73ff16d..40ad2d94d3 100644 --- a/src/main/java/kitchenpos/domain/order/repository/OrderRepository.java +++ b/core/src/main/java/kitchenpos/core/repository/order/OrderRepository.java @@ -1,9 +1,9 @@ -package kitchenpos.domain.order.repository; +package kitchenpos.core.repository.order; import java.util.List; import java.util.Optional; -import kitchenpos.domain.order.Order; -import kitchenpos.domain.order.OrderStatus; +import kitchenpos.core.domain.order.Order; +import kitchenpos.core.domain.order.OrderStatus; import org.springframework.data.repository.Repository; public interface OrderRepository extends Repository { diff --git a/src/main/java/kitchenpos/domain/table/repository/OrderTableRepository.java b/core/src/main/java/kitchenpos/core/repository/table/OrderTableRepository.java similarity index 86% rename from src/main/java/kitchenpos/domain/table/repository/OrderTableRepository.java rename to core/src/main/java/kitchenpos/core/repository/table/OrderTableRepository.java index cf29ced979..b6b02e2daf 100644 --- a/src/main/java/kitchenpos/domain/table/repository/OrderTableRepository.java +++ b/core/src/main/java/kitchenpos/core/repository/table/OrderTableRepository.java @@ -1,8 +1,8 @@ -package kitchenpos.domain.table.repository; +package kitchenpos.core.repository.table; import java.util.List; import java.util.Optional; -import kitchenpos.domain.table.OrderTable; +import kitchenpos.core.domain.table.OrderTable; import org.springframework.data.repository.Repository; public interface OrderTableRepository extends Repository { diff --git a/src/main/java/kitchenpos/domain/table/repository/TableGroupRepository.java b/core/src/main/java/kitchenpos/core/repository/table/TableGroupRepository.java similarity index 72% rename from src/main/java/kitchenpos/domain/table/repository/TableGroupRepository.java rename to core/src/main/java/kitchenpos/core/repository/table/TableGroupRepository.java index bfb0d5a98f..44525ed85a 100644 --- a/src/main/java/kitchenpos/domain/table/repository/TableGroupRepository.java +++ b/core/src/main/java/kitchenpos/core/repository/table/TableGroupRepository.java @@ -1,7 +1,7 @@ -package kitchenpos.domain.table.repository; +package kitchenpos.core.repository.table; import java.util.List; -import kitchenpos.domain.table.TableGroup; +import kitchenpos.core.domain.table.TableGroup; import org.springframework.data.repository.Repository; public interface TableGroupRepository extends Repository { diff --git a/src/main/resources/application.properties b/core/src/main/resources/application.properties similarity index 100% rename from src/main/resources/application.properties rename to core/src/main/resources/application.properties diff --git a/src/main/resources/db/migration/V1__Initialize_project_tables.sql b/core/src/main/resources/db/migration/V1__Initialize_project_tables.sql similarity index 100% rename from src/main/resources/db/migration/V1__Initialize_project_tables.sql rename to core/src/main/resources/db/migration/V1__Initialize_project_tables.sql diff --git a/src/main/resources/db/migration/V2__Insert_default_data.sql b/core/src/main/resources/db/migration/V2__Insert_default_data.sql similarity index 100% rename from src/main/resources/db/migration/V2__Insert_default_data.sql rename to core/src/main/resources/db/migration/V2__Insert_default_data.sql diff --git a/src/main/resources/db/migration/V3.0__Create_meny_history_table.sql b/core/src/main/resources/db/migration/V3.0__Create_meny_history_table.sql similarity index 100% rename from src/main/resources/db/migration/V3.0__Create_meny_history_table.sql rename to core/src/main/resources/db/migration/V3.0__Create_meny_history_table.sql diff --git a/src/main/resources/db/migration/V3.1__Alter_order_line_item_fk_to_menu_history.sql b/core/src/main/resources/db/migration/V3.1__Alter_order_line_item_fk_to_menu_history.sql similarity index 100% rename from src/main/resources/db/migration/V3.1__Alter_order_line_item_fk_to_menu_history.sql rename to core/src/main/resources/db/migration/V3.1__Alter_order_line_item_fk_to_menu_history.sql diff --git a/core/src/test/java/kitchenpos/CoreTestApplication.java b/core/src/test/java/kitchenpos/CoreTestApplication.java new file mode 100644 index 0000000000..f4faf556e6 --- /dev/null +++ b/core/src/test/java/kitchenpos/CoreTestApplication.java @@ -0,0 +1,12 @@ +package kitchenpos; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +class CoreTestApplication { + + public static void main(String[] args) { + SpringApplication.run(CoreTestApplication.class, args); + } +} diff --git a/src/test/java/kitchenpos/domain/menu/MenuGroupTest.java b/core/src/test/java/kitchenpos/core/domain/menu/MenuGroupTest.java similarity index 91% rename from src/test/java/kitchenpos/domain/menu/MenuGroupTest.java rename to core/src/test/java/kitchenpos/core/domain/menu/MenuGroupTest.java index 1c3fbb61a9..f0c99d8d7e 100644 --- a/src/test/java/kitchenpos/domain/menu/MenuGroupTest.java +++ b/core/src/test/java/kitchenpos/core/domain/menu/MenuGroupTest.java @@ -1,4 +1,4 @@ -package kitchenpos.domain.menu; +package kitchenpos.core.domain.menu; import static org.assertj.core.api.Assertions.assertThatThrownBy; diff --git a/src/test/java/kitchenpos/domain/menu/MenuTest.java b/core/src/test/java/kitchenpos/core/domain/menu/MenuTest.java similarity index 95% rename from src/test/java/kitchenpos/domain/menu/MenuTest.java rename to core/src/test/java/kitchenpos/core/domain/menu/MenuTest.java index babf9ca785..12108376e3 100644 --- a/src/test/java/kitchenpos/domain/menu/MenuTest.java +++ b/core/src/test/java/kitchenpos/core/domain/menu/MenuTest.java @@ -1,4 +1,4 @@ -package kitchenpos.domain.menu; +package kitchenpos.core.domain.menu; import static org.assertj.core.api.Assertions.assertThatThrownBy; diff --git a/src/test/java/kitchenpos/domain/menu/PriceTest.java b/core/src/test/java/kitchenpos/core/domain/menu/PriceTest.java similarity index 88% rename from src/test/java/kitchenpos/domain/menu/PriceTest.java rename to core/src/test/java/kitchenpos/core/domain/menu/PriceTest.java index 4881cfa452..3370e38671 100644 --- a/src/test/java/kitchenpos/domain/menu/PriceTest.java +++ b/core/src/test/java/kitchenpos/core/domain/menu/PriceTest.java @@ -1,9 +1,8 @@ -package kitchenpos.domain.menu; +package kitchenpos.core.domain.menu; import static org.assertj.core.api.Assertions.assertThatThrownBy; import java.math.BigDecimal; -import java.util.List; import org.junit.jupiter.api.Test; @SuppressWarnings("NonAsciiCharacters") diff --git a/src/test/java/kitchenpos/domain/menu/ProductTest.java b/core/src/test/java/kitchenpos/core/domain/menu/ProductTest.java similarity index 93% rename from src/test/java/kitchenpos/domain/menu/ProductTest.java rename to core/src/test/java/kitchenpos/core/domain/menu/ProductTest.java index 74aee02fe6..7804a2bd4c 100644 --- a/src/test/java/kitchenpos/domain/menu/ProductTest.java +++ b/core/src/test/java/kitchenpos/core/domain/menu/ProductTest.java @@ -1,8 +1,7 @@ -package kitchenpos.domain.menu; +package kitchenpos.core.domain.menu; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; -import static org.junit.jupiter.api.Assertions.*; import java.math.BigDecimal; import org.junit.jupiter.api.DisplayName; diff --git a/src/test/java/kitchenpos/domain/order/OrderTest.java b/core/src/test/java/kitchenpos/core/domain/order/OrderTest.java similarity index 95% rename from src/test/java/kitchenpos/domain/order/OrderTest.java rename to core/src/test/java/kitchenpos/core/domain/order/OrderTest.java index bb1ae774cc..179a89ae79 100644 --- a/src/test/java/kitchenpos/domain/order/OrderTest.java +++ b/core/src/test/java/kitchenpos/core/domain/order/OrderTest.java @@ -1,10 +1,10 @@ -package kitchenpos.domain.order; +package kitchenpos.core.domain.order; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import java.time.LocalDateTime; -import kitchenpos.domain.table.OrderTable; +import kitchenpos.core.domain.table.OrderTable; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; diff --git a/src/test/java/kitchenpos/domain/table/OrderTableTest.java b/core/src/test/java/kitchenpos/core/domain/table/OrderTableTest.java similarity index 98% rename from src/test/java/kitchenpos/domain/table/OrderTableTest.java rename to core/src/test/java/kitchenpos/core/domain/table/OrderTableTest.java index 0ff36ef7e0..ebbf8b6107 100644 --- a/src/test/java/kitchenpos/domain/table/OrderTableTest.java +++ b/core/src/test/java/kitchenpos/core/domain/table/OrderTableTest.java @@ -1,4 +1,4 @@ -package kitchenpos.domain.table; +package kitchenpos.core.domain.table; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; diff --git a/src/test/java/kitchenpos/domain/table/OrderTablesTest.java b/core/src/test/java/kitchenpos/core/domain/table/OrderTablesTest.java similarity index 98% rename from src/test/java/kitchenpos/domain/table/OrderTablesTest.java rename to core/src/test/java/kitchenpos/core/domain/table/OrderTablesTest.java index f7621f8203..081c608c68 100644 --- a/src/test/java/kitchenpos/domain/table/OrderTablesTest.java +++ b/core/src/test/java/kitchenpos/core/domain/table/OrderTablesTest.java @@ -1,4 +1,4 @@ -package kitchenpos.domain.table; +package kitchenpos.core.domain.table; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; diff --git a/src/test/java/kitchenpos/domain/repository/MenuHistoryRepositoryTest.java b/core/src/test/java/kitchenpos/core/repository/menu/MenuHistoryRepositoryTest.java similarity index 81% rename from src/test/java/kitchenpos/domain/repository/MenuHistoryRepositoryTest.java rename to core/src/test/java/kitchenpos/core/repository/menu/MenuHistoryRepositoryTest.java index 39da4797f9..c0980b6e49 100644 --- a/src/test/java/kitchenpos/domain/repository/MenuHistoryRepositoryTest.java +++ b/core/src/test/java/kitchenpos/core/repository/menu/MenuHistoryRepositoryTest.java @@ -1,13 +1,11 @@ -package kitchenpos.domain.repository; +package kitchenpos.core.repository.menu; import static org.assertj.core.api.Assertions.assertThat; import java.math.BigDecimal; -import kitchenpos.domain.menu.Menu; -import kitchenpos.domain.menu.MenuHistory; -import kitchenpos.domain.menu.Price; -import kitchenpos.domain.menu.repository.MenuHistoryRepository; -import kitchenpos.domain.menu.repository.MenuRepository; +import kitchenpos.core.domain.menu.Menu; +import kitchenpos.core.domain.menu.MenuHistory; +import kitchenpos.core.domain.menu.Price; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; diff --git a/settings.gradle b/settings.gradle index db5850c279..5906cf6183 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,3 @@ rootProject.name = 'kitchenpos' + +include 'core', 'application', 'ui' diff --git a/src/main/resources/static/empty.txt b/src/main/resources/static/empty.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/main/resources/templates/empty.txt b/src/main/resources/templates/empty.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ui/build.gradle b/ui/build.gradle new file mode 100644 index 0000000000..408c3c4ca5 --- /dev/null +++ b/ui/build.gradle @@ -0,0 +1,3 @@ +bootJar { enabled = false } + +jar { enabled = true } diff --git a/src/main/java/kitchenpos/Application.java b/ui/src/main/java/kitchenpos/Application.java similarity index 100% rename from src/main/java/kitchenpos/Application.java rename to ui/src/main/java/kitchenpos/Application.java diff --git a/src/main/java/kitchenpos/ui/MenuGroupRestController.java b/ui/src/main/java/kitchenpos/ui/menu/MenuGroupRestController.java similarity index 83% rename from src/main/java/kitchenpos/ui/MenuGroupRestController.java rename to ui/src/main/java/kitchenpos/ui/menu/MenuGroupRestController.java index cebccae220..db7fe233c2 100644 --- a/src/main/java/kitchenpos/ui/MenuGroupRestController.java +++ b/ui/src/main/java/kitchenpos/ui/menu/MenuGroupRestController.java @@ -1,9 +1,8 @@ -package kitchenpos.ui; +package kitchenpos.ui.menu; -import kitchenpos.application.MenuGroupService; -import kitchenpos.application.dto.response.MenuGroupDto; -import kitchenpos.domain.menu.MenuGroup; -import kitchenpos.ui.dto.MenuGroupRequestDto; +import kitchenpos.application.menu.MenuGroupService; +import kitchenpos.application.menu.dto.response.MenuGroupDto; +import kitchenpos.ui.menu.dto.MenuGroupRequestDto; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; diff --git a/src/main/java/kitchenpos/ui/MenuRestController.java b/ui/src/main/java/kitchenpos/ui/menu/MenuRestController.java similarity index 85% rename from src/main/java/kitchenpos/ui/MenuRestController.java rename to ui/src/main/java/kitchenpos/ui/menu/MenuRestController.java index c0028dad88..bdab6d4130 100644 --- a/src/main/java/kitchenpos/ui/MenuRestController.java +++ b/ui/src/main/java/kitchenpos/ui/menu/MenuRestController.java @@ -1,8 +1,8 @@ -package kitchenpos.ui; +package kitchenpos.ui.menu; -import kitchenpos.application.MenuService; -import kitchenpos.application.dto.response.MenuDto; -import kitchenpos.ui.dto.MenuRequestDto; +import kitchenpos.application.menu.MenuService; +import kitchenpos.application.menu.dto.response.MenuDto; +import kitchenpos.ui.menu.dto.MenuRequestDto; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; diff --git a/src/main/java/kitchenpos/ui/ProductRestController.java b/ui/src/main/java/kitchenpos/ui/menu/ProductRestController.java similarity index 83% rename from src/main/java/kitchenpos/ui/ProductRestController.java rename to ui/src/main/java/kitchenpos/ui/menu/ProductRestController.java index cbb00dbeb4..3d5a264ff6 100644 --- a/src/main/java/kitchenpos/ui/ProductRestController.java +++ b/ui/src/main/java/kitchenpos/ui/menu/ProductRestController.java @@ -1,9 +1,8 @@ -package kitchenpos.ui; +package kitchenpos.ui.menu; -import kitchenpos.application.ProductService; -import kitchenpos.application.dto.response.ProductDto; -import kitchenpos.domain.menu.Product; -import kitchenpos.ui.dto.ProductRequestDto; +import kitchenpos.application.menu.ProductService; +import kitchenpos.application.menu.dto.response.ProductDto; +import kitchenpos.ui.menu.dto.ProductRequestDto; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; diff --git a/src/main/java/kitchenpos/ui/dto/MenuGroupRequestDto.java b/ui/src/main/java/kitchenpos/ui/menu/dto/MenuGroupRequestDto.java similarity index 73% rename from src/main/java/kitchenpos/ui/dto/MenuGroupRequestDto.java rename to ui/src/main/java/kitchenpos/ui/menu/dto/MenuGroupRequestDto.java index b6defe797e..03aff62987 100644 --- a/src/main/java/kitchenpos/ui/dto/MenuGroupRequestDto.java +++ b/ui/src/main/java/kitchenpos/ui/menu/dto/MenuGroupRequestDto.java @@ -1,6 +1,6 @@ -package kitchenpos.ui.dto; +package kitchenpos.ui.menu.dto; -import kitchenpos.application.dto.request.CreateMenuGroupDto; +import kitchenpos.application.menu.dto.request.CreateMenuGroupDto; public class MenuGroupRequestDto { diff --git a/src/main/java/kitchenpos/ui/dto/MenuRequestDto.java b/ui/src/main/java/kitchenpos/ui/menu/dto/MenuRequestDto.java similarity index 89% rename from src/main/java/kitchenpos/ui/dto/MenuRequestDto.java rename to ui/src/main/java/kitchenpos/ui/menu/dto/MenuRequestDto.java index e8bcd181fb..db2af58a0d 100644 --- a/src/main/java/kitchenpos/ui/dto/MenuRequestDto.java +++ b/ui/src/main/java/kitchenpos/ui/menu/dto/MenuRequestDto.java @@ -1,10 +1,10 @@ -package kitchenpos.ui.dto; +package kitchenpos.ui.menu.dto; import java.math.BigDecimal; import java.util.List; import java.util.stream.Collectors; -import kitchenpos.application.dto.request.CreateMenuDto; -import kitchenpos.application.dto.request.CreateMenuProductDto; +import kitchenpos.application.menu.dto.request.CreateMenuDto; +import kitchenpos.application.menu.dto.request.CreateMenuProductDto; public class MenuRequestDto { diff --git a/src/main/java/kitchenpos/ui/dto/ProductRequestDto.java b/ui/src/main/java/kitchenpos/ui/menu/dto/ProductRequestDto.java similarity index 80% rename from src/main/java/kitchenpos/ui/dto/ProductRequestDto.java rename to ui/src/main/java/kitchenpos/ui/menu/dto/ProductRequestDto.java index 777305ee3d..30c6ef9f44 100644 --- a/src/main/java/kitchenpos/ui/dto/ProductRequestDto.java +++ b/ui/src/main/java/kitchenpos/ui/menu/dto/ProductRequestDto.java @@ -1,7 +1,7 @@ -package kitchenpos.ui.dto; +package kitchenpos.ui.menu.dto; import java.math.BigDecimal; -import kitchenpos.application.dto.request.CreateProductDto; +import kitchenpos.application.menu.dto.request.CreateProductDto; public class ProductRequestDto { diff --git a/src/main/java/kitchenpos/ui/OrderRestController.java b/ui/src/main/java/kitchenpos/ui/order/OrderRestController.java similarity index 83% rename from src/main/java/kitchenpos/ui/OrderRestController.java rename to ui/src/main/java/kitchenpos/ui/order/OrderRestController.java index 9af2941fdc..35698a7af3 100644 --- a/src/main/java/kitchenpos/ui/OrderRestController.java +++ b/ui/src/main/java/kitchenpos/ui/order/OrderRestController.java @@ -1,9 +1,9 @@ -package kitchenpos.ui; +package kitchenpos.ui.order; -import kitchenpos.application.OrderService; -import kitchenpos.application.dto.response.OrderDto; -import kitchenpos.ui.dto.OrderRequestDto; -import kitchenpos.ui.dto.OrderStatusRequestDto; +import kitchenpos.application.order.OrderService; +import kitchenpos.application.order.dto.response.OrderDto; +import kitchenpos.ui.order.dto.OrderRequestDto; +import kitchenpos.ui.order.dto.OrderStatusRequestDto; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; diff --git a/src/main/java/kitchenpos/ui/dto/OrderRequestDto.java b/ui/src/main/java/kitchenpos/ui/order/dto/OrderRequestDto.java similarity index 86% rename from src/main/java/kitchenpos/ui/dto/OrderRequestDto.java rename to ui/src/main/java/kitchenpos/ui/order/dto/OrderRequestDto.java index 5ea4b2858c..d3cf7f47fa 100644 --- a/src/main/java/kitchenpos/ui/dto/OrderRequestDto.java +++ b/ui/src/main/java/kitchenpos/ui/order/dto/OrderRequestDto.java @@ -1,9 +1,9 @@ -package kitchenpos.ui.dto; +package kitchenpos.ui.order.dto; import java.util.List; import java.util.stream.Collectors; -import kitchenpos.application.dto.request.CreateOrderDto; -import kitchenpos.application.dto.request.CreateOrderLineItemDto; +import kitchenpos.application.order.dto.request.CreateOrderDto; +import kitchenpos.application.order.dto.request.CreateOrderLineItemDto; public class OrderRequestDto { diff --git a/src/main/java/kitchenpos/ui/dto/OrderStatusRequestDto.java b/ui/src/main/java/kitchenpos/ui/order/dto/OrderStatusRequestDto.java similarity index 55% rename from src/main/java/kitchenpos/ui/dto/OrderStatusRequestDto.java rename to ui/src/main/java/kitchenpos/ui/order/dto/OrderStatusRequestDto.java index be8c6cc5a4..231028b098 100644 --- a/src/main/java/kitchenpos/ui/dto/OrderStatusRequestDto.java +++ b/ui/src/main/java/kitchenpos/ui/order/dto/OrderStatusRequestDto.java @@ -1,7 +1,6 @@ -package kitchenpos.ui.dto; +package kitchenpos.ui.order.dto; -import kitchenpos.application.dto.request.UpdateOrderStatusDto; -import kitchenpos.domain.order.OrderStatus; +import kitchenpos.application.order.dto.request.UpdateOrderStatusDto; public class OrderStatusRequestDto { @@ -11,7 +10,7 @@ public OrderStatusRequestDto() { } public UpdateOrderStatusDto toUpdateOrderStatusDto(Long orderId) { - return new UpdateOrderStatusDto(orderId, OrderStatus.valueOf(orderStatus)); + return new UpdateOrderStatusDto(orderId, orderStatus); } public String getOrderStatus() { diff --git a/src/main/java/kitchenpos/ui/TableGroupRestController.java b/ui/src/main/java/kitchenpos/ui/table/TableGroupRestController.java similarity index 83% rename from src/main/java/kitchenpos/ui/TableGroupRestController.java rename to ui/src/main/java/kitchenpos/ui/table/TableGroupRestController.java index 461651c1a7..cf89c5af7f 100644 --- a/src/main/java/kitchenpos/ui/TableGroupRestController.java +++ b/ui/src/main/java/kitchenpos/ui/table/TableGroupRestController.java @@ -1,8 +1,8 @@ -package kitchenpos.ui; +package kitchenpos.ui.table; -import kitchenpos.application.TableGroupService; -import kitchenpos.application.dto.response.TableGroupDto; -import kitchenpos.ui.dto.TableGroupsRequestDto; +import kitchenpos.application.table.TableGroupService; +import kitchenpos.application.table.dto.response.TableGroupDto; +import kitchenpos.ui.table.dto.TableGroupsRequestDto; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; diff --git a/src/main/java/kitchenpos/ui/TableRestController.java b/ui/src/main/java/kitchenpos/ui/table/TableRestController.java similarity index 82% rename from src/main/java/kitchenpos/ui/TableRestController.java rename to ui/src/main/java/kitchenpos/ui/table/TableRestController.java index 39418bd071..71244f32bc 100644 --- a/src/main/java/kitchenpos/ui/TableRestController.java +++ b/ui/src/main/java/kitchenpos/ui/table/TableRestController.java @@ -1,11 +1,11 @@ -package kitchenpos.ui; - -import kitchenpos.application.TableService; -import kitchenpos.application.dto.response.TableDto; -import kitchenpos.application.dto.request.UpdateGuestNumberDto; -import kitchenpos.ui.dto.EmptyTableRequestDto; -import kitchenpos.ui.dto.TableGuestNumberRequestDto; -import kitchenpos.ui.dto.TableRequestDto; +package kitchenpos.ui.table; + +import kitchenpos.application.table.TableService; +import kitchenpos.application.table.dto.response.TableDto; +import kitchenpos.application.table.dto.request.UpdateGuestNumberDto; +import kitchenpos.ui.table.dto.EmptyTableRequestDto; +import kitchenpos.ui.table.dto.TableGuestNumberRequestDto; +import kitchenpos.ui.table.dto.TableRequestDto; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; diff --git a/src/main/java/kitchenpos/ui/dto/EmptyTableRequestDto.java b/ui/src/main/java/kitchenpos/ui/table/dto/EmptyTableRequestDto.java similarity index 75% rename from src/main/java/kitchenpos/ui/dto/EmptyTableRequestDto.java rename to ui/src/main/java/kitchenpos/ui/table/dto/EmptyTableRequestDto.java index 835c37dae0..acbc758579 100644 --- a/src/main/java/kitchenpos/ui/dto/EmptyTableRequestDto.java +++ b/ui/src/main/java/kitchenpos/ui/table/dto/EmptyTableRequestDto.java @@ -1,6 +1,6 @@ -package kitchenpos.ui.dto; +package kitchenpos.ui.table.dto; -import kitchenpos.application.dto.request.EmptyTableDto; +import kitchenpos.application.table.dto.request.EmptyTableDto; public class EmptyTableRequestDto { diff --git a/src/main/java/kitchenpos/ui/dto/TableGroupsRequestDto.java b/ui/src/main/java/kitchenpos/ui/table/dto/TableGroupsRequestDto.java similarity index 87% rename from src/main/java/kitchenpos/ui/dto/TableGroupsRequestDto.java rename to ui/src/main/java/kitchenpos/ui/table/dto/TableGroupsRequestDto.java index de826e0977..62cfd3f228 100644 --- a/src/main/java/kitchenpos/ui/dto/TableGroupsRequestDto.java +++ b/ui/src/main/java/kitchenpos/ui/table/dto/TableGroupsRequestDto.java @@ -1,8 +1,8 @@ -package kitchenpos.ui.dto; +package kitchenpos.ui.table.dto; import java.util.List; import java.util.stream.Collectors; -import kitchenpos.application.dto.request.CreateTableGroupDto; +import kitchenpos.application.table.dto.request.CreateTableGroupDto; public class TableGroupsRequestDto { diff --git a/src/main/java/kitchenpos/ui/dto/TableGuestNumberRequestDto.java b/ui/src/main/java/kitchenpos/ui/table/dto/TableGuestNumberRequestDto.java similarity index 77% rename from src/main/java/kitchenpos/ui/dto/TableGuestNumberRequestDto.java rename to ui/src/main/java/kitchenpos/ui/table/dto/TableGuestNumberRequestDto.java index ef45d36e88..d5290e5e46 100644 --- a/src/main/java/kitchenpos/ui/dto/TableGuestNumberRequestDto.java +++ b/ui/src/main/java/kitchenpos/ui/table/dto/TableGuestNumberRequestDto.java @@ -1,6 +1,6 @@ -package kitchenpos.ui.dto; +package kitchenpos.ui.table.dto; -import kitchenpos.application.dto.request.UpdateGuestNumberDto; +import kitchenpos.application.table.dto.request.UpdateGuestNumberDto; public class TableGuestNumberRequestDto { diff --git a/src/main/java/kitchenpos/ui/dto/TableRequestDto.java b/ui/src/main/java/kitchenpos/ui/table/dto/TableRequestDto.java similarity index 80% rename from src/main/java/kitchenpos/ui/dto/TableRequestDto.java rename to ui/src/main/java/kitchenpos/ui/table/dto/TableRequestDto.java index e4f42c8084..cdcd65f180 100644 --- a/src/main/java/kitchenpos/ui/dto/TableRequestDto.java +++ b/ui/src/main/java/kitchenpos/ui/table/dto/TableRequestDto.java @@ -1,6 +1,6 @@ -package kitchenpos.ui.dto; +package kitchenpos.ui.table.dto; -import kitchenpos.application.dto.request.CreateTableDto; +import kitchenpos.application.table.dto.request.CreateTableDto; public class TableRequestDto { diff --git a/src/test/java/kitchenpos/ApplicationTest.java b/ui/src/test/java/kitchenpos/ApplicationTests.java similarity index 87% rename from src/test/java/kitchenpos/ApplicationTest.java rename to ui/src/test/java/kitchenpos/ApplicationTests.java index a0b48e4bf2..c5f80290ae 100644 --- a/src/test/java/kitchenpos/ApplicationTest.java +++ b/ui/src/test/java/kitchenpos/ApplicationTests.java @@ -4,7 +4,7 @@ import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest -class ApplicationTest { +class ApplicationTests { @Test void contextLoads() {