Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[레거시 코드 리팩터링 - 4단계] 정(정진우) 미션 제출합니다. #453

Open
wants to merge 7 commits into
base: bugoverdose
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions application/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
bootJar { enabled = false }

jar { enabled = true }
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
Original file line number Diff line number Diff line change
@@ -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 {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package kitchenpos.application.dto.request;
package kitchenpos.application.menu.dto.request;

public class CreateMenuGroupDto {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package kitchenpos.application.dto.request;
package kitchenpos.application.menu.dto.request;

public class CreateMenuProductDto {

Expand Down
Original file line number Diff line number Diff line change
@@ -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 {

Expand Down
Original file line number Diff line number Diff line change
@@ -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 {

Expand Down
Original file line number Diff line number Diff line change
@@ -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 {

Expand Down
Original file line number Diff line number Diff line change
@@ -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 {

Expand Down
Original file line number Diff line number Diff line change
@@ -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 {

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package kitchenpos.application.dto.request;
package kitchenpos.application.order.dto.request;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package kitchenpos.application.dto.request;
package kitchenpos.application.order.dto.request;

public class CreateOrderLineItemDto {

Expand Down
Original file line number Diff line number Diff line change
@@ -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 {

Expand Down
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {

Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package kitchenpos.application.dto.request;
package kitchenpos.application.table.dto.request;

public class CreateTableDto {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package kitchenpos.application.dto.request;
package kitchenpos.application.table.dto.request;

import java.util.List;
import org.springframework.util.CollectionUtils;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package kitchenpos.application.dto.request;
package kitchenpos.application.table.dto.request;

public class EmptyTableDto {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package kitchenpos.application.dto.request;
package kitchenpos.application.table.dto.request;

public class UpdateGuestNumberDto {

Expand Down
Original file line number Diff line number Diff line change
@@ -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 {

Expand Down
Original file line number Diff line number Diff line change
@@ -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 {

Expand Down
12 changes: 12 additions & 0 deletions application/src/test/java/kitchenpos/TestApplication.java
Original file line number Diff line number Diff line change
@@ -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);
}
}
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Loading