From ed2ac85b31dd9b47fa253bae413d57d39f41f494 Mon Sep 17 00:00:00 2001 From: soongjamm Date: Mon, 26 Jul 2021 23:03:31 +0900 Subject: [PATCH 01/18] =?UTF-8?q?root=20package=20bluedelivery=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DeliveryApplication.java | 2 +- .../authentication/Authentication.java | 2 +- .../authentication/AuthenticationService.java | 4 ++-- .../AuthenticationServiceImpl.java | 10 ++++---- .../authentication/InvalidLoginException.java | 2 +- .../config/CacheConfiguration.java | 3 +-- .../config/GlobalExceptionHandler.java | 10 ++++---- .../config/RedisConfig.java | 8 +++---- .../config/WebConfig.java | 8 +++---- .../AuthenticationRedisRepository.java | 4 ++-- .../interceptor/AuthenticationRepository.java | 4 ++-- .../interceptor/AuthenticationRequired.java | 2 +- .../interceptor/UserAuthInterceptor.java | 12 +++++----- .../AuthenticatedUserArgumentResolver.java | 6 ++--- .../exception/ApiException.java | 4 ++-- .../response/ErrorCode.java | 4 ++-- .../response/HttpResponse.java | 2 +- .../shop/businesshour/BusinessHour.java | 3 +-- .../businesshour/BusinessHourCondition.java | 4 ++-- .../businesshour/BusinessHourConditions.java | 4 ++-- .../shop/businesshour/BusinessHourMapper.java | 2 +- .../shop/businesshour/BusinessHourPolicy.java | 2 +- .../BusinessHourRequestParam.java | 2 +- .../BusinessHourRequestParams.java | 4 ++-- .../EverydayBusinessHourCondition.java | 4 ++-- .../businesshour/UpdateBusinessHoursDto.java | 2 +- .../WeekdayWeekendBusinessHourCondition.java | 4 ++-- .../shop/category/Categories.java | 2 +- .../shop/category/Category.java | 2 +- .../category/CategoryManagerController.java | 8 +++---- .../CategoryManagerControllerImpl.java | 14 +++++------ .../shop/category/CategoryManagerService.java | 2 +- .../category/CategoryManagerServiceHttp.java | 2 +- .../shop/category/CategoryMapper.java | 2 +- .../category/CategoryNotFoundException.java | 2 +- .../shop/category/CategoryRepository.java | 6 ++--- .../shop/category/CreateCategoryParam.java | 4 ++-- .../shop/category/EditCategoryParam.java | 4 ++-- .../category/GetShopsByCategoryResponse.java | 4 ++-- .../shop/closingday/ClosingDayPolicies.java | 2 +- .../shop/closingday/ClosingDayPolicy.java | 2 +- .../shop/closingday/CyclicRegularClosing.java | 2 +- .../shop/closingday/LegalHoliday.java | 6 ++--- .../shop/closingday/LegalHolidayClosing.java | 2 +- .../shop/closingday/RegularClosingDay.java | 2 +- .../shop/closingday/TemporaryClosing.java | 2 +- .../shop/closingday/WeeklyRegularClosing.java | 2 +- .../shop/closingday/YearlyLegalHolidays.java | 2 +- .../shop/menu/Menu.java | 2 +- .../shop/menu/MenuController.java | 6 ++--- .../shop/menu/MenuGroup.java | 2 +- .../shop/menu/MenuGroupController.java | 6 ++--- .../shop/menu/MenuGroupDto.java | 2 +- .../shop/menu/MenuGroupMapper.java | 2 +- .../shop/menu/MenuGroupService.java | 2 +- .../shop/menu/MenuMapper.java | 4 ++-- .../shop/menu/MenuOption.java | 2 +- .../shop/menu/MenuOptionController.java | 4 ++-- .../shop/menu/MenuOptionControllerImpl.java | 4 ++-- .../shop/menu/MenuOptionDto.java | 2 +- .../shop/menu/MenuOptionGroup.java | 2 +- .../shop/menu/MenuOptionGroupDto.java | 2 +- .../shop/menu/MenuOptionGroupRepository.java | 2 +- .../shop/menu/MenuOptionRepository.java | 2 +- .../shop/menu/MenuOptionService.java | 2 +- .../shop/menu/MenuOptionServiceImpl.java | 6 ++--- .../shop/menu/MenuService.java | 8 +++---- .../shop/menu/RegisterMenuDto.java | 4 ++-- .../shop/menu/UpdateMenuDto.java | 4 ++-- .../search/SearchShopByCategoryParam.java | 2 +- .../shop/search/SearchedShopData.java | 2 +- .../shop/search/ShopExposeController.java | 4 ++-- .../shop/search/ShopExposeHttpController.java | 6 ++--- .../shop/search/ShopExposeService.java | 4 ++-- .../shop/search/ShopExposeServiceImpl.java | 6 ++--- .../shop/shop/EditPhoneRequest.java | 4 ++-- .../shop/shop/RegularClosingParam.java | 8 +++---- .../shop/shop/SearchMenuService.java | 6 ++--- .../shop/shop/Shop.java | 14 +++++------ .../shop/shop/ShopMapper.java | 2 +- .../shop/shop/ShopRepository.java | 2 +- .../shop/shop/ShopUpdateController.java | 8 +++---- .../shop/shop/ShopUpdateControllerImpl.java | 14 +++++------ .../shop/shop/ShopUpdateService.java | 19 +++++++-------- .../shop/shop/TemporaryClosingParam.java | 4 ++-- .../shop/shop/UpdateCategoryRequest.java | 2 +- .../shop/shop/UpdateClosingDaysRequest.java | 2 +- .../shop/suspension/Suspension.java | 2 +- .../shop/suspension/SuspensionRequest.java | 2 +- .../application/UserManagementService.java | 14 +++++------ .../UserManagementServiceHttp.java | 24 +++++++++---------- .../user/domain/User.java | 8 +++---- .../user/domain/UserMapper.java | 2 +- .../user/domain/UserRepository.java | 2 +- .../user/web/AuthenticationController.java | 8 +++---- .../web/AuthenticationControllerImpl.java | 20 ++++++++-------- .../user/web/PasswordValidator.java | 4 ++-- .../user/web/UserManagementController.java | 16 ++++++------- .../web/UserManagementControllerImpl.java | 22 ++++++++--------- .../user/web/dto/AddressParam.java | 2 +- .../user/web/dto/DeleteAccountParam.java | 2 +- .../user/web/dto/UpdateAccountParam.java | 6 ++--- .../user/web/dto/UserLoginParam.java | 2 +- .../user/web/dto/UserRegisterParam.java | 6 ++--- .../utility/EncryptUtils.java | 2 +- .../utility/RegexConstants.java | 2 +- .../utility/address/Address.java | 4 ++-- .../utility/address/AddressRepository.java | 5 ++-- .../utility/address/AddressService.java | 6 ++--- .../utility/address/AddressServiceImpl.java | 8 +++---- .../utility/address/Addresses.java | 7 +++--- .../utility/address/BuildingInfo.java | 2 +- .../address/BuildingInfoRepository.java | 2 +- .../utility/address/CityToDong.java | 2 +- src/main/resources/application.yml | 14 +++++------ .../mybatis/mapper/CategoryMapper.xml | 4 ++-- .../mybatis/mapper/ClosingMapper.xml | 6 ++--- .../mybatis/mapper/MenuGroupMapper.xml | 10 ++++---- .../resources/mybatis/mapper/MenuMapper.xml | 8 +++---- .../resources/mybatis/mapper/ShopMapper.xml | 14 +++++------ .../resources/mybatis/mapper/UserMapper.xml | 4 ++-- .../interceptor/UserAuthInterceptorTest.java | 18 +++++++------- ...AuthenticatedUserArgumentResolverTest.java | 6 ++--- .../BusinessHourPolicyConditionsTest.java | 4 ++-- .../shop/category/CategoriesTest.java | 2 +- .../CategoryManagerControllerImplTest.java | 8 +++---- .../category/CategoryManagerServiceTest.java | 2 +- .../shop/category/CategoryTest.java | 2 +- .../closingday/LegalHolidayClosingTest.java | 4 +--- .../shop/closingday/LegalHolidayTest.java | 4 +--- .../RegularClosingDayPolicyTest.java | 3 +-- .../shop/closingday/TemporaryClosingTest.java | 3 +-- .../shop/menu/MenuGroupServiceTest.java | 2 +- .../shop/menu/MenuOptionControllerTest.java | 6 ++--- .../shop/menu/MenuOptionServiceTest.java | 2 +- .../shop/menu/MenuServiceTest.java | 10 ++++---- .../shop/shop/ShopTest.java | 6 ++--- .../shop/shop/ShopUpdateControllerTest.java | 5 ++-- .../shop/shop/ShopUpdateServiceTest.java | 9 ++++--- .../user/UserTest.java | 7 ++---- .../UserManagementServiceTest.java | 12 +++++----- .../AuthenticationControllerLoginTest.java | 10 ++++---- .../web/UserManagementControllerTest.java | 9 ++++--- .../utility/EncryptUtilsTest.java | 2 +- .../utility/PasswordRegexTest.java | 2 +- .../utility/PhoneRegexTest.java | 2 +- .../utility/ShopPhoneRegexTest.java | 3 +-- .../utility/address/AddressesTest.java | 6 ++--- 148 files changed, 370 insertions(+), 392 deletions(-) rename src/main/java/com/{delivery => bluedelivery}/DeliveryApplication.java (93%) rename src/main/java/com/{delivery => bluedelivery}/authentication/Authentication.java (96%) rename src/main/java/com/{delivery => bluedelivery}/authentication/AuthenticationService.java (76%) rename src/main/java/com/{delivery => bluedelivery}/authentication/AuthenticationServiceImpl.java (85%) rename src/main/java/com/{delivery => bluedelivery}/authentication/InvalidLoginException.java (61%) rename src/main/java/com/{delivery => bluedelivery}/config/CacheConfiguration.java (97%) rename src/main/java/com/{delivery => bluedelivery}/config/GlobalExceptionHandler.java (89%) rename src/main/java/com/{delivery => bluedelivery}/config/RedisConfig.java (90%) rename src/main/java/com/{delivery => bluedelivery}/config/WebConfig.java (78%) rename src/main/java/com/{delivery => bluedelivery}/config/interceptor/AuthenticationRedisRepository.java (92%) rename src/main/java/com/{delivery => bluedelivery}/config/interceptor/AuthenticationRepository.java (71%) rename src/main/java/com/{delivery => bluedelivery}/config/interceptor/AuthenticationRequired.java (86%) rename src/main/java/com/{delivery => bluedelivery}/config/interceptor/UserAuthInterceptor.java (84%) rename src/main/java/com/{delivery => bluedelivery}/config/resolver/AuthenticatedUserArgumentResolver.java (90%) rename src/main/java/com/{delivery => bluedelivery}/exception/ApiException.java (76%) rename src/main/java/com/{delivery => bluedelivery}/response/ErrorCode.java (95%) rename src/main/java/com/{delivery => bluedelivery}/response/HttpResponse.java (97%) rename src/main/java/com/{delivery => bluedelivery}/shop/businesshour/BusinessHour.java (97%) rename src/main/java/com/{delivery => bluedelivery}/shop/businesshour/BusinessHourCondition.java (64%) rename src/main/java/com/{delivery => bluedelivery}/shop/businesshour/BusinessHourConditions.java (88%) rename src/main/java/com/{delivery => bluedelivery}/shop/businesshour/BusinessHourMapper.java (81%) rename src/main/java/com/{delivery => bluedelivery}/shop/businesshour/BusinessHourPolicy.java (95%) rename src/main/java/com/{delivery => bluedelivery}/shop/businesshour/BusinessHourRequestParam.java (94%) rename src/main/java/com/{delivery => bluedelivery}/shop/businesshour/BusinessHourRequestParams.java (90%) rename src/main/java/com/{delivery => bluedelivery}/shop/businesshour/EverydayBusinessHourCondition.java (86%) rename src/main/java/com/{delivery => bluedelivery}/shop/businesshour/UpdateBusinessHoursDto.java (95%) rename src/main/java/com/{delivery => bluedelivery}/shop/businesshour/WeekdayWeekendBusinessHourCondition.java (90%) rename src/main/java/com/{delivery => bluedelivery}/shop/category/Categories.java (92%) rename src/main/java/com/{delivery => bluedelivery}/shop/category/Category.java (96%) rename src/main/java/com/{delivery => bluedelivery}/shop/category/CategoryManagerController.java (87%) rename src/main/java/com/{delivery => bluedelivery}/shop/category/CategoryManagerControllerImpl.java (83%) rename src/main/java/com/{delivery => bluedelivery}/shop/category/CategoryManagerService.java (96%) rename src/main/java/com/{delivery => bluedelivery}/shop/category/CategoryManagerServiceHttp.java (97%) rename src/main/java/com/{delivery => bluedelivery}/shop/category/CategoryMapper.java (74%) rename src/main/java/com/{delivery => bluedelivery}/shop/category/CategoryNotFoundException.java (63%) rename src/main/java/com/{delivery => bluedelivery}/shop/category/CategoryRepository.java (79%) rename src/main/java/com/{delivery => bluedelivery}/shop/category/CreateCategoryParam.java (88%) rename src/main/java/com/{delivery => bluedelivery}/shop/category/EditCategoryParam.java (88%) rename src/main/java/com/{delivery => bluedelivery}/shop/category/GetShopsByCategoryResponse.java (79%) rename src/main/java/com/{delivery => bluedelivery}/shop/closingday/ClosingDayPolicies.java (94%) rename src/main/java/com/{delivery => bluedelivery}/shop/closingday/ClosingDayPolicy.java (90%) rename src/main/java/com/{delivery => bluedelivery}/shop/closingday/CyclicRegularClosing.java (98%) rename src/main/java/com/{delivery => bluedelivery}/shop/closingday/LegalHoliday.java (96%) rename src/main/java/com/{delivery => bluedelivery}/shop/closingday/LegalHolidayClosing.java (96%) rename src/main/java/com/{delivery => bluedelivery}/shop/closingday/RegularClosingDay.java (86%) rename src/main/java/com/{delivery => bluedelivery}/shop/closingday/TemporaryClosing.java (97%) rename src/main/java/com/{delivery => bluedelivery}/shop/closingday/WeeklyRegularClosing.java (95%) rename src/main/java/com/{delivery => bluedelivery}/shop/closingday/YearlyLegalHolidays.java (95%) rename src/main/java/com/{delivery => bluedelivery}/shop/menu/Menu.java (98%) rename src/main/java/com/{delivery => bluedelivery}/shop/menu/MenuController.java (95%) rename src/main/java/com/{delivery => bluedelivery}/shop/menu/MenuGroup.java (95%) rename src/main/java/com/{delivery => bluedelivery}/shop/menu/MenuGroupController.java (95%) rename src/main/java/com/{delivery => bluedelivery}/shop/menu/MenuGroupDto.java (97%) rename src/main/java/com/{delivery => bluedelivery}/shop/menu/MenuGroupMapper.java (92%) rename src/main/java/com/{delivery => bluedelivery}/shop/menu/MenuGroupService.java (96%) rename src/main/java/com/{delivery => bluedelivery}/shop/menu/MenuMapper.java (84%) rename src/main/java/com/{delivery => bluedelivery}/shop/menu/MenuOption.java (97%) rename src/main/java/com/{delivery => bluedelivery}/shop/menu/MenuOptionController.java (78%) rename src/main/java/com/{delivery => bluedelivery}/shop/menu/MenuOptionControllerImpl.java (95%) rename src/main/java/com/{delivery => bluedelivery}/shop/menu/MenuOptionDto.java (96%) rename src/main/java/com/{delivery => bluedelivery}/shop/menu/MenuOptionGroup.java (98%) rename src/main/java/com/{delivery => bluedelivery}/shop/menu/MenuOptionGroupDto.java (97%) rename src/main/java/com/{delivery => bluedelivery}/shop/menu/MenuOptionGroupRepository.java (81%) rename src/main/java/com/{delivery => bluedelivery}/shop/menu/MenuOptionRepository.java (80%) rename src/main/java/com/{delivery => bluedelivery}/shop/menu/MenuOptionService.java (80%) rename src/main/java/com/{delivery => bluedelivery}/shop/menu/MenuOptionServiceImpl.java (90%) rename src/main/java/com/{delivery => bluedelivery}/shop/menu/MenuService.java (84%) rename src/main/java/com/{delivery => bluedelivery}/shop/menu/RegisterMenuDto.java (96%) rename src/main/java/com/{delivery => bluedelivery}/shop/menu/UpdateMenuDto.java (94%) rename src/main/java/com/{delivery => bluedelivery}/shop/search/SearchShopByCategoryParam.java (92%) rename src/main/java/com/{delivery => bluedelivery}/shop/search/SearchedShopData.java (94%) rename src/main/java/com/{delivery => bluedelivery}/shop/search/ShopExposeController.java (87%) rename src/main/java/com/{delivery => bluedelivery}/shop/search/ShopExposeHttpController.java (90%) rename src/main/java/com/{delivery => bluedelivery}/shop/search/ShopExposeService.java (63%) rename src/main/java/com/{delivery => bluedelivery}/shop/search/ShopExposeServiceImpl.java (89%) rename src/main/java/com/{delivery => bluedelivery}/shop/shop/EditPhoneRequest.java (86%) rename src/main/java/com/{delivery => bluedelivery}/shop/shop/RegularClosingParam.java (82%) rename src/main/java/com/{delivery => bluedelivery}/shop/shop/SearchMenuService.java (85%) rename src/main/java/com/{delivery => bluedelivery}/shop/shop/Shop.java (87%) rename src/main/java/com/{delivery => bluedelivery}/shop/shop/ShopMapper.java (75%) rename src/main/java/com/{delivery => bluedelivery}/shop/shop/ShopRepository.java (94%) rename src/main/java/com/{delivery => bluedelivery}/shop/shop/ShopUpdateController.java (92%) rename src/main/java/com/{delivery => bluedelivery}/shop/shop/ShopUpdateControllerImpl.java (83%) rename src/main/java/com/{delivery => bluedelivery}/shop/shop/ShopUpdateService.java (86%) rename src/main/java/com/{delivery => bluedelivery}/shop/shop/TemporaryClosingParam.java (88%) rename src/main/java/com/{delivery => bluedelivery}/shop/shop/UpdateCategoryRequest.java (92%) rename src/main/java/com/{delivery => bluedelivery}/shop/shop/UpdateClosingDaysRequest.java (96%) rename src/main/java/com/{delivery => bluedelivery}/shop/suspension/Suspension.java (95%) rename src/main/java/com/{delivery => bluedelivery}/shop/suspension/SuspensionRequest.java (95%) rename src/main/java/com/{delivery => bluedelivery}/user/application/UserManagementService.java (78%) rename src/main/java/com/{delivery => bluedelivery}/user/application/UserManagementServiceHttp.java (81%) rename src/main/java/com/{delivery => bluedelivery}/user/domain/User.java (93%) rename src/main/java/com/{delivery => bluedelivery}/user/domain/UserMapper.java (74%) rename src/main/java/com/{delivery => bluedelivery}/user/domain/UserRepository.java (87%) rename src/main/java/com/{delivery => bluedelivery}/user/web/AuthenticationController.java (78%) rename src/main/java/com/{delivery => bluedelivery}/user/web/AuthenticationControllerImpl.java (66%) rename src/main/java/com/{delivery => bluedelivery}/user/web/PasswordValidator.java (86%) rename src/main/java/com/{delivery => bluedelivery}/user/web/UserManagementController.java (85%) rename src/main/java/com/{delivery => bluedelivery}/user/web/UserManagementControllerImpl.java (80%) rename src/main/java/com/{delivery => bluedelivery}/user/web/dto/AddressParam.java (93%) rename src/main/java/com/{delivery => bluedelivery}/user/web/dto/DeleteAccountParam.java (94%) rename src/main/java/com/{delivery => bluedelivery}/user/web/dto/UpdateAccountParam.java (84%) rename src/main/java/com/{delivery => bluedelivery}/user/web/dto/UserLoginParam.java (94%) rename src/main/java/com/{delivery => bluedelivery}/user/web/dto/UserRegisterParam.java (93%) rename src/main/java/com/{delivery => bluedelivery}/utility/EncryptUtils.java (94%) rename src/main/java/com/{delivery => bluedelivery}/utility/RegexConstants.java (90%) rename src/main/java/com/{delivery => bluedelivery}/utility/address/Address.java (95%) rename src/main/java/com/{delivery => bluedelivery}/utility/address/AddressRepository.java (65%) rename src/main/java/com/{delivery => bluedelivery}/utility/address/AddressService.java (84%) rename src/main/java/com/{delivery => bluedelivery}/utility/address/AddressServiceImpl.java (79%) rename src/main/java/com/{delivery => bluedelivery}/utility/address/Addresses.java (91%) rename src/main/java/com/{delivery => bluedelivery}/utility/address/BuildingInfo.java (99%) rename src/main/java/com/{delivery => bluedelivery}/utility/address/BuildingInfoRepository.java (78%) rename src/main/java/com/{delivery => bluedelivery}/utility/address/CityToDong.java (96%) rename src/test/java/com/{delivery => bluedelivery}/config/interceptor/UserAuthInterceptorTest.java (85%) rename src/test/java/com/{delivery => bluedelivery}/config/resolver/AuthenticatedUserArgumentResolverTest.java (92%) rename src/test/java/com/{delivery => bluedelivery}/shop/businesshour/BusinessHourPolicyConditionsTest.java (97%) rename src/test/java/com/{delivery => bluedelivery}/shop/category/CategoriesTest.java (98%) rename src/test/java/com/{delivery => bluedelivery}/shop/category/CategoryManagerControllerImplTest.java (96%) rename src/test/java/com/{delivery => bluedelivery}/shop/category/CategoryManagerServiceTest.java (96%) rename src/test/java/com/{delivery => bluedelivery}/shop/category/CategoryTest.java (92%) rename src/test/java/com/{delivery => bluedelivery}/shop/closingday/LegalHolidayClosingTest.java (94%) rename src/test/java/com/{delivery => bluedelivery}/shop/closingday/LegalHolidayTest.java (93%) rename src/test/java/com/{delivery => bluedelivery}/shop/closingday/RegularClosingDayPolicyTest.java (97%) rename src/test/java/com/{delivery => bluedelivery}/shop/closingday/TemporaryClosingTest.java (93%) rename src/test/java/com/{delivery => bluedelivery}/shop/menu/MenuGroupServiceTest.java (98%) rename src/test/java/com/{delivery => bluedelivery}/shop/menu/MenuOptionControllerTest.java (92%) rename src/test/java/com/{delivery => bluedelivery}/shop/menu/MenuOptionServiceTest.java (98%) rename src/test/java/com/{delivery => bluedelivery}/shop/menu/MenuServiceTest.java (91%) rename src/test/java/com/{delivery => bluedelivery}/shop/shop/ShopTest.java (85%) rename src/test/java/com/{delivery => bluedelivery}/shop/shop/ShopUpdateControllerTest.java (92%) rename src/test/java/com/{delivery => bluedelivery}/shop/shop/ShopUpdateServiceTest.java (89%) rename src/test/java/com/{delivery => bluedelivery}/user/UserTest.java (74%) rename src/test/java/com/{delivery => bluedelivery}/user/application/UserManagementServiceTest.java (88%) rename src/test/java/com/{delivery => bluedelivery}/user/web/AuthenticationControllerLoginTest.java (87%) rename src/test/java/com/{delivery => bluedelivery}/user/web/UserManagementControllerTest.java (92%) rename src/test/java/com/{delivery => bluedelivery}/utility/EncryptUtilsTest.java (90%) rename src/test/java/com/{delivery => bluedelivery}/utility/PasswordRegexTest.java (95%) rename src/test/java/com/{delivery => bluedelivery}/utility/PhoneRegexTest.java (95%) rename src/test/java/com/{delivery => bluedelivery}/utility/ShopPhoneRegexTest.java (92%) rename src/test/java/com/{delivery => bluedelivery}/utility/address/AddressesTest.java (97%) diff --git a/src/main/java/com/delivery/DeliveryApplication.java b/src/main/java/com/bluedelivery/DeliveryApplication.java similarity index 93% rename from src/main/java/com/delivery/DeliveryApplication.java rename to src/main/java/com/bluedelivery/DeliveryApplication.java index 82f30763..0c8da099 100644 --- a/src/main/java/com/delivery/DeliveryApplication.java +++ b/src/main/java/com/bluedelivery/DeliveryApplication.java @@ -1,4 +1,4 @@ -package com.delivery; +package com.bluedelivery; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/src/main/java/com/delivery/authentication/Authentication.java b/src/main/java/com/bluedelivery/authentication/Authentication.java similarity index 96% rename from src/main/java/com/delivery/authentication/Authentication.java rename to src/main/java/com/bluedelivery/authentication/Authentication.java index 582f1715..b1f75167 100644 --- a/src/main/java/com/delivery/authentication/Authentication.java +++ b/src/main/java/com/bluedelivery/authentication/Authentication.java @@ -1,4 +1,4 @@ -package com.delivery.authentication; +package com.bluedelivery.authentication; import java.io.Serializable; import java.time.Duration; diff --git a/src/main/java/com/delivery/authentication/AuthenticationService.java b/src/main/java/com/bluedelivery/authentication/AuthenticationService.java similarity index 76% rename from src/main/java/com/delivery/authentication/AuthenticationService.java rename to src/main/java/com/bluedelivery/authentication/AuthenticationService.java index c8ea9cca..784aafde 100644 --- a/src/main/java/com/delivery/authentication/AuthenticationService.java +++ b/src/main/java/com/bluedelivery/authentication/AuthenticationService.java @@ -1,8 +1,8 @@ -package com.delivery.authentication; +package com.bluedelivery.authentication; import java.util.Optional; -import com.delivery.user.web.dto.UserLoginParam; +import com.bluedelivery.user.web.dto.UserLoginParam; public interface AuthenticationService { String BEARER_PREFIX = "Bearer "; diff --git a/src/main/java/com/delivery/authentication/AuthenticationServiceImpl.java b/src/main/java/com/bluedelivery/authentication/AuthenticationServiceImpl.java similarity index 85% rename from src/main/java/com/delivery/authentication/AuthenticationServiceImpl.java rename to src/main/java/com/bluedelivery/authentication/AuthenticationServiceImpl.java index bce8205c..7a5544d7 100644 --- a/src/main/java/com/delivery/authentication/AuthenticationServiceImpl.java +++ b/src/main/java/com/bluedelivery/authentication/AuthenticationServiceImpl.java @@ -1,4 +1,4 @@ -package com.delivery.authentication; +package com.bluedelivery.authentication; import static java.util.Objects.nonNull; @@ -8,10 +8,10 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import com.delivery.config.interceptor.AuthenticationRepository; -import com.delivery.user.domain.User; -import com.delivery.user.domain.UserRepository; -import com.delivery.user.web.dto.UserLoginParam; +import com.bluedelivery.config.interceptor.AuthenticationRepository; +import com.bluedelivery.user.domain.User; +import com.bluedelivery.user.domain.UserRepository; +import com.bluedelivery.user.web.dto.UserLoginParam; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/delivery/authentication/InvalidLoginException.java b/src/main/java/com/bluedelivery/authentication/InvalidLoginException.java similarity index 61% rename from src/main/java/com/delivery/authentication/InvalidLoginException.java rename to src/main/java/com/bluedelivery/authentication/InvalidLoginException.java index 0ff33cff..6c557d64 100644 --- a/src/main/java/com/delivery/authentication/InvalidLoginException.java +++ b/src/main/java/com/bluedelivery/authentication/InvalidLoginException.java @@ -1,4 +1,4 @@ -package com.delivery.authentication; +package com.bluedelivery.authentication; public class InvalidLoginException extends RuntimeException { } diff --git a/src/main/java/com/delivery/config/CacheConfiguration.java b/src/main/java/com/bluedelivery/config/CacheConfiguration.java similarity index 97% rename from src/main/java/com/delivery/config/CacheConfiguration.java rename to src/main/java/com/bluedelivery/config/CacheConfiguration.java index 1e0c46fa..299eea94 100644 --- a/src/main/java/com/delivery/config/CacheConfiguration.java +++ b/src/main/java/com/bluedelivery/config/CacheConfiguration.java @@ -1,7 +1,6 @@ -package com.delivery.config; +package com.bluedelivery.config; import java.time.Duration; -import java.util.concurrent.TimeUnit; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.caffeine.CaffeineCacheManager; diff --git a/src/main/java/com/delivery/config/GlobalExceptionHandler.java b/src/main/java/com/bluedelivery/config/GlobalExceptionHandler.java similarity index 89% rename from src/main/java/com/delivery/config/GlobalExceptionHandler.java rename to src/main/java/com/bluedelivery/config/GlobalExceptionHandler.java index 3ea1fcad..06710712 100644 --- a/src/main/java/com/delivery/config/GlobalExceptionHandler.java +++ b/src/main/java/com/bluedelivery/config/GlobalExceptionHandler.java @@ -1,6 +1,6 @@ -package com.delivery.config; +package com.bluedelivery.config; -import static com.delivery.response.HttpResponse.*; +import static com.bluedelivery.response.HttpResponse.*; import java.util.LinkedHashMap; import java.util.Map; @@ -12,9 +12,9 @@ import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.RestControllerAdvice; -import com.delivery.exception.ApiException; -import com.delivery.response.ErrorCode; -import com.delivery.response.HttpResponse; +import com.bluedelivery.exception.ApiException; +import com.bluedelivery.response.ErrorCode; +import com.bluedelivery.response.HttpResponse; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/com/delivery/config/RedisConfig.java b/src/main/java/com/bluedelivery/config/RedisConfig.java similarity index 90% rename from src/main/java/com/delivery/config/RedisConfig.java rename to src/main/java/com/bluedelivery/config/RedisConfig.java index 0d9062eb..0bdcf256 100644 --- a/src/main/java/com/delivery/config/RedisConfig.java +++ b/src/main/java/com/bluedelivery/config/RedisConfig.java @@ -1,4 +1,4 @@ -package com.delivery.config; +package com.bluedelivery.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -9,9 +9,9 @@ import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; import org.springframework.data.redis.serializer.StringRedisSerializer; -import com.delivery.authentication.Authentication; -import com.delivery.config.interceptor.AuthenticationRedisRepository; -import com.delivery.config.interceptor.AuthenticationRepository; +import com.bluedelivery.authentication.Authentication; +import com.bluedelivery.config.interceptor.AuthenticationRedisRepository; +import com.bluedelivery.config.interceptor.AuthenticationRepository; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; diff --git a/src/main/java/com/delivery/config/WebConfig.java b/src/main/java/com/bluedelivery/config/WebConfig.java similarity index 78% rename from src/main/java/com/delivery/config/WebConfig.java rename to src/main/java/com/bluedelivery/config/WebConfig.java index bd958542..52cc0c62 100644 --- a/src/main/java/com/delivery/config/WebConfig.java +++ b/src/main/java/com/bluedelivery/config/WebConfig.java @@ -1,4 +1,4 @@ -package com.delivery.config; +package com.bluedelivery.config; import java.util.List; @@ -8,9 +8,9 @@ import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -import com.delivery.authentication.AuthenticationService; -import com.delivery.config.interceptor.UserAuthInterceptor; -import com.delivery.config.resolver.AuthenticatedUserArgumentResolver; +import com.bluedelivery.authentication.AuthenticationService; +import com.bluedelivery.config.interceptor.UserAuthInterceptor; +import com.bluedelivery.config.resolver.AuthenticatedUserArgumentResolver; @Configuration public class WebConfig implements WebMvcConfigurer { diff --git a/src/main/java/com/delivery/config/interceptor/AuthenticationRedisRepository.java b/src/main/java/com/bluedelivery/config/interceptor/AuthenticationRedisRepository.java similarity index 92% rename from src/main/java/com/delivery/config/interceptor/AuthenticationRedisRepository.java rename to src/main/java/com/bluedelivery/config/interceptor/AuthenticationRedisRepository.java index 19e67937..2f10db27 100644 --- a/src/main/java/com/delivery/config/interceptor/AuthenticationRedisRepository.java +++ b/src/main/java/com/bluedelivery/config/interceptor/AuthenticationRedisRepository.java @@ -1,11 +1,11 @@ -package com.delivery.config.interceptor; +package com.bluedelivery.config.interceptor; import java.util.Optional; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Repository; -import com.delivery.authentication.Authentication; +import com.bluedelivery.authentication.Authentication; @Repository public class AuthenticationRedisRepository implements AuthenticationRepository { diff --git a/src/main/java/com/delivery/config/interceptor/AuthenticationRepository.java b/src/main/java/com/bluedelivery/config/interceptor/AuthenticationRepository.java similarity index 71% rename from src/main/java/com/delivery/config/interceptor/AuthenticationRepository.java rename to src/main/java/com/bluedelivery/config/interceptor/AuthenticationRepository.java index cd1f1d8e..a523b277 100644 --- a/src/main/java/com/delivery/config/interceptor/AuthenticationRepository.java +++ b/src/main/java/com/bluedelivery/config/interceptor/AuthenticationRepository.java @@ -1,8 +1,8 @@ -package com.delivery.config.interceptor; +package com.bluedelivery.config.interceptor; import java.util.Optional; -import com.delivery.authentication.Authentication; +import com.bluedelivery.authentication.Authentication; public interface AuthenticationRepository { diff --git a/src/main/java/com/delivery/config/interceptor/AuthenticationRequired.java b/src/main/java/com/bluedelivery/config/interceptor/AuthenticationRequired.java similarity index 86% rename from src/main/java/com/delivery/config/interceptor/AuthenticationRequired.java rename to src/main/java/com/bluedelivery/config/interceptor/AuthenticationRequired.java index 5654c0a9..42fed160 100644 --- a/src/main/java/com/delivery/config/interceptor/AuthenticationRequired.java +++ b/src/main/java/com/bluedelivery/config/interceptor/AuthenticationRequired.java @@ -1,4 +1,4 @@ -package com.delivery.config.interceptor; +package com.bluedelivery.config.interceptor; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/src/main/java/com/delivery/config/interceptor/UserAuthInterceptor.java b/src/main/java/com/bluedelivery/config/interceptor/UserAuthInterceptor.java similarity index 84% rename from src/main/java/com/delivery/config/interceptor/UserAuthInterceptor.java rename to src/main/java/com/bluedelivery/config/interceptor/UserAuthInterceptor.java index d0b8060b..f425388f 100644 --- a/src/main/java/com/delivery/config/interceptor/UserAuthInterceptor.java +++ b/src/main/java/com/bluedelivery/config/interceptor/UserAuthInterceptor.java @@ -1,7 +1,7 @@ -package com.delivery.config.interceptor; +package com.bluedelivery.config.interceptor; -import static com.delivery.response.ErrorCode.INVALID_AUTHENTICATION; -import static com.delivery.response.ErrorCode.NOT_AUTHORIZED_ACCESS; +import static com.bluedelivery.response.ErrorCode.INVALID_AUTHENTICATION; +import static com.bluedelivery.response.ErrorCode.NOT_AUTHORIZED_ACCESS; import static org.springframework.http.HttpHeaders.AUTHORIZATION; import java.util.Map; @@ -14,9 +14,9 @@ import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.HandlerMapping; -import com.delivery.authentication.Authentication; -import com.delivery.authentication.AuthenticationService; -import com.delivery.exception.ApiException; +import com.bluedelivery.authentication.Authentication; +import com.bluedelivery.authentication.AuthenticationService; +import com.bluedelivery.exception.ApiException; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/delivery/config/resolver/AuthenticatedUserArgumentResolver.java b/src/main/java/com/bluedelivery/config/resolver/AuthenticatedUserArgumentResolver.java similarity index 90% rename from src/main/java/com/delivery/config/resolver/AuthenticatedUserArgumentResolver.java rename to src/main/java/com/bluedelivery/config/resolver/AuthenticatedUserArgumentResolver.java index 25fae911..11494d94 100644 --- a/src/main/java/com/delivery/config/resolver/AuthenticatedUserArgumentResolver.java +++ b/src/main/java/com/bluedelivery/config/resolver/AuthenticatedUserArgumentResolver.java @@ -1,4 +1,4 @@ -package com.delivery.config.resolver; +package com.bluedelivery.config.resolver; import static org.springframework.http.HttpHeaders.AUTHORIZATION; @@ -14,8 +14,8 @@ import org.springframework.web.method.support.HandlerMethodArgumentResolver; import org.springframework.web.method.support.ModelAndViewContainer; -import com.delivery.authentication.Authentication; -import com.delivery.authentication.AuthenticationService; +import com.bluedelivery.authentication.Authentication; +import com.bluedelivery.authentication.AuthenticationService; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/delivery/exception/ApiException.java b/src/main/java/com/bluedelivery/exception/ApiException.java similarity index 76% rename from src/main/java/com/delivery/exception/ApiException.java rename to src/main/java/com/bluedelivery/exception/ApiException.java index 4c90d50f..43f164cf 100644 --- a/src/main/java/com/delivery/exception/ApiException.java +++ b/src/main/java/com/bluedelivery/exception/ApiException.java @@ -1,6 +1,6 @@ -package com.delivery.exception; +package com.bluedelivery.exception; -import com.delivery.response.ErrorCode; +import com.bluedelivery.response.ErrorCode; public class ApiException extends RuntimeException { diff --git a/src/main/java/com/delivery/response/ErrorCode.java b/src/main/java/com/bluedelivery/response/ErrorCode.java similarity index 95% rename from src/main/java/com/delivery/response/ErrorCode.java rename to src/main/java/com/bluedelivery/response/ErrorCode.java index 0f79d0dc..36f035e9 100644 --- a/src/main/java/com/delivery/response/ErrorCode.java +++ b/src/main/java/com/bluedelivery/response/ErrorCode.java @@ -1,6 +1,6 @@ -package com.delivery.response; +package com.bluedelivery.response; -import static com.delivery.response.HttpResponse.*; +import static com.bluedelivery.response.HttpResponse.*; import org.springframework.http.HttpStatus; diff --git a/src/main/java/com/delivery/response/HttpResponse.java b/src/main/java/com/bluedelivery/response/HttpResponse.java similarity index 97% rename from src/main/java/com/delivery/response/HttpResponse.java rename to src/main/java/com/bluedelivery/response/HttpResponse.java index 37fa78a1..81c49185 100644 --- a/src/main/java/com/delivery/response/HttpResponse.java +++ b/src/main/java/com/bluedelivery/response/HttpResponse.java @@ -1,4 +1,4 @@ -package com.delivery.response; +package com.bluedelivery.response; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/main/java/com/delivery/shop/businesshour/BusinessHour.java b/src/main/java/com/bluedelivery/shop/businesshour/BusinessHour.java similarity index 97% rename from src/main/java/com/delivery/shop/businesshour/BusinessHour.java rename to src/main/java/com/bluedelivery/shop/businesshour/BusinessHour.java index 48161e50..0a69413f 100644 --- a/src/main/java/com/delivery/shop/businesshour/BusinessHour.java +++ b/src/main/java/com/bluedelivery/shop/businesshour/BusinessHour.java @@ -1,8 +1,7 @@ -package com.delivery.shop.businesshour; +package com.bluedelivery.shop.businesshour; import java.time.DayOfWeek; -import java.time.LocalDate; import java.time.LocalTime; import java.util.Objects; diff --git a/src/main/java/com/delivery/shop/businesshour/BusinessHourCondition.java b/src/main/java/com/bluedelivery/shop/businesshour/BusinessHourCondition.java similarity index 64% rename from src/main/java/com/delivery/shop/businesshour/BusinessHourCondition.java rename to src/main/java/com/bluedelivery/shop/businesshour/BusinessHourCondition.java index f23521aa..94b3dcd3 100644 --- a/src/main/java/com/delivery/shop/businesshour/BusinessHourCondition.java +++ b/src/main/java/com/bluedelivery/shop/businesshour/BusinessHourCondition.java @@ -1,6 +1,6 @@ -package com.delivery.shop.businesshour; +package com.bluedelivery.shop.businesshour; -import com.delivery.shop.businesshour.UpdateBusinessHoursDto.BusinessHourType; +import com.bluedelivery.shop.businesshour.UpdateBusinessHoursDto.BusinessHourType; public interface BusinessHourCondition { diff --git a/src/main/java/com/delivery/shop/businesshour/BusinessHourConditions.java b/src/main/java/com/bluedelivery/shop/businesshour/BusinessHourConditions.java similarity index 88% rename from src/main/java/com/delivery/shop/businesshour/BusinessHourConditions.java rename to src/main/java/com/bluedelivery/shop/businesshour/BusinessHourConditions.java index 96536737..b11c6b05 100644 --- a/src/main/java/com/delivery/shop/businesshour/BusinessHourConditions.java +++ b/src/main/java/com/bluedelivery/shop/businesshour/BusinessHourConditions.java @@ -1,6 +1,6 @@ -package com.delivery.shop.businesshour; +package com.bluedelivery.shop.businesshour; -import static com.delivery.shop.businesshour.UpdateBusinessHoursDto.*; +import static com.bluedelivery.shop.businesshour.UpdateBusinessHoursDto.*; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/com/delivery/shop/businesshour/BusinessHourMapper.java b/src/main/java/com/bluedelivery/shop/businesshour/BusinessHourMapper.java similarity index 81% rename from src/main/java/com/delivery/shop/businesshour/BusinessHourMapper.java rename to src/main/java/com/bluedelivery/shop/businesshour/BusinessHourMapper.java index e4e03b9c..d45bc088 100644 --- a/src/main/java/com/delivery/shop/businesshour/BusinessHourMapper.java +++ b/src/main/java/com/bluedelivery/shop/businesshour/BusinessHourMapper.java @@ -1,4 +1,4 @@ -package com.delivery.shop.businesshour; +package com.bluedelivery.shop.businesshour; import org.apache.ibatis.annotations.Mapper; diff --git a/src/main/java/com/delivery/shop/businesshour/BusinessHourPolicy.java b/src/main/java/com/bluedelivery/shop/businesshour/BusinessHourPolicy.java similarity index 95% rename from src/main/java/com/delivery/shop/businesshour/BusinessHourPolicy.java rename to src/main/java/com/bluedelivery/shop/businesshour/BusinessHourPolicy.java index 182c0896..d0734e8a 100644 --- a/src/main/java/com/delivery/shop/businesshour/BusinessHourPolicy.java +++ b/src/main/java/com/bluedelivery/shop/businesshour/BusinessHourPolicy.java @@ -1,4 +1,4 @@ -package com.delivery.shop.businesshour; +package com.bluedelivery.shop.businesshour; import java.time.DayOfWeek; import java.time.LocalDateTime; diff --git a/src/main/java/com/delivery/shop/businesshour/BusinessHourRequestParam.java b/src/main/java/com/bluedelivery/shop/businesshour/BusinessHourRequestParam.java similarity index 94% rename from src/main/java/com/delivery/shop/businesshour/BusinessHourRequestParam.java rename to src/main/java/com/bluedelivery/shop/businesshour/BusinessHourRequestParam.java index df5da43a..0daa80f9 100644 --- a/src/main/java/com/delivery/shop/businesshour/BusinessHourRequestParam.java +++ b/src/main/java/com/bluedelivery/shop/businesshour/BusinessHourRequestParam.java @@ -1,4 +1,4 @@ -package com.delivery.shop.businesshour; +package com.bluedelivery.shop.businesshour; import java.time.DayOfWeek; import java.time.LocalTime; diff --git a/src/main/java/com/delivery/shop/businesshour/BusinessHourRequestParams.java b/src/main/java/com/bluedelivery/shop/businesshour/BusinessHourRequestParams.java similarity index 90% rename from src/main/java/com/delivery/shop/businesshour/BusinessHourRequestParams.java rename to src/main/java/com/bluedelivery/shop/businesshour/BusinessHourRequestParams.java index da19f827..c0ec8b44 100644 --- a/src/main/java/com/delivery/shop/businesshour/BusinessHourRequestParams.java +++ b/src/main/java/com/bluedelivery/shop/businesshour/BusinessHourRequestParams.java @@ -1,6 +1,6 @@ -package com.delivery.shop.businesshour; +package com.bluedelivery.shop.businesshour; -import static com.delivery.shop.businesshour.UpdateBusinessHoursDto.*; +import static com.bluedelivery.shop.businesshour.UpdateBusinessHoursDto.*; import java.util.Collections; import java.util.Map; diff --git a/src/main/java/com/delivery/shop/businesshour/EverydayBusinessHourCondition.java b/src/main/java/com/bluedelivery/shop/businesshour/EverydayBusinessHourCondition.java similarity index 86% rename from src/main/java/com/delivery/shop/businesshour/EverydayBusinessHourCondition.java rename to src/main/java/com/bluedelivery/shop/businesshour/EverydayBusinessHourCondition.java index 912b0770..9ca5803b 100644 --- a/src/main/java/com/delivery/shop/businesshour/EverydayBusinessHourCondition.java +++ b/src/main/java/com/bluedelivery/shop/businesshour/EverydayBusinessHourCondition.java @@ -1,6 +1,6 @@ -package com.delivery.shop.businesshour; +package com.bluedelivery.shop.businesshour; -import static com.delivery.shop.businesshour.UpdateBusinessHoursDto.*; +import static com.bluedelivery.shop.businesshour.UpdateBusinessHoursDto.*; import java.time.DayOfWeek; diff --git a/src/main/java/com/delivery/shop/businesshour/UpdateBusinessHoursDto.java b/src/main/java/com/bluedelivery/shop/businesshour/UpdateBusinessHoursDto.java similarity index 95% rename from src/main/java/com/delivery/shop/businesshour/UpdateBusinessHoursDto.java rename to src/main/java/com/bluedelivery/shop/businesshour/UpdateBusinessHoursDto.java index c4651f94..1e710535 100644 --- a/src/main/java/com/delivery/shop/businesshour/UpdateBusinessHoursDto.java +++ b/src/main/java/com/bluedelivery/shop/businesshour/UpdateBusinessHoursDto.java @@ -1,4 +1,4 @@ -package com.delivery.shop.businesshour; +package com.bluedelivery.shop.businesshour; import javax.validation.constraints.NotNull; diff --git a/src/main/java/com/delivery/shop/businesshour/WeekdayWeekendBusinessHourCondition.java b/src/main/java/com/bluedelivery/shop/businesshour/WeekdayWeekendBusinessHourCondition.java similarity index 90% rename from src/main/java/com/delivery/shop/businesshour/WeekdayWeekendBusinessHourCondition.java rename to src/main/java/com/bluedelivery/shop/businesshour/WeekdayWeekendBusinessHourCondition.java index 70f1964a..c2d34111 100644 --- a/src/main/java/com/delivery/shop/businesshour/WeekdayWeekendBusinessHourCondition.java +++ b/src/main/java/com/bluedelivery/shop/businesshour/WeekdayWeekendBusinessHourCondition.java @@ -1,6 +1,6 @@ -package com.delivery.shop.businesshour; +package com.bluedelivery.shop.businesshour; -import static com.delivery.shop.businesshour.UpdateBusinessHoursDto.*; +import static com.bluedelivery.shop.businesshour.UpdateBusinessHoursDto.*; import static java.time.DayOfWeek.*; import java.time.DayOfWeek; diff --git a/src/main/java/com/delivery/shop/category/Categories.java b/src/main/java/com/bluedelivery/shop/category/Categories.java similarity index 92% rename from src/main/java/com/delivery/shop/category/Categories.java rename to src/main/java/com/bluedelivery/shop/category/Categories.java index fd7f92de..607509cf 100644 --- a/src/main/java/com/delivery/shop/category/Categories.java +++ b/src/main/java/com/bluedelivery/shop/category/Categories.java @@ -1,4 +1,4 @@ -package com.delivery.shop.category; +package com.bluedelivery.shop.category; import java.util.Collection; import java.util.Collections; diff --git a/src/main/java/com/delivery/shop/category/Category.java b/src/main/java/com/bluedelivery/shop/category/Category.java similarity index 96% rename from src/main/java/com/delivery/shop/category/Category.java rename to src/main/java/com/bluedelivery/shop/category/Category.java index 67a51b2a..5cd0b7b0 100644 --- a/src/main/java/com/delivery/shop/category/Category.java +++ b/src/main/java/com/bluedelivery/shop/category/Category.java @@ -1,4 +1,4 @@ -package com.delivery.shop.category; +package com.bluedelivery.shop.category; import java.util.Objects; diff --git a/src/main/java/com/delivery/shop/category/CategoryManagerController.java b/src/main/java/com/bluedelivery/shop/category/CategoryManagerController.java similarity index 87% rename from src/main/java/com/delivery/shop/category/CategoryManagerController.java rename to src/main/java/com/bluedelivery/shop/category/CategoryManagerController.java index 6592303b..bfc1b26d 100644 --- a/src/main/java/com/delivery/shop/category/CategoryManagerController.java +++ b/src/main/java/com/bluedelivery/shop/category/CategoryManagerController.java @@ -1,6 +1,6 @@ -package com.delivery.shop.category; +package com.bluedelivery.shop.category; -import static com.delivery.shop.category.CreateCategoryParam.*; +import static com.bluedelivery.shop.category.CreateCategoryParam.*; import java.util.List; @@ -13,8 +13,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; -import com.delivery.response.HttpResponse; -import com.delivery.shop.category.EditCategoryParam.EditCategoryRequest; +import com.bluedelivery.response.HttpResponse; +import com.bluedelivery.shop.category.EditCategoryParam.EditCategoryRequest; @RequestMapping("/categories") public interface CategoryManagerController { diff --git a/src/main/java/com/delivery/shop/category/CategoryManagerControllerImpl.java b/src/main/java/com/bluedelivery/shop/category/CategoryManagerControllerImpl.java similarity index 83% rename from src/main/java/com/delivery/shop/category/CategoryManagerControllerImpl.java rename to src/main/java/com/bluedelivery/shop/category/CategoryManagerControllerImpl.java index bd2db4e2..c5464b36 100644 --- a/src/main/java/com/delivery/shop/category/CategoryManagerControllerImpl.java +++ b/src/main/java/com/bluedelivery/shop/category/CategoryManagerControllerImpl.java @@ -1,7 +1,7 @@ -package com.delivery.shop.category; +package com.bluedelivery.shop.category; -import static com.delivery.response.HttpResponse.response; -import static com.delivery.shop.category.CreateCategoryParam.*; +import static com.bluedelivery.response.HttpResponse.response; +import static com.bluedelivery.shop.category.CreateCategoryParam.*; import java.util.List; @@ -10,10 +10,10 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; -import com.delivery.exception.ApiException; -import com.delivery.response.ErrorCode; -import com.delivery.response.HttpResponse; -import com.delivery.shop.category.EditCategoryParam.EditCategoryRequest; +import com.bluedelivery.exception.ApiException; +import com.bluedelivery.response.ErrorCode; +import com.bluedelivery.response.HttpResponse; +import com.bluedelivery.shop.category.EditCategoryParam.EditCategoryRequest; @RestController public class CategoryManagerControllerImpl implements CategoryManagerController { diff --git a/src/main/java/com/delivery/shop/category/CategoryManagerService.java b/src/main/java/com/bluedelivery/shop/category/CategoryManagerService.java similarity index 96% rename from src/main/java/com/delivery/shop/category/CategoryManagerService.java rename to src/main/java/com/bluedelivery/shop/category/CategoryManagerService.java index 3a515e6e..b33f2000 100644 --- a/src/main/java/com/delivery/shop/category/CategoryManagerService.java +++ b/src/main/java/com/bluedelivery/shop/category/CategoryManagerService.java @@ -1,4 +1,4 @@ -package com.delivery.shop.category; +package com.bluedelivery.shop.category; import java.util.List; diff --git a/src/main/java/com/delivery/shop/category/CategoryManagerServiceHttp.java b/src/main/java/com/bluedelivery/shop/category/CategoryManagerServiceHttp.java similarity index 97% rename from src/main/java/com/delivery/shop/category/CategoryManagerServiceHttp.java rename to src/main/java/com/bluedelivery/shop/category/CategoryManagerServiceHttp.java index 65b1ce39..77603916 100644 --- a/src/main/java/com/delivery/shop/category/CategoryManagerServiceHttp.java +++ b/src/main/java/com/bluedelivery/shop/category/CategoryManagerServiceHttp.java @@ -1,4 +1,4 @@ -package com.delivery.shop.category; +package com.bluedelivery.shop.category; import java.util.List; diff --git a/src/main/java/com/delivery/shop/category/CategoryMapper.java b/src/main/java/com/bluedelivery/shop/category/CategoryMapper.java similarity index 74% rename from src/main/java/com/delivery/shop/category/CategoryMapper.java rename to src/main/java/com/bluedelivery/shop/category/CategoryMapper.java index b0d31ae4..96a9aefe 100644 --- a/src/main/java/com/delivery/shop/category/CategoryMapper.java +++ b/src/main/java/com/bluedelivery/shop/category/CategoryMapper.java @@ -1,4 +1,4 @@ -package com.delivery.shop.category; +package com.bluedelivery.shop.category; import org.apache.ibatis.annotations.Mapper; diff --git a/src/main/java/com/delivery/shop/category/CategoryNotFoundException.java b/src/main/java/com/bluedelivery/shop/category/CategoryNotFoundException.java similarity index 63% rename from src/main/java/com/delivery/shop/category/CategoryNotFoundException.java rename to src/main/java/com/bluedelivery/shop/category/CategoryNotFoundException.java index 37479dba..13dcf9c5 100644 --- a/src/main/java/com/delivery/shop/category/CategoryNotFoundException.java +++ b/src/main/java/com/bluedelivery/shop/category/CategoryNotFoundException.java @@ -1,4 +1,4 @@ -package com.delivery.shop.category; +package com.bluedelivery.shop.category; public class CategoryNotFoundException extends RuntimeException { } diff --git a/src/main/java/com/delivery/shop/category/CategoryRepository.java b/src/main/java/com/bluedelivery/shop/category/CategoryRepository.java similarity index 79% rename from src/main/java/com/delivery/shop/category/CategoryRepository.java rename to src/main/java/com/bluedelivery/shop/category/CategoryRepository.java index 30e26636..d219f567 100644 --- a/src/main/java/com/delivery/shop/category/CategoryRepository.java +++ b/src/main/java/com/bluedelivery/shop/category/CategoryRepository.java @@ -1,12 +1,12 @@ -package com.delivery.shop.category; +package com.bluedelivery.shop.category; import java.util.List; import java.util.Optional; import org.springframework.stereotype.Repository; -import com.delivery.shop.search.SearchShopByCategoryParam; -import com.delivery.shop.shop.Shop; +import com.bluedelivery.shop.search.SearchShopByCategoryParam; +import com.bluedelivery.shop.shop.Shop; @Repository public interface CategoryRepository { diff --git a/src/main/java/com/delivery/shop/category/CreateCategoryParam.java b/src/main/java/com/bluedelivery/shop/category/CreateCategoryParam.java similarity index 88% rename from src/main/java/com/delivery/shop/category/CreateCategoryParam.java rename to src/main/java/com/bluedelivery/shop/category/CreateCategoryParam.java index 8fc9dda0..a4301320 100644 --- a/src/main/java/com/delivery/shop/category/CreateCategoryParam.java +++ b/src/main/java/com/bluedelivery/shop/category/CreateCategoryParam.java @@ -1,8 +1,8 @@ -package com.delivery.shop.category; +package com.bluedelivery.shop.category; import javax.validation.constraints.Pattern; -import com.delivery.utility.RegexConstants; +import com.bluedelivery.utility.RegexConstants; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/src/main/java/com/delivery/shop/category/EditCategoryParam.java b/src/main/java/com/bluedelivery/shop/category/EditCategoryParam.java similarity index 88% rename from src/main/java/com/delivery/shop/category/EditCategoryParam.java rename to src/main/java/com/bluedelivery/shop/category/EditCategoryParam.java index cb813585..16f991ab 100644 --- a/src/main/java/com/delivery/shop/category/EditCategoryParam.java +++ b/src/main/java/com/bluedelivery/shop/category/EditCategoryParam.java @@ -1,8 +1,8 @@ -package com.delivery.shop.category; +package com.bluedelivery.shop.category; import javax.validation.constraints.Pattern; -import com.delivery.utility.RegexConstants; +import com.bluedelivery.utility.RegexConstants; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/delivery/shop/category/GetShopsByCategoryResponse.java b/src/main/java/com/bluedelivery/shop/category/GetShopsByCategoryResponse.java similarity index 79% rename from src/main/java/com/delivery/shop/category/GetShopsByCategoryResponse.java rename to src/main/java/com/bluedelivery/shop/category/GetShopsByCategoryResponse.java index 69b53c0c..57a17512 100644 --- a/src/main/java/com/delivery/shop/category/GetShopsByCategoryResponse.java +++ b/src/main/java/com/bluedelivery/shop/category/GetShopsByCategoryResponse.java @@ -1,8 +1,8 @@ -package com.delivery.shop.category; +package com.bluedelivery.shop.category; import java.util.List; -import com.delivery.shop.search.SearchedShopData; +import com.bluedelivery.shop.search.SearchedShopData; public class GetShopsByCategoryResponse { diff --git a/src/main/java/com/delivery/shop/closingday/ClosingDayPolicies.java b/src/main/java/com/bluedelivery/shop/closingday/ClosingDayPolicies.java similarity index 94% rename from src/main/java/com/delivery/shop/closingday/ClosingDayPolicies.java rename to src/main/java/com/bluedelivery/shop/closingday/ClosingDayPolicies.java index 5bf68645..6a9c00ca 100644 --- a/src/main/java/com/delivery/shop/closingday/ClosingDayPolicies.java +++ b/src/main/java/com/bluedelivery/shop/closingday/ClosingDayPolicies.java @@ -1,4 +1,4 @@ -package com.delivery.shop.closingday; +package com.bluedelivery.shop.closingday; import java.time.LocalDate; import java.util.ArrayList; diff --git a/src/main/java/com/delivery/shop/closingday/ClosingDayPolicy.java b/src/main/java/com/bluedelivery/shop/closingday/ClosingDayPolicy.java similarity index 90% rename from src/main/java/com/delivery/shop/closingday/ClosingDayPolicy.java rename to src/main/java/com/bluedelivery/shop/closingday/ClosingDayPolicy.java index cb651899..ed789d7e 100644 --- a/src/main/java/com/delivery/shop/closingday/ClosingDayPolicy.java +++ b/src/main/java/com/bluedelivery/shop/closingday/ClosingDayPolicy.java @@ -1,4 +1,4 @@ -package com.delivery.shop.closingday; +package com.bluedelivery.shop.closingday; import java.time.LocalDate; diff --git a/src/main/java/com/delivery/shop/closingday/CyclicRegularClosing.java b/src/main/java/com/bluedelivery/shop/closingday/CyclicRegularClosing.java similarity index 98% rename from src/main/java/com/delivery/shop/closingday/CyclicRegularClosing.java rename to src/main/java/com/bluedelivery/shop/closingday/CyclicRegularClosing.java index 9e68d594..872aa87b 100644 --- a/src/main/java/com/delivery/shop/closingday/CyclicRegularClosing.java +++ b/src/main/java/com/bluedelivery/shop/closingday/CyclicRegularClosing.java @@ -1,4 +1,4 @@ -package com.delivery.shop.closingday; +package com.bluedelivery.shop.closingday; import java.time.DayOfWeek; import java.time.LocalDate; diff --git a/src/main/java/com/delivery/shop/closingday/LegalHoliday.java b/src/main/java/com/bluedelivery/shop/closingday/LegalHoliday.java similarity index 96% rename from src/main/java/com/delivery/shop/closingday/LegalHoliday.java rename to src/main/java/com/bluedelivery/shop/closingday/LegalHoliday.java index 3b72ae9e..51b34d4a 100644 --- a/src/main/java/com/delivery/shop/closingday/LegalHoliday.java +++ b/src/main/java/com/bluedelivery/shop/closingday/LegalHoliday.java @@ -1,7 +1,7 @@ -package com.delivery.shop.closingday; +package com.bluedelivery.shop.closingday; -import static com.delivery.shop.closingday.LegalHoliday.CalendarType.LUNAR; -import static com.delivery.shop.closingday.LegalHoliday.CalendarType.SOLAR; +import static com.bluedelivery.shop.closingday.LegalHoliday.CalendarType.LUNAR; +import static com.bluedelivery.shop.closingday.LegalHoliday.CalendarType.SOLAR; import java.time.DayOfWeek; import java.time.LocalDate; diff --git a/src/main/java/com/delivery/shop/closingday/LegalHolidayClosing.java b/src/main/java/com/bluedelivery/shop/closingday/LegalHolidayClosing.java similarity index 96% rename from src/main/java/com/delivery/shop/closingday/LegalHolidayClosing.java rename to src/main/java/com/bluedelivery/shop/closingday/LegalHolidayClosing.java index f2380938..389cd0df 100644 --- a/src/main/java/com/delivery/shop/closingday/LegalHolidayClosing.java +++ b/src/main/java/com/bluedelivery/shop/closingday/LegalHolidayClosing.java @@ -1,4 +1,4 @@ -package com.delivery.shop.closingday; +package com.bluedelivery.shop.closingday; import java.time.LocalDate; import java.time.Year; diff --git a/src/main/java/com/delivery/shop/closingday/RegularClosingDay.java b/src/main/java/com/bluedelivery/shop/closingday/RegularClosingDay.java similarity index 86% rename from src/main/java/com/delivery/shop/closingday/RegularClosingDay.java rename to src/main/java/com/bluedelivery/shop/closingday/RegularClosingDay.java index 64f37728..67928bcb 100644 --- a/src/main/java/com/delivery/shop/closingday/RegularClosingDay.java +++ b/src/main/java/com/bluedelivery/shop/closingday/RegularClosingDay.java @@ -1,4 +1,4 @@ -package com.delivery.shop.closingday; +package com.bluedelivery.shop.closingday; /** * 매주 쉬는 휴무일 일정한 주기가 존재하는 휴무일을 자식클래스로 따로 관리하고 diff --git a/src/main/java/com/delivery/shop/closingday/TemporaryClosing.java b/src/main/java/com/bluedelivery/shop/closingday/TemporaryClosing.java similarity index 97% rename from src/main/java/com/delivery/shop/closingday/TemporaryClosing.java rename to src/main/java/com/bluedelivery/shop/closingday/TemporaryClosing.java index f316dc10..6896da6d 100644 --- a/src/main/java/com/delivery/shop/closingday/TemporaryClosing.java +++ b/src/main/java/com/bluedelivery/shop/closingday/TemporaryClosing.java @@ -1,4 +1,4 @@ -package com.delivery.shop.closingday; +package com.bluedelivery.shop.closingday; import java.time.LocalDate; diff --git a/src/main/java/com/delivery/shop/closingday/WeeklyRegularClosing.java b/src/main/java/com/bluedelivery/shop/closingday/WeeklyRegularClosing.java similarity index 95% rename from src/main/java/com/delivery/shop/closingday/WeeklyRegularClosing.java rename to src/main/java/com/bluedelivery/shop/closingday/WeeklyRegularClosing.java index 2274a315..7aa6218f 100644 --- a/src/main/java/com/delivery/shop/closingday/WeeklyRegularClosing.java +++ b/src/main/java/com/bluedelivery/shop/closingday/WeeklyRegularClosing.java @@ -1,4 +1,4 @@ -package com.delivery.shop.closingday; +package com.bluedelivery.shop.closingday; import java.time.DayOfWeek; import java.time.LocalDate; diff --git a/src/main/java/com/delivery/shop/closingday/YearlyLegalHolidays.java b/src/main/java/com/bluedelivery/shop/closingday/YearlyLegalHolidays.java similarity index 95% rename from src/main/java/com/delivery/shop/closingday/YearlyLegalHolidays.java rename to src/main/java/com/bluedelivery/shop/closingday/YearlyLegalHolidays.java index bf90d518..0df16920 100644 --- a/src/main/java/com/delivery/shop/closingday/YearlyLegalHolidays.java +++ b/src/main/java/com/bluedelivery/shop/closingday/YearlyLegalHolidays.java @@ -1,4 +1,4 @@ -package com.delivery.shop.closingday; +package com.bluedelivery.shop.closingday; import java.time.LocalDate; import java.time.Year; diff --git a/src/main/java/com/delivery/shop/menu/Menu.java b/src/main/java/com/bluedelivery/shop/menu/Menu.java similarity index 98% rename from src/main/java/com/delivery/shop/menu/Menu.java rename to src/main/java/com/bluedelivery/shop/menu/Menu.java index cce35a7c..c622973b 100644 --- a/src/main/java/com/delivery/shop/menu/Menu.java +++ b/src/main/java/com/bluedelivery/shop/menu/Menu.java @@ -1,4 +1,4 @@ -package com.delivery.shop.menu; +package com.bluedelivery.shop.menu; import java.util.List; import java.util.Objects; diff --git a/src/main/java/com/delivery/shop/menu/MenuController.java b/src/main/java/com/bluedelivery/shop/menu/MenuController.java similarity index 95% rename from src/main/java/com/delivery/shop/menu/MenuController.java rename to src/main/java/com/bluedelivery/shop/menu/MenuController.java index 56b0c647..91e9f32d 100644 --- a/src/main/java/com/delivery/shop/menu/MenuController.java +++ b/src/main/java/com/bluedelivery/shop/menu/MenuController.java @@ -1,6 +1,6 @@ -package com.delivery.shop.menu; +package com.bluedelivery.shop.menu; -import static com.delivery.response.HttpResponse.*; +import static com.bluedelivery.response.HttpResponse.*; import javax.validation.Valid; @@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import com.delivery.response.HttpResponse; +import com.bluedelivery.response.HttpResponse; @RestController @RequestMapping("/menu-groups") diff --git a/src/main/java/com/delivery/shop/menu/MenuGroup.java b/src/main/java/com/bluedelivery/shop/menu/MenuGroup.java similarity index 95% rename from src/main/java/com/delivery/shop/menu/MenuGroup.java rename to src/main/java/com/bluedelivery/shop/menu/MenuGroup.java index 620f8a39..a995d0fd 100644 --- a/src/main/java/com/delivery/shop/menu/MenuGroup.java +++ b/src/main/java/com/bluedelivery/shop/menu/MenuGroup.java @@ -1,4 +1,4 @@ -package com.delivery.shop.menu; +package com.bluedelivery.shop.menu; import java.util.List; diff --git a/src/main/java/com/delivery/shop/menu/MenuGroupController.java b/src/main/java/com/bluedelivery/shop/menu/MenuGroupController.java similarity index 95% rename from src/main/java/com/delivery/shop/menu/MenuGroupController.java rename to src/main/java/com/bluedelivery/shop/menu/MenuGroupController.java index 0e4a5f85..3fdd143e 100644 --- a/src/main/java/com/delivery/shop/menu/MenuGroupController.java +++ b/src/main/java/com/bluedelivery/shop/menu/MenuGroupController.java @@ -1,4 +1,4 @@ -package com.delivery.shop.menu; +package com.bluedelivery.shop.menu; import java.util.List; @@ -14,8 +14,8 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import com.delivery.exception.ApiException; -import com.delivery.response.ErrorCode; +import com.bluedelivery.exception.ApiException; +import com.bluedelivery.response.ErrorCode; @RestController @RequestMapping("/shops") diff --git a/src/main/java/com/delivery/shop/menu/MenuGroupDto.java b/src/main/java/com/bluedelivery/shop/menu/MenuGroupDto.java similarity index 97% rename from src/main/java/com/delivery/shop/menu/MenuGroupDto.java rename to src/main/java/com/bluedelivery/shop/menu/MenuGroupDto.java index 0bef1733..d3b85931 100644 --- a/src/main/java/com/delivery/shop/menu/MenuGroupDto.java +++ b/src/main/java/com/bluedelivery/shop/menu/MenuGroupDto.java @@ -1,4 +1,4 @@ -package com.delivery.shop.menu; +package com.bluedelivery.shop.menu; import java.util.List; diff --git a/src/main/java/com/delivery/shop/menu/MenuGroupMapper.java b/src/main/java/com/bluedelivery/shop/menu/MenuGroupMapper.java similarity index 92% rename from src/main/java/com/delivery/shop/menu/MenuGroupMapper.java rename to src/main/java/com/bluedelivery/shop/menu/MenuGroupMapper.java index 0ac91aa2..154b9a0e 100644 --- a/src/main/java/com/delivery/shop/menu/MenuGroupMapper.java +++ b/src/main/java/com/bluedelivery/shop/menu/MenuGroupMapper.java @@ -1,4 +1,4 @@ -package com.delivery.shop.menu; +package com.bluedelivery.shop.menu; import java.util.List; diff --git a/src/main/java/com/delivery/shop/menu/MenuGroupService.java b/src/main/java/com/bluedelivery/shop/menu/MenuGroupService.java similarity index 96% rename from src/main/java/com/delivery/shop/menu/MenuGroupService.java rename to src/main/java/com/bluedelivery/shop/menu/MenuGroupService.java index df54610b..78947e11 100644 --- a/src/main/java/com/delivery/shop/menu/MenuGroupService.java +++ b/src/main/java/com/bluedelivery/shop/menu/MenuGroupService.java @@ -1,4 +1,4 @@ -package com.delivery.shop.menu; +package com.bluedelivery.shop.menu; import java.util.List; diff --git a/src/main/java/com/delivery/shop/menu/MenuMapper.java b/src/main/java/com/bluedelivery/shop/menu/MenuMapper.java similarity index 84% rename from src/main/java/com/delivery/shop/menu/MenuMapper.java rename to src/main/java/com/bluedelivery/shop/menu/MenuMapper.java index 42e5fd76..fe1209cb 100644 --- a/src/main/java/com/delivery/shop/menu/MenuMapper.java +++ b/src/main/java/com/bluedelivery/shop/menu/MenuMapper.java @@ -1,6 +1,6 @@ -package com.delivery.shop.menu; +package com.bluedelivery.shop.menu; -import static com.delivery.shop.menu.Menu.*; +import static com.bluedelivery.shop.menu.Menu.*; import java.util.List; diff --git a/src/main/java/com/delivery/shop/menu/MenuOption.java b/src/main/java/com/bluedelivery/shop/menu/MenuOption.java similarity index 97% rename from src/main/java/com/delivery/shop/menu/MenuOption.java rename to src/main/java/com/bluedelivery/shop/menu/MenuOption.java index 18d8a1e8..dd57c1e8 100644 --- a/src/main/java/com/delivery/shop/menu/MenuOption.java +++ b/src/main/java/com/bluedelivery/shop/menu/MenuOption.java @@ -1,4 +1,4 @@ -package com.delivery.shop.menu; +package com.bluedelivery.shop.menu; import java.util.Objects; diff --git a/src/main/java/com/delivery/shop/menu/MenuOptionController.java b/src/main/java/com/bluedelivery/shop/menu/MenuOptionController.java similarity index 78% rename from src/main/java/com/delivery/shop/menu/MenuOptionController.java rename to src/main/java/com/bluedelivery/shop/menu/MenuOptionController.java index 2f43d264..30c99d16 100644 --- a/src/main/java/com/delivery/shop/menu/MenuOptionController.java +++ b/src/main/java/com/bluedelivery/shop/menu/MenuOptionController.java @@ -1,8 +1,8 @@ -package com.delivery.shop.menu; +package com.bluedelivery.shop.menu; import org.springframework.http.ResponseEntity; -import com.delivery.response.HttpResponse; +import com.bluedelivery.response.HttpResponse; public interface MenuOptionController { diff --git a/src/main/java/com/delivery/shop/menu/MenuOptionControllerImpl.java b/src/main/java/com/bluedelivery/shop/menu/MenuOptionControllerImpl.java similarity index 95% rename from src/main/java/com/delivery/shop/menu/MenuOptionControllerImpl.java rename to src/main/java/com/bluedelivery/shop/menu/MenuOptionControllerImpl.java index b69837b5..bff4749e 100644 --- a/src/main/java/com/delivery/shop/menu/MenuOptionControllerImpl.java +++ b/src/main/java/com/bluedelivery/shop/menu/MenuOptionControllerImpl.java @@ -1,4 +1,4 @@ -package com.delivery.shop.menu; +package com.bluedelivery.shop.menu; import javax.validation.Valid; @@ -9,7 +9,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; -import com.delivery.response.HttpResponse; +import com.bluedelivery.response.HttpResponse; @RestController public class MenuOptionControllerImpl implements MenuOptionController { diff --git a/src/main/java/com/delivery/shop/menu/MenuOptionDto.java b/src/main/java/com/bluedelivery/shop/menu/MenuOptionDto.java similarity index 96% rename from src/main/java/com/delivery/shop/menu/MenuOptionDto.java rename to src/main/java/com/bluedelivery/shop/menu/MenuOptionDto.java index 90f95c1d..be492fa5 100644 --- a/src/main/java/com/delivery/shop/menu/MenuOptionDto.java +++ b/src/main/java/com/bluedelivery/shop/menu/MenuOptionDto.java @@ -1,4 +1,4 @@ -package com.delivery.shop.menu; +package com.bluedelivery.shop.menu; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; diff --git a/src/main/java/com/delivery/shop/menu/MenuOptionGroup.java b/src/main/java/com/bluedelivery/shop/menu/MenuOptionGroup.java similarity index 98% rename from src/main/java/com/delivery/shop/menu/MenuOptionGroup.java rename to src/main/java/com/bluedelivery/shop/menu/MenuOptionGroup.java index c587973c..afb9cef9 100644 --- a/src/main/java/com/delivery/shop/menu/MenuOptionGroup.java +++ b/src/main/java/com/bluedelivery/shop/menu/MenuOptionGroup.java @@ -1,4 +1,4 @@ -package com.delivery.shop.menu; +package com.bluedelivery.shop.menu; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/com/delivery/shop/menu/MenuOptionGroupDto.java b/src/main/java/com/bluedelivery/shop/menu/MenuOptionGroupDto.java similarity index 97% rename from src/main/java/com/delivery/shop/menu/MenuOptionGroupDto.java rename to src/main/java/com/bluedelivery/shop/menu/MenuOptionGroupDto.java index f9d9a574..5320562e 100644 --- a/src/main/java/com/delivery/shop/menu/MenuOptionGroupDto.java +++ b/src/main/java/com/bluedelivery/shop/menu/MenuOptionGroupDto.java @@ -1,4 +1,4 @@ -package com.delivery.shop.menu; +package com.bluedelivery.shop.menu; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/com/delivery/shop/menu/MenuOptionGroupRepository.java b/src/main/java/com/bluedelivery/shop/menu/MenuOptionGroupRepository.java similarity index 81% rename from src/main/java/com/delivery/shop/menu/MenuOptionGroupRepository.java rename to src/main/java/com/bluedelivery/shop/menu/MenuOptionGroupRepository.java index 583d0c9e..81f6abb0 100644 --- a/src/main/java/com/delivery/shop/menu/MenuOptionGroupRepository.java +++ b/src/main/java/com/bluedelivery/shop/menu/MenuOptionGroupRepository.java @@ -1,4 +1,4 @@ -package com.delivery.shop.menu; +package com.bluedelivery.shop.menu; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/src/main/java/com/delivery/shop/menu/MenuOptionRepository.java b/src/main/java/com/bluedelivery/shop/menu/MenuOptionRepository.java similarity index 80% rename from src/main/java/com/delivery/shop/menu/MenuOptionRepository.java rename to src/main/java/com/bluedelivery/shop/menu/MenuOptionRepository.java index ffea2aed..5c823bb3 100644 --- a/src/main/java/com/delivery/shop/menu/MenuOptionRepository.java +++ b/src/main/java/com/bluedelivery/shop/menu/MenuOptionRepository.java @@ -1,4 +1,4 @@ -package com.delivery.shop.menu; +package com.bluedelivery.shop.menu; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/src/main/java/com/delivery/shop/menu/MenuOptionService.java b/src/main/java/com/bluedelivery/shop/menu/MenuOptionService.java similarity index 80% rename from src/main/java/com/delivery/shop/menu/MenuOptionService.java rename to src/main/java/com/bluedelivery/shop/menu/MenuOptionService.java index 0e88cba3..9af379a8 100644 --- a/src/main/java/com/delivery/shop/menu/MenuOptionService.java +++ b/src/main/java/com/bluedelivery/shop/menu/MenuOptionService.java @@ -1,4 +1,4 @@ -package com.delivery.shop.menu; +package com.bluedelivery.shop.menu; public interface MenuOptionService { diff --git a/src/main/java/com/delivery/shop/menu/MenuOptionServiceImpl.java b/src/main/java/com/bluedelivery/shop/menu/MenuOptionServiceImpl.java similarity index 90% rename from src/main/java/com/delivery/shop/menu/MenuOptionServiceImpl.java rename to src/main/java/com/bluedelivery/shop/menu/MenuOptionServiceImpl.java index eea24e3a..6e06d578 100644 --- a/src/main/java/com/delivery/shop/menu/MenuOptionServiceImpl.java +++ b/src/main/java/com/bluedelivery/shop/menu/MenuOptionServiceImpl.java @@ -1,11 +1,11 @@ -package com.delivery.shop.menu; +package com.bluedelivery.shop.menu; import java.util.Optional; import org.springframework.stereotype.Service; -import com.delivery.exception.ApiException; -import com.delivery.response.ErrorCode; +import com.bluedelivery.exception.ApiException; +import com.bluedelivery.response.ErrorCode; @Service public class MenuOptionServiceImpl implements MenuOptionService { diff --git a/src/main/java/com/delivery/shop/menu/MenuService.java b/src/main/java/com/bluedelivery/shop/menu/MenuService.java similarity index 84% rename from src/main/java/com/delivery/shop/menu/MenuService.java rename to src/main/java/com/bluedelivery/shop/menu/MenuService.java index 84120b1a..60ba1031 100644 --- a/src/main/java/com/delivery/shop/menu/MenuService.java +++ b/src/main/java/com/bluedelivery/shop/menu/MenuService.java @@ -1,11 +1,11 @@ -package com.delivery.shop.menu; +package com.bluedelivery.shop.menu; -import static com.delivery.response.ErrorCode.*; -import static com.delivery.shop.menu.Menu.*; +import static com.bluedelivery.response.ErrorCode.*; +import static com.bluedelivery.shop.menu.Menu.*; import org.springframework.stereotype.Service; -import com.delivery.exception.ApiException; +import com.bluedelivery.exception.ApiException; @Service public class MenuService { diff --git a/src/main/java/com/delivery/shop/menu/RegisterMenuDto.java b/src/main/java/com/bluedelivery/shop/menu/RegisterMenuDto.java similarity index 96% rename from src/main/java/com/delivery/shop/menu/RegisterMenuDto.java rename to src/main/java/com/bluedelivery/shop/menu/RegisterMenuDto.java index 463fb952..0f4df64d 100644 --- a/src/main/java/com/delivery/shop/menu/RegisterMenuDto.java +++ b/src/main/java/com/bluedelivery/shop/menu/RegisterMenuDto.java @@ -1,6 +1,6 @@ -package com.delivery.shop.menu; +package com.bluedelivery.shop.menu; -import static com.delivery.shop.menu.Menu.*; +import static com.bluedelivery.shop.menu.Menu.*; import java.util.List; diff --git a/src/main/java/com/delivery/shop/menu/UpdateMenuDto.java b/src/main/java/com/bluedelivery/shop/menu/UpdateMenuDto.java similarity index 94% rename from src/main/java/com/delivery/shop/menu/UpdateMenuDto.java rename to src/main/java/com/bluedelivery/shop/menu/UpdateMenuDto.java index 376b17ec..50caae36 100644 --- a/src/main/java/com/delivery/shop/menu/UpdateMenuDto.java +++ b/src/main/java/com/bluedelivery/shop/menu/UpdateMenuDto.java @@ -1,8 +1,8 @@ -package com.delivery.shop.menu; +package com.bluedelivery.shop.menu; import javax.validation.constraints.NotNull; -import com.delivery.shop.menu.Menu.MenuStatus; +import com.bluedelivery.shop.menu.Menu.MenuStatus; import com.fasterxml.jackson.annotation.JsonInclude; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/src/main/java/com/delivery/shop/search/SearchShopByCategoryParam.java b/src/main/java/com/bluedelivery/shop/search/SearchShopByCategoryParam.java similarity index 92% rename from src/main/java/com/delivery/shop/search/SearchShopByCategoryParam.java rename to src/main/java/com/bluedelivery/shop/search/SearchShopByCategoryParam.java index 8304ba2e..3da68b3f 100644 --- a/src/main/java/com/delivery/shop/search/SearchShopByCategoryParam.java +++ b/src/main/java/com/bluedelivery/shop/search/SearchShopByCategoryParam.java @@ -1,4 +1,4 @@ -package com.delivery.shop.search; +package com.bluedelivery.shop.search; import java.time.DayOfWeek; import java.time.LocalDateTime; diff --git a/src/main/java/com/delivery/shop/search/SearchedShopData.java b/src/main/java/com/bluedelivery/shop/search/SearchedShopData.java similarity index 94% rename from src/main/java/com/delivery/shop/search/SearchedShopData.java rename to src/main/java/com/bluedelivery/shop/search/SearchedShopData.java index 435514a3..a130627b 100644 --- a/src/main/java/com/delivery/shop/search/SearchedShopData.java +++ b/src/main/java/com/bluedelivery/shop/search/SearchedShopData.java @@ -1,4 +1,4 @@ -package com.delivery.shop.search; +package com.bluedelivery.shop.search; // TODO 나중에 대표메뉴 조회결과, 평점, 배달소요시간, 최소주문, 배달팁 정보 등등 추가되어야 함 public class SearchedShopData { diff --git a/src/main/java/com/delivery/shop/search/ShopExposeController.java b/src/main/java/com/bluedelivery/shop/search/ShopExposeController.java similarity index 87% rename from src/main/java/com/delivery/shop/search/ShopExposeController.java rename to src/main/java/com/bluedelivery/shop/search/ShopExposeController.java index 1120e802..21c34407 100644 --- a/src/main/java/com/delivery/shop/search/ShopExposeController.java +++ b/src/main/java/com/bluedelivery/shop/search/ShopExposeController.java @@ -1,10 +1,10 @@ -package com.delivery.shop.search; +package com.bluedelivery.shop.search; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; -import com.delivery.shop.category.GetShopsByCategoryResponse; +import com.bluedelivery.shop.category.GetShopsByCategoryResponse; public interface ShopExposeController { diff --git a/src/main/java/com/delivery/shop/search/ShopExposeHttpController.java b/src/main/java/com/bluedelivery/shop/search/ShopExposeHttpController.java similarity index 90% rename from src/main/java/com/delivery/shop/search/ShopExposeHttpController.java rename to src/main/java/com/bluedelivery/shop/search/ShopExposeHttpController.java index 05ebaeac..3000f634 100644 --- a/src/main/java/com/delivery/shop/search/ShopExposeHttpController.java +++ b/src/main/java/com/bluedelivery/shop/search/ShopExposeHttpController.java @@ -1,4 +1,4 @@ -package com.delivery.shop.search; +package com.bluedelivery.shop.search; import java.time.LocalDateTime; import java.util.List; @@ -10,8 +10,8 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RestController; -import com.delivery.shop.category.GetShopsByCategoryResponse; -import com.delivery.shop.shop.Shop; +import com.bluedelivery.shop.category.GetShopsByCategoryResponse; +import com.bluedelivery.shop.shop.Shop; @RestController public class ShopExposeHttpController implements ShopExposeController { diff --git a/src/main/java/com/delivery/shop/search/ShopExposeService.java b/src/main/java/com/bluedelivery/shop/search/ShopExposeService.java similarity index 63% rename from src/main/java/com/delivery/shop/search/ShopExposeService.java rename to src/main/java/com/bluedelivery/shop/search/ShopExposeService.java index 92c1bb20..7ae985ec 100644 --- a/src/main/java/com/delivery/shop/search/ShopExposeService.java +++ b/src/main/java/com/bluedelivery/shop/search/ShopExposeService.java @@ -1,8 +1,8 @@ -package com.delivery.shop.search; +package com.bluedelivery.shop.search; import java.util.List; -import com.delivery.shop.shop.Shop; +import com.bluedelivery.shop.shop.Shop; public interface ShopExposeService { List getShopsByCategory(SearchShopByCategoryParam param); diff --git a/src/main/java/com/delivery/shop/search/ShopExposeServiceImpl.java b/src/main/java/com/bluedelivery/shop/search/ShopExposeServiceImpl.java similarity index 89% rename from src/main/java/com/delivery/shop/search/ShopExposeServiceImpl.java rename to src/main/java/com/bluedelivery/shop/search/ShopExposeServiceImpl.java index 585bb2ff..8d2fd58d 100644 --- a/src/main/java/com/delivery/shop/search/ShopExposeServiceImpl.java +++ b/src/main/java/com/bluedelivery/shop/search/ShopExposeServiceImpl.java @@ -1,4 +1,4 @@ -package com.delivery.shop.search; +package com.bluedelivery.shop.search; import static java.lang.Boolean.compare; import static java.util.stream.Collectors.toList; @@ -8,8 +8,8 @@ import org.springframework.stereotype.Service; -import com.delivery.shop.category.CategoryRepository; -import com.delivery.shop.shop.Shop; +import com.bluedelivery.shop.category.CategoryRepository; +import com.bluedelivery.shop.shop.Shop; @Service public class ShopExposeServiceImpl implements ShopExposeService { diff --git a/src/main/java/com/delivery/shop/shop/EditPhoneRequest.java b/src/main/java/com/bluedelivery/shop/shop/EditPhoneRequest.java similarity index 86% rename from src/main/java/com/delivery/shop/shop/EditPhoneRequest.java rename to src/main/java/com/bluedelivery/shop/shop/EditPhoneRequest.java index a468ff7a..de0a5659 100644 --- a/src/main/java/com/delivery/shop/shop/EditPhoneRequest.java +++ b/src/main/java/com/bluedelivery/shop/shop/EditPhoneRequest.java @@ -1,9 +1,9 @@ -package com.delivery.shop.shop; +package com.bluedelivery.shop.shop; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Pattern; -import com.delivery.utility.RegexConstants; +import com.bluedelivery.utility.RegexConstants; public class EditPhoneRequest { @Pattern(regexp = RegexConstants.SHOP_PHONE, message = "잘못된 번호 형식") diff --git a/src/main/java/com/delivery/shop/shop/RegularClosingParam.java b/src/main/java/com/bluedelivery/shop/shop/RegularClosingParam.java similarity index 82% rename from src/main/java/com/delivery/shop/shop/RegularClosingParam.java rename to src/main/java/com/bluedelivery/shop/shop/RegularClosingParam.java index ecda1be9..d513e9d3 100644 --- a/src/main/java/com/delivery/shop/shop/RegularClosingParam.java +++ b/src/main/java/com/bluedelivery/shop/shop/RegularClosingParam.java @@ -1,10 +1,10 @@ -package com.delivery.shop.shop; +package com.bluedelivery.shop.shop; import java.time.DayOfWeek; -import com.delivery.shop.closingday.CyclicRegularClosing; -import com.delivery.shop.closingday.RegularClosingDay; -import com.delivery.shop.closingday.WeeklyRegularClosing; +import com.bluedelivery.shop.closingday.CyclicRegularClosing; +import com.bluedelivery.shop.closingday.RegularClosingDay; +import com.bluedelivery.shop.closingday.WeeklyRegularClosing; import lombok.NoArgsConstructor; diff --git a/src/main/java/com/delivery/shop/shop/SearchMenuService.java b/src/main/java/com/bluedelivery/shop/shop/SearchMenuService.java similarity index 85% rename from src/main/java/com/delivery/shop/shop/SearchMenuService.java rename to src/main/java/com/bluedelivery/shop/shop/SearchMenuService.java index 76a67d8f..4de120c0 100644 --- a/src/main/java/com/delivery/shop/shop/SearchMenuService.java +++ b/src/main/java/com/bluedelivery/shop/shop/SearchMenuService.java @@ -1,11 +1,11 @@ -package com.delivery.shop.shop; +package com.bluedelivery.shop.shop; import java.util.List; import org.springframework.stereotype.Service; -import com.delivery.shop.menu.Menu; -import com.delivery.shop.menu.MenuMapper; +import com.bluedelivery.shop.menu.Menu; +import com.bluedelivery.shop.menu.MenuMapper; @Service public class SearchMenuService { diff --git a/src/main/java/com/delivery/shop/shop/Shop.java b/src/main/java/com/bluedelivery/shop/shop/Shop.java similarity index 87% rename from src/main/java/com/delivery/shop/shop/Shop.java rename to src/main/java/com/bluedelivery/shop/shop/Shop.java index 67af100a..7a7a82e2 100644 --- a/src/main/java/com/delivery/shop/shop/Shop.java +++ b/src/main/java/com/bluedelivery/shop/shop/Shop.java @@ -1,15 +1,15 @@ -package com.delivery.shop.shop; +package com.bluedelivery.shop.shop; import java.time.LocalDate; import java.time.LocalDateTime; import java.util.List; -import com.delivery.shop.businesshour.BusinessHourPolicy; -import com.delivery.shop.category.Categories; -import com.delivery.shop.category.Category; -import com.delivery.shop.closingday.ClosingDayPolicies; -import com.delivery.shop.closingday.ClosingDayPolicy; -import com.delivery.shop.suspension.Suspension; +import com.bluedelivery.shop.businesshour.BusinessHourPolicy; +import com.bluedelivery.shop.category.Categories; +import com.bluedelivery.shop.category.Category; +import com.bluedelivery.shop.closingday.ClosingDayPolicies; +import com.bluedelivery.shop.closingday.ClosingDayPolicy; +import com.bluedelivery.shop.suspension.Suspension; public class Shop { private Long id; diff --git a/src/main/java/com/delivery/shop/shop/ShopMapper.java b/src/main/java/com/bluedelivery/shop/shop/ShopMapper.java similarity index 75% rename from src/main/java/com/delivery/shop/shop/ShopMapper.java rename to src/main/java/com/bluedelivery/shop/shop/ShopMapper.java index 31387437..ab6ea5c0 100644 --- a/src/main/java/com/delivery/shop/shop/ShopMapper.java +++ b/src/main/java/com/bluedelivery/shop/shop/ShopMapper.java @@ -1,4 +1,4 @@ -package com.delivery.shop.shop; +package com.bluedelivery.shop.shop; import org.apache.ibatis.annotations.Mapper; diff --git a/src/main/java/com/delivery/shop/shop/ShopRepository.java b/src/main/java/com/bluedelivery/shop/shop/ShopRepository.java similarity index 94% rename from src/main/java/com/delivery/shop/shop/ShopRepository.java rename to src/main/java/com/bluedelivery/shop/shop/ShopRepository.java index 8119b53e..fabfbb70 100644 --- a/src/main/java/com/delivery/shop/shop/ShopRepository.java +++ b/src/main/java/com/bluedelivery/shop/shop/ShopRepository.java @@ -1,4 +1,4 @@ -package com.delivery.shop.shop; +package com.bluedelivery.shop.shop; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/delivery/shop/shop/ShopUpdateController.java b/src/main/java/com/bluedelivery/shop/shop/ShopUpdateController.java similarity index 92% rename from src/main/java/com/delivery/shop/shop/ShopUpdateController.java rename to src/main/java/com/bluedelivery/shop/shop/ShopUpdateController.java index 02dd7d23..1a61dd82 100644 --- a/src/main/java/com/delivery/shop/shop/ShopUpdateController.java +++ b/src/main/java/com/bluedelivery/shop/shop/ShopUpdateController.java @@ -1,4 +1,4 @@ -package com.delivery.shop.shop; +package com.bluedelivery.shop.shop; import javax.validation.Valid; @@ -10,9 +10,9 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; -import com.delivery.response.HttpResponse; -import com.delivery.shop.businesshour.UpdateBusinessHoursDto; -import com.delivery.shop.suspension.SuspensionRequest; +import com.bluedelivery.response.HttpResponse; +import com.bluedelivery.shop.businesshour.UpdateBusinessHoursDto; +import com.bluedelivery.shop.suspension.SuspensionRequest; @RequestMapping("/shops/{id}") public interface ShopUpdateController { diff --git a/src/main/java/com/delivery/shop/shop/ShopUpdateControllerImpl.java b/src/main/java/com/bluedelivery/shop/shop/ShopUpdateControllerImpl.java similarity index 83% rename from src/main/java/com/delivery/shop/shop/ShopUpdateControllerImpl.java rename to src/main/java/com/bluedelivery/shop/shop/ShopUpdateControllerImpl.java index 847f8656..022d3161 100644 --- a/src/main/java/com/delivery/shop/shop/ShopUpdateControllerImpl.java +++ b/src/main/java/com/bluedelivery/shop/shop/ShopUpdateControllerImpl.java @@ -1,14 +1,14 @@ -package com.delivery.shop.shop; +package com.bluedelivery.shop.shop; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; -import com.delivery.exception.ApiException; -import com.delivery.response.ErrorCode; -import com.delivery.response.HttpResponse; -import com.delivery.shop.businesshour.UpdateBusinessHoursDto; -import com.delivery.shop.category.CategoryNotFoundException; -import com.delivery.shop.suspension.SuspensionRequest; +import com.bluedelivery.exception.ApiException; +import com.bluedelivery.response.ErrorCode; +import com.bluedelivery.response.HttpResponse; +import com.bluedelivery.shop.businesshour.UpdateBusinessHoursDto; +import com.bluedelivery.shop.category.CategoryNotFoundException; +import com.bluedelivery.shop.suspension.SuspensionRequest; @RestController public class ShopUpdateControllerImpl implements ShopUpdateController { diff --git a/src/main/java/com/delivery/shop/shop/ShopUpdateService.java b/src/main/java/com/bluedelivery/shop/shop/ShopUpdateService.java similarity index 86% rename from src/main/java/com/delivery/shop/shop/ShopUpdateService.java rename to src/main/java/com/bluedelivery/shop/shop/ShopUpdateService.java index 97eaafa6..f028982c 100644 --- a/src/main/java/com/delivery/shop/shop/ShopUpdateService.java +++ b/src/main/java/com/bluedelivery/shop/shop/ShopUpdateService.java @@ -1,20 +1,19 @@ -package com.delivery.shop.shop; +package com.bluedelivery.shop.shop; -import static com.delivery.response.ErrorCode.*; +import static com.bluedelivery.response.ErrorCode.*; import java.util.List; -import java.util.stream.Collectors; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import com.delivery.exception.ApiException; -import com.delivery.shop.businesshour.BusinessHourConditions; -import com.delivery.shop.businesshour.BusinessHourPolicy; -import com.delivery.shop.businesshour.UpdateBusinessHoursDto; -import com.delivery.shop.category.CategoryManagerService; -import com.delivery.shop.closingday.LegalHolidayClosing; -import com.delivery.shop.suspension.Suspension; +import com.bluedelivery.exception.ApiException; +import com.bluedelivery.shop.businesshour.BusinessHourConditions; +import com.bluedelivery.shop.businesshour.BusinessHourPolicy; +import com.bluedelivery.shop.businesshour.UpdateBusinessHoursDto; +import com.bluedelivery.shop.category.CategoryManagerService; +import com.bluedelivery.shop.closingday.LegalHolidayClosing; +import com.bluedelivery.shop.suspension.Suspension; @Service @Transactional diff --git a/src/main/java/com/delivery/shop/shop/TemporaryClosingParam.java b/src/main/java/com/bluedelivery/shop/shop/TemporaryClosingParam.java similarity index 88% rename from src/main/java/com/delivery/shop/shop/TemporaryClosingParam.java rename to src/main/java/com/bluedelivery/shop/shop/TemporaryClosingParam.java index 61dfb831..c4cc4901 100644 --- a/src/main/java/com/delivery/shop/shop/TemporaryClosingParam.java +++ b/src/main/java/com/bluedelivery/shop/shop/TemporaryClosingParam.java @@ -1,8 +1,8 @@ -package com.delivery.shop.shop; +package com.bluedelivery.shop.shop; import java.time.LocalDate; -import com.delivery.shop.closingday.TemporaryClosing; +import com.bluedelivery.shop.closingday.TemporaryClosing; import lombok.NoArgsConstructor; diff --git a/src/main/java/com/delivery/shop/shop/UpdateCategoryRequest.java b/src/main/java/com/bluedelivery/shop/shop/UpdateCategoryRequest.java similarity index 92% rename from src/main/java/com/delivery/shop/shop/UpdateCategoryRequest.java rename to src/main/java/com/bluedelivery/shop/shop/UpdateCategoryRequest.java index 7de4dfd0..adc4edcd 100644 --- a/src/main/java/com/delivery/shop/shop/UpdateCategoryRequest.java +++ b/src/main/java/com/bluedelivery/shop/shop/UpdateCategoryRequest.java @@ -1,4 +1,4 @@ -package com.delivery.shop.shop; +package com.bluedelivery.shop.shop; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/com/delivery/shop/shop/UpdateClosingDaysRequest.java b/src/main/java/com/bluedelivery/shop/shop/UpdateClosingDaysRequest.java similarity index 96% rename from src/main/java/com/delivery/shop/shop/UpdateClosingDaysRequest.java rename to src/main/java/com/bluedelivery/shop/shop/UpdateClosingDaysRequest.java index dbe85740..aff299d7 100644 --- a/src/main/java/com/delivery/shop/shop/UpdateClosingDaysRequest.java +++ b/src/main/java/com/bluedelivery/shop/shop/UpdateClosingDaysRequest.java @@ -1,4 +1,4 @@ -package com.delivery.shop.shop; +package com.bluedelivery.shop.shop; import java.util.List; diff --git a/src/main/java/com/delivery/shop/suspension/Suspension.java b/src/main/java/com/bluedelivery/shop/suspension/Suspension.java similarity index 95% rename from src/main/java/com/delivery/shop/suspension/Suspension.java rename to src/main/java/com/bluedelivery/shop/suspension/Suspension.java index 2b5c2952..2b61bcea 100644 --- a/src/main/java/com/delivery/shop/suspension/Suspension.java +++ b/src/main/java/com/bluedelivery/shop/suspension/Suspension.java @@ -1,4 +1,4 @@ -package com.delivery.shop.suspension; +package com.bluedelivery.shop.suspension; import java.time.LocalDateTime; diff --git a/src/main/java/com/delivery/shop/suspension/SuspensionRequest.java b/src/main/java/com/bluedelivery/shop/suspension/SuspensionRequest.java similarity index 95% rename from src/main/java/com/delivery/shop/suspension/SuspensionRequest.java rename to src/main/java/com/bluedelivery/shop/suspension/SuspensionRequest.java index 789e04c0..cb767525 100644 --- a/src/main/java/com/delivery/shop/suspension/SuspensionRequest.java +++ b/src/main/java/com/bluedelivery/shop/suspension/SuspensionRequest.java @@ -1,4 +1,4 @@ -package com.delivery.shop.suspension; +package com.bluedelivery.shop.suspension; import java.time.LocalDateTime; diff --git a/src/main/java/com/delivery/user/application/UserManagementService.java b/src/main/java/com/bluedelivery/user/application/UserManagementService.java similarity index 78% rename from src/main/java/com/delivery/user/application/UserManagementService.java rename to src/main/java/com/bluedelivery/user/application/UserManagementService.java index 0c8f183d..5f828e05 100644 --- a/src/main/java/com/delivery/user/application/UserManagementService.java +++ b/src/main/java/com/bluedelivery/user/application/UserManagementService.java @@ -1,11 +1,11 @@ -package com.delivery.user.application; +package com.bluedelivery.user.application; -import com.delivery.user.domain.User; -import com.delivery.user.web.dto.AddressParam; -import com.delivery.user.web.dto.DeleteAccountParam; -import com.delivery.user.web.dto.UpdateAccountParam; -import com.delivery.user.web.dto.UserRegisterParam; -import com.delivery.utility.address.Address; +import com.bluedelivery.user.domain.User; +import com.bluedelivery.user.web.dto.AddressParam; +import com.bluedelivery.user.web.dto.DeleteAccountParam; +import com.bluedelivery.user.web.dto.UpdateAccountParam; +import com.bluedelivery.user.web.dto.UserRegisterParam; +import com.bluedelivery.utility.address.Address; public interface UserManagementService { diff --git a/src/main/java/com/delivery/user/application/UserManagementServiceHttp.java b/src/main/java/com/bluedelivery/user/application/UserManagementServiceHttp.java similarity index 81% rename from src/main/java/com/delivery/user/application/UserManagementServiceHttp.java rename to src/main/java/com/bluedelivery/user/application/UserManagementServiceHttp.java index dc9dbcf6..21dcb741 100644 --- a/src/main/java/com/delivery/user/application/UserManagementServiceHttp.java +++ b/src/main/java/com/bluedelivery/user/application/UserManagementServiceHttp.java @@ -1,21 +1,21 @@ -package com.delivery.user.application; +package com.bluedelivery.user.application; import java.util.Locale; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import com.delivery.exception.ApiException; -import com.delivery.response.ErrorCode; -import com.delivery.user.domain.User; -import com.delivery.user.domain.UserRepository; -import com.delivery.user.web.dto.AddressParam; -import com.delivery.user.web.dto.DeleteAccountParam; -import com.delivery.user.web.dto.UpdateAccountParam; -import com.delivery.user.web.dto.UserRegisterParam; -import com.delivery.utility.address.Address; -import com.delivery.utility.address.AddressService; -import com.delivery.utility.address.BuildingInfo; +import com.bluedelivery.exception.ApiException; +import com.bluedelivery.response.ErrorCode; +import com.bluedelivery.user.domain.User; +import com.bluedelivery.user.domain.UserRepository; +import com.bluedelivery.user.web.dto.AddressParam; +import com.bluedelivery.user.web.dto.DeleteAccountParam; +import com.bluedelivery.user.web.dto.UpdateAccountParam; +import com.bluedelivery.user.web.dto.UserRegisterParam; +import com.bluedelivery.utility.address.Address; +import com.bluedelivery.utility.address.AddressService; +import com.bluedelivery.utility.address.BuildingInfo; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/delivery/user/domain/User.java b/src/main/java/com/bluedelivery/user/domain/User.java similarity index 93% rename from src/main/java/com/delivery/user/domain/User.java rename to src/main/java/com/bluedelivery/user/domain/User.java index dcfb22c8..37d84716 100644 --- a/src/main/java/com/delivery/user/domain/User.java +++ b/src/main/java/com/bluedelivery/user/domain/User.java @@ -1,4 +1,4 @@ -package com.delivery.user.domain; +package com.bluedelivery.user.domain; import java.time.LocalDate; import java.util.Objects; @@ -10,10 +10,8 @@ import javax.persistence.GenerationType; import javax.persistence.Id; -import com.delivery.exception.ApiException; -import com.delivery.response.ErrorCode; -import com.delivery.utility.address.Address; -import com.delivery.utility.address.Addresses; +import com.bluedelivery.utility.address.Address; +import com.bluedelivery.utility.address.Addresses; @Entity public class User { diff --git a/src/main/java/com/delivery/user/domain/UserMapper.java b/src/main/java/com/bluedelivery/user/domain/UserMapper.java similarity index 74% rename from src/main/java/com/delivery/user/domain/UserMapper.java rename to src/main/java/com/bluedelivery/user/domain/UserMapper.java index 0fff0555..e8decccc 100644 --- a/src/main/java/com/delivery/user/domain/UserMapper.java +++ b/src/main/java/com/bluedelivery/user/domain/UserMapper.java @@ -1,4 +1,4 @@ -package com.delivery.user.domain; +package com.bluedelivery.user.domain; import org.apache.ibatis.annotations.Mapper; diff --git a/src/main/java/com/delivery/user/domain/UserRepository.java b/src/main/java/com/bluedelivery/user/domain/UserRepository.java similarity index 87% rename from src/main/java/com/delivery/user/domain/UserRepository.java rename to src/main/java/com/bluedelivery/user/domain/UserRepository.java index 6d0316fb..5d5ab851 100644 --- a/src/main/java/com/delivery/user/domain/UserRepository.java +++ b/src/main/java/com/bluedelivery/user/domain/UserRepository.java @@ -1,4 +1,4 @@ -package com.delivery.user.domain; +package com.bluedelivery.user.domain; import java.util.Optional; diff --git a/src/main/java/com/delivery/user/web/AuthenticationController.java b/src/main/java/com/bluedelivery/user/web/AuthenticationController.java similarity index 78% rename from src/main/java/com/delivery/user/web/AuthenticationController.java rename to src/main/java/com/bluedelivery/user/web/AuthenticationController.java index f2b5d884..5d74d071 100644 --- a/src/main/java/com/delivery/user/web/AuthenticationController.java +++ b/src/main/java/com/bluedelivery/user/web/AuthenticationController.java @@ -1,13 +1,13 @@ -package com.delivery.user.web; +package com.bluedelivery.user.web; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; -import com.delivery.authentication.Authentication; -import com.delivery.response.HttpResponse; -import com.delivery.user.web.dto.UserLoginParam.UserLoginRequest; +import com.bluedelivery.authentication.Authentication; +import com.bluedelivery.response.HttpResponse; +import com.bluedelivery.user.web.dto.UserLoginParam.UserLoginRequest; @RequestMapping("/auth") public interface AuthenticationController { diff --git a/src/main/java/com/delivery/user/web/AuthenticationControllerImpl.java b/src/main/java/com/bluedelivery/user/web/AuthenticationControllerImpl.java similarity index 66% rename from src/main/java/com/delivery/user/web/AuthenticationControllerImpl.java rename to src/main/java/com/bluedelivery/user/web/AuthenticationControllerImpl.java index dc16fb0a..45aea111 100644 --- a/src/main/java/com/delivery/user/web/AuthenticationControllerImpl.java +++ b/src/main/java/com/bluedelivery/user/web/AuthenticationControllerImpl.java @@ -1,19 +1,19 @@ -package com.delivery.user.web; +package com.bluedelivery.user.web; -import static com.delivery.response.ErrorCode.ALREADY_LOGGED_IN; -import static com.delivery.response.ErrorCode.USER_NOT_FOUND; -import static com.delivery.response.HttpResponse.SUCCESS; -import static com.delivery.response.HttpResponse.response; +import static com.bluedelivery.response.ErrorCode.ALREADY_LOGGED_IN; +import static com.bluedelivery.response.ErrorCode.USER_NOT_FOUND; +import static com.bluedelivery.response.HttpResponse.SUCCESS; +import static com.bluedelivery.response.HttpResponse.response; import static org.springframework.http.HttpStatus.*; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; -import com.delivery.authentication.Authentication; -import com.delivery.authentication.AuthenticationService; -import com.delivery.exception.ApiException; -import com.delivery.response.HttpResponse; -import com.delivery.user.web.dto.UserLoginParam.UserLoginRequest; +import com.bluedelivery.authentication.Authentication; +import com.bluedelivery.authentication.AuthenticationService; +import com.bluedelivery.exception.ApiException; +import com.bluedelivery.response.HttpResponse; +import com.bluedelivery.user.web.dto.UserLoginParam.UserLoginRequest; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/delivery/user/web/PasswordValidator.java b/src/main/java/com/bluedelivery/user/web/PasswordValidator.java similarity index 86% rename from src/main/java/com/delivery/user/web/PasswordValidator.java rename to src/main/java/com/bluedelivery/user/web/PasswordValidator.java index 73c5f261..ef271b0f 100644 --- a/src/main/java/com/delivery/user/web/PasswordValidator.java +++ b/src/main/java/com/bluedelivery/user/web/PasswordValidator.java @@ -1,4 +1,4 @@ -package com.delivery.user.web; +package com.bluedelivery.user.web; import java.util.Objects; @@ -6,7 +6,7 @@ import org.springframework.validation.Errors; import org.springframework.validation.Validator; -import com.delivery.user.web.dto.UserRegisterParam.UserRegisterRequest; +import com.bluedelivery.user.web.dto.UserRegisterParam.UserRegisterRequest; @Component public class PasswordValidator implements Validator { diff --git a/src/main/java/com/delivery/user/web/UserManagementController.java b/src/main/java/com/bluedelivery/user/web/UserManagementController.java similarity index 85% rename from src/main/java/com/delivery/user/web/UserManagementController.java rename to src/main/java/com/bluedelivery/user/web/UserManagementController.java index 48847f08..cc162c73 100644 --- a/src/main/java/com/delivery/user/web/UserManagementController.java +++ b/src/main/java/com/bluedelivery/user/web/UserManagementController.java @@ -1,4 +1,4 @@ -package com.delivery.user.web; +package com.bluedelivery.user.web; import javax.servlet.http.HttpServletRequest; @@ -13,13 +13,13 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; -import com.delivery.authentication.Authentication; -import com.delivery.config.interceptor.AuthenticationRequired; -import com.delivery.response.HttpResponse; -import com.delivery.user.web.dto.AddressParam.AddressRequest; -import com.delivery.user.web.dto.DeleteAccountParam.DeleteAccountRequest; -import com.delivery.user.web.dto.UpdateAccountParam.UpdateAccountRequest; -import com.delivery.user.web.dto.UserRegisterParam; +import com.bluedelivery.authentication.Authentication; +import com.bluedelivery.config.interceptor.AuthenticationRequired; +import com.bluedelivery.response.HttpResponse; +import com.bluedelivery.user.web.dto.AddressParam.AddressRequest; +import com.bluedelivery.user.web.dto.DeleteAccountParam.DeleteAccountRequest; +import com.bluedelivery.user.web.dto.UpdateAccountParam.UpdateAccountRequest; +import com.bluedelivery.user.web.dto.UserRegisterParam; @RequestMapping("/users") diff --git a/src/main/java/com/delivery/user/web/UserManagementControllerImpl.java b/src/main/java/com/bluedelivery/user/web/UserManagementControllerImpl.java similarity index 80% rename from src/main/java/com/delivery/user/web/UserManagementControllerImpl.java rename to src/main/java/com/bluedelivery/user/web/UserManagementControllerImpl.java index 793002f4..c5288e43 100644 --- a/src/main/java/com/delivery/user/web/UserManagementControllerImpl.java +++ b/src/main/java/com/bluedelivery/user/web/UserManagementControllerImpl.java @@ -1,8 +1,8 @@ -package com.delivery.user.web; +package com.bluedelivery.user.web; -import static com.delivery.authentication.Authentication.AUTH_STR; -import static com.delivery.response.HttpResponse.*; -import static com.delivery.user.web.dto.UpdateAccountParam.*; +import static com.bluedelivery.authentication.Authentication.AUTH_STR; +import static com.bluedelivery.response.HttpResponse.*; +import static com.bluedelivery.user.web.dto.UpdateAccountParam.*; import static org.springframework.http.HttpStatus.*; import javax.servlet.http.HttpServletRequest; @@ -12,13 +12,13 @@ import org.springframework.web.bind.annotation.InitBinder; import org.springframework.web.bind.annotation.RestController; -import com.delivery.authentication.Authentication; -import com.delivery.response.HttpResponse; -import com.delivery.user.application.UserManagementService; -import com.delivery.user.web.dto.AddressParam.AddressRequest; -import com.delivery.user.web.dto.DeleteAccountParam.DeleteAccountRequest; -import com.delivery.user.web.dto.UserRegisterParam; -import com.delivery.utility.address.Address; +import com.bluedelivery.authentication.Authentication; +import com.bluedelivery.response.HttpResponse; +import com.bluedelivery.user.application.UserManagementService; +import com.bluedelivery.user.web.dto.AddressParam.AddressRequest; +import com.bluedelivery.user.web.dto.DeleteAccountParam.DeleteAccountRequest; +import com.bluedelivery.user.web.dto.UserRegisterParam; +import com.bluedelivery.utility.address.Address; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/delivery/user/web/dto/AddressParam.java b/src/main/java/com/bluedelivery/user/web/dto/AddressParam.java similarity index 93% rename from src/main/java/com/delivery/user/web/dto/AddressParam.java rename to src/main/java/com/bluedelivery/user/web/dto/AddressParam.java index e8c82ca5..7e6523a8 100644 --- a/src/main/java/com/delivery/user/web/dto/AddressParam.java +++ b/src/main/java/com/bluedelivery/user/web/dto/AddressParam.java @@ -1,4 +1,4 @@ -package com.delivery.user.web.dto; +package com.bluedelivery.user.web.dto; import lombok.Getter; diff --git a/src/main/java/com/delivery/user/web/dto/DeleteAccountParam.java b/src/main/java/com/bluedelivery/user/web/dto/DeleteAccountParam.java similarity index 94% rename from src/main/java/com/delivery/user/web/dto/DeleteAccountParam.java rename to src/main/java/com/bluedelivery/user/web/dto/DeleteAccountParam.java index 006934b2..2342d3a0 100644 --- a/src/main/java/com/delivery/user/web/dto/DeleteAccountParam.java +++ b/src/main/java/com/bluedelivery/user/web/dto/DeleteAccountParam.java @@ -1,4 +1,4 @@ -package com.delivery.user.web.dto; +package com.bluedelivery.user.web.dto; import javax.validation.constraints.Email; import javax.validation.constraints.NotBlank; diff --git a/src/main/java/com/delivery/user/web/dto/UpdateAccountParam.java b/src/main/java/com/bluedelivery/user/web/dto/UpdateAccountParam.java similarity index 84% rename from src/main/java/com/delivery/user/web/dto/UpdateAccountParam.java rename to src/main/java/com/bluedelivery/user/web/dto/UpdateAccountParam.java index 084b9cb8..87d2deb4 100644 --- a/src/main/java/com/delivery/user/web/dto/UpdateAccountParam.java +++ b/src/main/java/com/bluedelivery/user/web/dto/UpdateAccountParam.java @@ -1,13 +1,11 @@ -package com.delivery.user.web.dto; +package com.bluedelivery.user.web.dto; import java.time.LocalDate; -import javax.validation.constraints.NotBlank; import javax.validation.constraints.Past; import javax.validation.constraints.Pattern; -import com.delivery.utility.RegexConstants; -import com.delivery.utility.address.Address; +import com.bluedelivery.utility.RegexConstants; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/delivery/user/web/dto/UserLoginParam.java b/src/main/java/com/bluedelivery/user/web/dto/UserLoginParam.java similarity index 94% rename from src/main/java/com/delivery/user/web/dto/UserLoginParam.java rename to src/main/java/com/bluedelivery/user/web/dto/UserLoginParam.java index 5fc06e05..3aaf96a7 100644 --- a/src/main/java/com/delivery/user/web/dto/UserLoginParam.java +++ b/src/main/java/com/bluedelivery/user/web/dto/UserLoginParam.java @@ -1,4 +1,4 @@ -package com.delivery.user.web.dto; +package com.bluedelivery.user.web.dto; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; diff --git a/src/main/java/com/delivery/user/web/dto/UserRegisterParam.java b/src/main/java/com/bluedelivery/user/web/dto/UserRegisterParam.java similarity index 93% rename from src/main/java/com/delivery/user/web/dto/UserRegisterParam.java rename to src/main/java/com/bluedelivery/user/web/dto/UserRegisterParam.java index d8cc4f71..4657da04 100644 --- a/src/main/java/com/delivery/user/web/dto/UserRegisterParam.java +++ b/src/main/java/com/bluedelivery/user/web/dto/UserRegisterParam.java @@ -1,4 +1,4 @@ -package com.delivery.user.web.dto; +package com.bluedelivery.user.web.dto; import java.time.LocalDate; @@ -8,8 +8,8 @@ import javax.validation.constraints.Past; import javax.validation.constraints.Pattern; -import com.delivery.user.domain.User; -import com.delivery.utility.RegexConstants; +import com.bluedelivery.user.domain.User; +import com.bluedelivery.utility.RegexConstants; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/src/main/java/com/delivery/utility/EncryptUtils.java b/src/main/java/com/bluedelivery/utility/EncryptUtils.java similarity index 94% rename from src/main/java/com/delivery/utility/EncryptUtils.java rename to src/main/java/com/bluedelivery/utility/EncryptUtils.java index 05ccd677..ffe7caf0 100644 --- a/src/main/java/com/delivery/utility/EncryptUtils.java +++ b/src/main/java/com/bluedelivery/utility/EncryptUtils.java @@ -1,4 +1,4 @@ -package com.delivery.utility; +package com.bluedelivery.utility; import java.nio.charset.StandardCharsets; import java.security.MessageDigest; diff --git a/src/main/java/com/delivery/utility/RegexConstants.java b/src/main/java/com/bluedelivery/utility/RegexConstants.java similarity index 90% rename from src/main/java/com/delivery/utility/RegexConstants.java rename to src/main/java/com/bluedelivery/utility/RegexConstants.java index a18d403e..20e89b8a 100644 --- a/src/main/java/com/delivery/utility/RegexConstants.java +++ b/src/main/java/com/bluedelivery/utility/RegexConstants.java @@ -1,4 +1,4 @@ -package com.delivery.utility; +package com.bluedelivery.utility; public interface RegexConstants { String PHONE = "^01([0|1|6|7|8|9]?)-?([0-9]{3,4})-?([0-9]{4})$"; diff --git a/src/main/java/com/delivery/utility/address/Address.java b/src/main/java/com/bluedelivery/utility/address/Address.java similarity index 95% rename from src/main/java/com/delivery/utility/address/Address.java rename to src/main/java/com/bluedelivery/utility/address/Address.java index d02aba11..2e43badf 100644 --- a/src/main/java/com/delivery/utility/address/Address.java +++ b/src/main/java/com/bluedelivery/utility/address/Address.java @@ -1,4 +1,4 @@ -package com.delivery.utility.address; +package com.bluedelivery.utility.address; import java.util.Objects; @@ -11,7 +11,7 @@ import javax.persistence.ManyToOne; import javax.persistence.OneToOne; -import com.delivery.user.domain.User; +import com.bluedelivery.user.domain.User; @Entity public class Address { diff --git a/src/main/java/com/delivery/utility/address/AddressRepository.java b/src/main/java/com/bluedelivery/utility/address/AddressRepository.java similarity index 65% rename from src/main/java/com/delivery/utility/address/AddressRepository.java rename to src/main/java/com/bluedelivery/utility/address/AddressRepository.java index c55ef1b7..2729a8d6 100644 --- a/src/main/java/com/delivery/utility/address/AddressRepository.java +++ b/src/main/java/com/bluedelivery/utility/address/AddressRepository.java @@ -1,11 +1,10 @@ -package com.delivery.utility.address; +package com.bluedelivery.utility.address; import java.util.Optional; import org.springframework.data.jpa.repository.JpaRepository; -import com.delivery.user.domain.User; -import com.delivery.utility.address.Address; +import com.bluedelivery.user.domain.User; public interface AddressRepository extends JpaRepository { Optional
findByIdAndUser(Long id, User user); diff --git a/src/main/java/com/delivery/utility/address/AddressService.java b/src/main/java/com/bluedelivery/utility/address/AddressService.java similarity index 84% rename from src/main/java/com/delivery/utility/address/AddressService.java rename to src/main/java/com/bluedelivery/utility/address/AddressService.java index c08cd977..b4994c5f 100644 --- a/src/main/java/com/delivery/utility/address/AddressService.java +++ b/src/main/java/com/bluedelivery/utility/address/AddressService.java @@ -1,7 +1,7 @@ -package com.delivery.utility.address; +package com.bluedelivery.utility.address; -import com.delivery.exception.ApiException; -import com.delivery.user.domain.User; +import com.bluedelivery.exception.ApiException; +import com.bluedelivery.user.domain.User; public interface AddressService { /** diff --git a/src/main/java/com/delivery/utility/address/AddressServiceImpl.java b/src/main/java/com/bluedelivery/utility/address/AddressServiceImpl.java similarity index 79% rename from src/main/java/com/delivery/utility/address/AddressServiceImpl.java rename to src/main/java/com/bluedelivery/utility/address/AddressServiceImpl.java index 31904c97..8ce104a1 100644 --- a/src/main/java/com/delivery/utility/address/AddressServiceImpl.java +++ b/src/main/java/com/bluedelivery/utility/address/AddressServiceImpl.java @@ -1,11 +1,11 @@ -package com.delivery.utility.address; +package com.bluedelivery.utility.address; -import static com.delivery.response.ErrorCode.ADDRESS_DOES_NOT_EXIST; +import static com.bluedelivery.response.ErrorCode.ADDRESS_DOES_NOT_EXIST; import org.springframework.stereotype.Service; -import com.delivery.exception.ApiException; -import com.delivery.user.domain.User; +import com.bluedelivery.exception.ApiException; +import com.bluedelivery.user.domain.User; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/delivery/utility/address/Addresses.java b/src/main/java/com/bluedelivery/utility/address/Addresses.java similarity index 91% rename from src/main/java/com/delivery/utility/address/Addresses.java rename to src/main/java/com/bluedelivery/utility/address/Addresses.java index 51cd77e0..be00e423 100644 --- a/src/main/java/com/delivery/utility/address/Addresses.java +++ b/src/main/java/com/bluedelivery/utility/address/Addresses.java @@ -1,6 +1,6 @@ -package com.delivery.utility.address; +package com.bluedelivery.utility.address; -import static com.delivery.response.ErrorCode.*; +import static com.bluedelivery.response.ErrorCode.*; import static java.util.Objects.isNull; import java.util.HashSet; @@ -15,8 +15,7 @@ import javax.persistence.OneToMany; import javax.persistence.OneToOne; -import com.delivery.exception.ApiException; -import com.delivery.user.domain.User; +import com.bluedelivery.exception.ApiException; @Embeddable public class Addresses { diff --git a/src/main/java/com/delivery/utility/address/BuildingInfo.java b/src/main/java/com/bluedelivery/utility/address/BuildingInfo.java similarity index 99% rename from src/main/java/com/delivery/utility/address/BuildingInfo.java rename to src/main/java/com/bluedelivery/utility/address/BuildingInfo.java index a8bb0358..92ecdf9e 100644 --- a/src/main/java/com/delivery/utility/address/BuildingInfo.java +++ b/src/main/java/com/bluedelivery/utility/address/BuildingInfo.java @@ -1,4 +1,4 @@ -package com.delivery.utility.address; +package com.bluedelivery.utility.address; import java.math.BigDecimal; import java.util.Objects; diff --git a/src/main/java/com/delivery/utility/address/BuildingInfoRepository.java b/src/main/java/com/bluedelivery/utility/address/BuildingInfoRepository.java similarity index 78% rename from src/main/java/com/delivery/utility/address/BuildingInfoRepository.java rename to src/main/java/com/bluedelivery/utility/address/BuildingInfoRepository.java index 99a715a9..e3668748 100644 --- a/src/main/java/com/delivery/utility/address/BuildingInfoRepository.java +++ b/src/main/java/com/bluedelivery/utility/address/BuildingInfoRepository.java @@ -1,4 +1,4 @@ -package com.delivery.utility.address; +package com.bluedelivery.utility.address; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/src/main/java/com/delivery/utility/address/CityToDong.java b/src/main/java/com/bluedelivery/utility/address/CityToDong.java similarity index 96% rename from src/main/java/com/delivery/utility/address/CityToDong.java rename to src/main/java/com/bluedelivery/utility/address/CityToDong.java index b071c2f8..bdfb5df7 100644 --- a/src/main/java/com/delivery/utility/address/CityToDong.java +++ b/src/main/java/com/bluedelivery/utility/address/CityToDong.java @@ -1,4 +1,4 @@ -package com.delivery.utility.address; +package com.bluedelivery.utility.address; import javax.persistence.Entity; import javax.persistence.Id; diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index f26df6ac..9fd72fa1 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -19,11 +19,11 @@ spring: mybatis: mapper-locations: mybatis/mapper/*.xml type-aliases-package: - com.delivery.shop.shop, - com.delivery.shop.category, - com.delivery.shop.businesshour, - com.delivery.shop.closingday, - com.delivery.shop.suspension, - com.delivery.user.domain, - com.delivery.utility, + com.bluedelivery.shop.shop, + com.bluedelivery.shop.category, + com.bluedelivery.shop.businesshour, + com.bluedelivery.shop.closingday, + com.bluedelivery.shop.suspension, + com.bluedelivery.user.domain, + com.bluedelivery.utility, org.apache.ibatis.type diff --git a/src/main/resources/mybatis/mapper/CategoryMapper.xml b/src/main/resources/mybatis/mapper/CategoryMapper.xml index f9280548..9e7591c9 100644 --- a/src/main/resources/mybatis/mapper/CategoryMapper.xml +++ b/src/main/resources/mybatis/mapper/CategoryMapper.xml @@ -3,14 +3,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + - SELECT S.ID SHOP_ID, NAME, INTRODUCE, diff --git a/src/main/resources/mybatis/mapper/ClosingMapper.xml b/src/main/resources/mybatis/mapper/ClosingMapper.xml index b2b68718..e1daae70 100644 --- a/src/main/resources/mybatis/mapper/ClosingMapper.xml +++ b/src/main/resources/mybatis/mapper/ClosingMapper.xml @@ -3,9 +3,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + - + @@ -16,7 +16,7 @@ - + diff --git a/src/main/resources/mybatis/mapper/MenuGroupMapper.xml b/src/main/resources/mybatis/mapper/MenuGroupMapper.xml index 41f51ac1..ef94a486 100644 --- a/src/main/resources/mybatis/mapper/MenuGroupMapper.xml +++ b/src/main/resources/mybatis/mapper/MenuGroupMapper.xml @@ -1,23 +1,23 @@ - + - + - + - + - + INSERT INTO MENU_GROUP(SHOP_ID, NAME, CONTENT) VALUES (#{shopId}, #{name}, #{content}) diff --git a/src/main/resources/mybatis/mapper/MenuMapper.xml b/src/main/resources/mybatis/mapper/MenuMapper.xml index a247dfa8..c8ca597a 100644 --- a/src/main/resources/mybatis/mapper/MenuMapper.xml +++ b/src/main/resources/mybatis/mapper/MenuMapper.xml @@ -1,19 +1,19 @@ - + - + - + - + INSERT INTO MENU(GROUP_ID, NAME, PRICE, COMPOSITION, CONTENT, STATUS, IS_MAIN) VALUES (#{menuGroupId}, #{name}, #{price}, #{composition}, #{content}, #{status}, #{isMain}); diff --git a/src/main/resources/mybatis/mapper/ShopMapper.xml b/src/main/resources/mybatis/mapper/ShopMapper.xml index 77f52996..64f36634 100644 --- a/src/main/resources/mybatis/mapper/ShopMapper.xml +++ b/src/main/resources/mybatis/mapper/ShopMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -40,7 +40,7 @@ - SELECT ID AS CATEGORY_ID, NAME AS CATEGORY_NAME, CS.SHOP_ID AS SHOP_ID @@ -51,7 +51,7 @@ - SELECT SHOP_ID, CLOSING_TYPE, CYCLE_TYPE, @@ -138,16 +138,16 @@ INSERT INTO CLOSING_DAY (SHOP_ID, CLOSING_TYPE, CYCLE_TYPE, DAY_OF_WEEK, FROM_DATE, TO_DATE) VALUES - + (#{id}, #{closing.CLOSING_TYPE}, null, null, null, null) - + (#{id}, #{closing.CLOSING_TYPE}, null, #{closing.dayOfWeek}, null, null) - + (#{id}, #{closing.CLOSING_TYPE}, #{closing.cycle}, #{closing.dayOfWeek}, null, null) - + (#{id}, #{closing.CLOSING_TYPE}, null, null, #{closing.from}, #{closing.to}) diff --git a/src/main/resources/mybatis/mapper/UserMapper.xml b/src/main/resources/mybatis/mapper/UserMapper.xml index 2c39ec43..8a873134 100644 --- a/src/main/resources/mybatis/mapper/UserMapper.xml +++ b/src/main/resources/mybatis/mapper/UserMapper.xml @@ -3,8 +3,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - + + diff --git a/src/test/java/com/delivery/config/interceptor/UserAuthInterceptorTest.java b/src/test/java/com/bluedelivery/config/interceptor/UserAuthInterceptorTest.java similarity index 85% rename from src/test/java/com/delivery/config/interceptor/UserAuthInterceptorTest.java rename to src/test/java/com/bluedelivery/config/interceptor/UserAuthInterceptorTest.java index 5961ad0c..0e869ca4 100644 --- a/src/test/java/com/delivery/config/interceptor/UserAuthInterceptorTest.java +++ b/src/test/java/com/bluedelivery/config/interceptor/UserAuthInterceptorTest.java @@ -1,6 +1,6 @@ -package com.delivery.config.interceptor; +package com.bluedelivery.config.interceptor; -import static com.delivery.authentication.AuthenticationService.BEARER_PREFIX; +import static com.bluedelivery.authentication.AuthenticationService.BEARER_PREFIX; import static org.mockito.Mockito.when; import static org.springframework.http.HttpHeaders.AUTHORIZATION; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; @@ -19,13 +19,13 @@ import org.springframework.test.web.servlet.ResultActions; import org.springframework.test.web.servlet.setup.MockMvcBuilders; -import com.delivery.authentication.Authentication; -import com.delivery.authentication.AuthenticationService; -import com.delivery.config.GlobalExceptionHandler; -import com.delivery.user.application.UserManagementService; -import com.delivery.user.web.PasswordValidator; -import com.delivery.user.web.UserManagementController; -import com.delivery.user.web.UserManagementControllerImpl; +import com.bluedelivery.authentication.Authentication; +import com.bluedelivery.authentication.AuthenticationService; +import com.bluedelivery.config.GlobalExceptionHandler; +import com.bluedelivery.user.application.UserManagementService; +import com.bluedelivery.user.web.PasswordValidator; +import com.bluedelivery.user.web.UserManagementController; +import com.bluedelivery.user.web.UserManagementControllerImpl; @ExtendWith(MockitoExtension.class) class UserAuthInterceptorTest { diff --git a/src/test/java/com/delivery/config/resolver/AuthenticatedUserArgumentResolverTest.java b/src/test/java/com/bluedelivery/config/resolver/AuthenticatedUserArgumentResolverTest.java similarity index 92% rename from src/test/java/com/delivery/config/resolver/AuthenticatedUserArgumentResolverTest.java rename to src/test/java/com/bluedelivery/config/resolver/AuthenticatedUserArgumentResolverTest.java index 7e29908c..75aa552e 100644 --- a/src/test/java/com/delivery/config/resolver/AuthenticatedUserArgumentResolverTest.java +++ b/src/test/java/com/bluedelivery/config/resolver/AuthenticatedUserArgumentResolverTest.java @@ -1,4 +1,4 @@ -package com.delivery.config.resolver; +package com.bluedelivery.config.resolver; import static org.assertj.core.api.Assertions.assertThat; @@ -9,8 +9,8 @@ import org.mockito.junit.jupiter.MockitoExtension; import org.springframework.core.MethodParameter; -import com.delivery.authentication.Authentication; -import com.delivery.authentication.AuthenticationService; +import com.bluedelivery.authentication.Authentication; +import com.bluedelivery.authentication.AuthenticationService; @ExtendWith(MockitoExtension.class) class AuthenticatedUserArgumentResolverTest { diff --git a/src/test/java/com/delivery/shop/businesshour/BusinessHourPolicyConditionsTest.java b/src/test/java/com/bluedelivery/shop/businesshour/BusinessHourPolicyConditionsTest.java similarity index 97% rename from src/test/java/com/delivery/shop/businesshour/BusinessHourPolicyConditionsTest.java rename to src/test/java/com/bluedelivery/shop/businesshour/BusinessHourPolicyConditionsTest.java index 340dfe64..4a0581e9 100644 --- a/src/test/java/com/delivery/shop/businesshour/BusinessHourPolicyConditionsTest.java +++ b/src/test/java/com/bluedelivery/shop/businesshour/BusinessHourPolicyConditionsTest.java @@ -1,6 +1,6 @@ -package com.delivery.shop.businesshour; +package com.bluedelivery.shop.businesshour; -import static com.delivery.shop.businesshour.UpdateBusinessHoursDto.*; +import static com.bluedelivery.shop.businesshour.UpdateBusinessHoursDto.*; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.*; diff --git a/src/test/java/com/delivery/shop/category/CategoriesTest.java b/src/test/java/com/bluedelivery/shop/category/CategoriesTest.java similarity index 98% rename from src/test/java/com/delivery/shop/category/CategoriesTest.java rename to src/test/java/com/bluedelivery/shop/category/CategoriesTest.java index 6ee155cd..ed16f51d 100644 --- a/src/test/java/com/delivery/shop/category/CategoriesTest.java +++ b/src/test/java/com/bluedelivery/shop/category/CategoriesTest.java @@ -1,4 +1,4 @@ -package com.delivery.shop.category; +package com.bluedelivery.shop.category; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.*; diff --git a/src/test/java/com/delivery/shop/category/CategoryManagerControllerImplTest.java b/src/test/java/com/bluedelivery/shop/category/CategoryManagerControllerImplTest.java similarity index 96% rename from src/test/java/com/delivery/shop/category/CategoryManagerControllerImplTest.java rename to src/test/java/com/bluedelivery/shop/category/CategoryManagerControllerImplTest.java index 9f291a09..25235c0c 100644 --- a/src/test/java/com/delivery/shop/category/CategoryManagerControllerImplTest.java +++ b/src/test/java/com/bluedelivery/shop/category/CategoryManagerControllerImplTest.java @@ -1,4 +1,4 @@ -package com.delivery.shop.category; +package com.bluedelivery.shop.category; import static org.hamcrest.Matchers.*; import static org.mockito.Mockito.when; @@ -21,9 +21,9 @@ import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; -import com.delivery.config.GlobalExceptionHandler; -import com.delivery.shop.category.CreateCategoryParam.CreateCategoryRequest; -import com.delivery.shop.category.EditCategoryParam.EditCategoryRequest; +import com.bluedelivery.config.GlobalExceptionHandler; +import com.bluedelivery.shop.category.CreateCategoryParam.CreateCategoryRequest; +import com.bluedelivery.shop.category.EditCategoryParam.EditCategoryRequest; import com.fasterxml.jackson.databind.ObjectMapper; @ExtendWith(MockitoExtension.class) diff --git a/src/test/java/com/delivery/shop/category/CategoryManagerServiceTest.java b/src/test/java/com/bluedelivery/shop/category/CategoryManagerServiceTest.java similarity index 96% rename from src/test/java/com/delivery/shop/category/CategoryManagerServiceTest.java rename to src/test/java/com/bluedelivery/shop/category/CategoryManagerServiceTest.java index 5fba757c..0911ad9e 100644 --- a/src/test/java/com/delivery/shop/category/CategoryManagerServiceTest.java +++ b/src/test/java/com/bluedelivery/shop/category/CategoryManagerServiceTest.java @@ -1,4 +1,4 @@ -package com.delivery.shop.category; +package com.bluedelivery.shop.category; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.when; diff --git a/src/test/java/com/delivery/shop/category/CategoryTest.java b/src/test/java/com/bluedelivery/shop/category/CategoryTest.java similarity index 92% rename from src/test/java/com/delivery/shop/category/CategoryTest.java rename to src/test/java/com/bluedelivery/shop/category/CategoryTest.java index 85e1c7b8..634762c7 100644 --- a/src/test/java/com/delivery/shop/category/CategoryTest.java +++ b/src/test/java/com/bluedelivery/shop/category/CategoryTest.java @@ -1,4 +1,4 @@ -package com.delivery.shop.category; +package com.bluedelivery.shop.category; import static org.assertj.core.api.Assertions.assertThat; diff --git a/src/test/java/com/delivery/shop/closingday/LegalHolidayClosingTest.java b/src/test/java/com/bluedelivery/shop/closingday/LegalHolidayClosingTest.java similarity index 94% rename from src/test/java/com/delivery/shop/closingday/LegalHolidayClosingTest.java rename to src/test/java/com/bluedelivery/shop/closingday/LegalHolidayClosingTest.java index ca1afcd5..93255daf 100644 --- a/src/test/java/com/delivery/shop/closingday/LegalHolidayClosingTest.java +++ b/src/test/java/com/bluedelivery/shop/closingday/LegalHolidayClosingTest.java @@ -1,12 +1,10 @@ -package com.delivery.shop.closingday; +package com.bluedelivery.shop.closingday; import static org.assertj.core.api.Assertions.*; -import static org.junit.jupiter.api.Assertions.*; import java.time.LocalDate; import java.time.Month; -import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/src/test/java/com/delivery/shop/closingday/LegalHolidayTest.java b/src/test/java/com/bluedelivery/shop/closingday/LegalHolidayTest.java similarity index 93% rename from src/test/java/com/delivery/shop/closingday/LegalHolidayTest.java rename to src/test/java/com/bluedelivery/shop/closingday/LegalHolidayTest.java index 8786501e..f7ae5a91 100644 --- a/src/test/java/com/delivery/shop/closingday/LegalHolidayTest.java +++ b/src/test/java/com/bluedelivery/shop/closingday/LegalHolidayTest.java @@ -1,14 +1,12 @@ -package com.delivery.shop.closingday; +package com.bluedelivery.shop.closingday; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.*; import java.time.LocalDate; import java.time.Month; import java.time.Year; import java.util.Set; -import org.assertj.core.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; diff --git a/src/test/java/com/delivery/shop/closingday/RegularClosingDayPolicyTest.java b/src/test/java/com/bluedelivery/shop/closingday/RegularClosingDayPolicyTest.java similarity index 97% rename from src/test/java/com/delivery/shop/closingday/RegularClosingDayPolicyTest.java rename to src/test/java/com/bluedelivery/shop/closingday/RegularClosingDayPolicyTest.java index cefa3a4f..e6a9ea9c 100644 --- a/src/test/java/com/delivery/shop/closingday/RegularClosingDayPolicyTest.java +++ b/src/test/java/com/bluedelivery/shop/closingday/RegularClosingDayPolicyTest.java @@ -1,7 +1,6 @@ -package com.delivery.shop.closingday; +package com.bluedelivery.shop.closingday; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.*; import java.time.DayOfWeek; import java.time.LocalDate; diff --git a/src/test/java/com/delivery/shop/closingday/TemporaryClosingTest.java b/src/test/java/com/bluedelivery/shop/closingday/TemporaryClosingTest.java similarity index 93% rename from src/test/java/com/delivery/shop/closingday/TemporaryClosingTest.java rename to src/test/java/com/bluedelivery/shop/closingday/TemporaryClosingTest.java index da746742..b002fc54 100644 --- a/src/test/java/com/delivery/shop/closingday/TemporaryClosingTest.java +++ b/src/test/java/com/bluedelivery/shop/closingday/TemporaryClosingTest.java @@ -1,7 +1,6 @@ -package com.delivery.shop.closingday; +package com.bluedelivery.shop.closingday; import static org.assertj.core.api.Assertions.*; -import static org.junit.jupiter.api.Assertions.*; import java.time.LocalDate; import java.time.Month; diff --git a/src/test/java/com/delivery/shop/menu/MenuGroupServiceTest.java b/src/test/java/com/bluedelivery/shop/menu/MenuGroupServiceTest.java similarity index 98% rename from src/test/java/com/delivery/shop/menu/MenuGroupServiceTest.java rename to src/test/java/com/bluedelivery/shop/menu/MenuGroupServiceTest.java index 7faf75af..d5edce78 100644 --- a/src/test/java/com/delivery/shop/menu/MenuGroupServiceTest.java +++ b/src/test/java/com/bluedelivery/shop/menu/MenuGroupServiceTest.java @@ -1,4 +1,4 @@ -package com.delivery.shop.menu; +package com.bluedelivery.shop.menu; import static org.assertj.core.api.Assertions.*; diff --git a/src/test/java/com/delivery/shop/menu/MenuOptionControllerTest.java b/src/test/java/com/bluedelivery/shop/menu/MenuOptionControllerTest.java similarity index 92% rename from src/test/java/com/delivery/shop/menu/MenuOptionControllerTest.java rename to src/test/java/com/bluedelivery/shop/menu/MenuOptionControllerTest.java index 20d141de..cb957a39 100644 --- a/src/test/java/com/delivery/shop/menu/MenuOptionControllerTest.java +++ b/src/test/java/com/bluedelivery/shop/menu/MenuOptionControllerTest.java @@ -1,4 +1,4 @@ -package com.delivery.shop.menu; +package com.bluedelivery.shop.menu; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; @@ -11,8 +11,8 @@ import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MockMvc; -import com.delivery.authentication.AuthenticationService; -import com.delivery.config.interceptor.AuthenticationRepository; +import com.bluedelivery.authentication.AuthenticationService; +import com.bluedelivery.config.interceptor.AuthenticationRepository; import com.fasterxml.jackson.databind.ObjectMapper; @WebMvcTest(MenuOptionControllerImpl.class) diff --git a/src/test/java/com/delivery/shop/menu/MenuOptionServiceTest.java b/src/test/java/com/bluedelivery/shop/menu/MenuOptionServiceTest.java similarity index 98% rename from src/test/java/com/delivery/shop/menu/MenuOptionServiceTest.java rename to src/test/java/com/bluedelivery/shop/menu/MenuOptionServiceTest.java index a57aa9e3..fd9fe185 100644 --- a/src/test/java/com/delivery/shop/menu/MenuOptionServiceTest.java +++ b/src/test/java/com/bluedelivery/shop/menu/MenuOptionServiceTest.java @@ -1,4 +1,4 @@ -package com.delivery.shop.menu; +package com.bluedelivery.shop.menu; import static java.util.Optional.*; import static org.mockito.BDDMockito.*; diff --git a/src/test/java/com/delivery/shop/menu/MenuServiceTest.java b/src/test/java/com/bluedelivery/shop/menu/MenuServiceTest.java similarity index 91% rename from src/test/java/com/delivery/shop/menu/MenuServiceTest.java rename to src/test/java/com/bluedelivery/shop/menu/MenuServiceTest.java index 9502ac5a..26ce3b15 100644 --- a/src/test/java/com/delivery/shop/menu/MenuServiceTest.java +++ b/src/test/java/com/bluedelivery/shop/menu/MenuServiceTest.java @@ -1,7 +1,7 @@ -package com.delivery.shop.menu; +package com.bluedelivery.shop.menu; -import static com.delivery.response.ErrorCode.*; -import static com.delivery.shop.menu.Menu.*; +import static com.bluedelivery.response.ErrorCode.*; +import static com.bluedelivery.shop.menu.Menu.*; import static org.assertj.core.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.BDDMockito.*; @@ -14,8 +14,8 @@ import org.mockito.junit.jupiter.MockitoExtension; import org.springframework.test.context.ActiveProfiles; -import com.delivery.exception.ApiException; -import com.delivery.response.ErrorCode; +import com.bluedelivery.exception.ApiException; +import com.bluedelivery.response.ErrorCode; @ExtendWith(MockitoExtension.class) diff --git a/src/test/java/com/delivery/shop/shop/ShopTest.java b/src/test/java/com/bluedelivery/shop/shop/ShopTest.java similarity index 85% rename from src/test/java/com/delivery/shop/shop/ShopTest.java rename to src/test/java/com/bluedelivery/shop/shop/ShopTest.java index 6c97862d..83c405b8 100644 --- a/src/test/java/com/delivery/shop/shop/ShopTest.java +++ b/src/test/java/com/bluedelivery/shop/shop/ShopTest.java @@ -1,4 +1,4 @@ -package com.delivery.shop.shop; +package com.bluedelivery.shop.shop; import static org.assertj.core.api.Assertions.assertThat; @@ -7,8 +7,8 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import com.delivery.shop.category.Categories; -import com.delivery.shop.category.Category; +import com.bluedelivery.shop.category.Categories; +import com.bluedelivery.shop.category.Category; class ShopTest { diff --git a/src/test/java/com/delivery/shop/shop/ShopUpdateControllerTest.java b/src/test/java/com/bluedelivery/shop/shop/ShopUpdateControllerTest.java similarity index 92% rename from src/test/java/com/delivery/shop/shop/ShopUpdateControllerTest.java rename to src/test/java/com/bluedelivery/shop/shop/ShopUpdateControllerTest.java index de4e06f1..2ca4bb94 100644 --- a/src/test/java/com/delivery/shop/shop/ShopUpdateControllerTest.java +++ b/src/test/java/com/bluedelivery/shop/shop/ShopUpdateControllerTest.java @@ -1,6 +1,5 @@ -package com.delivery.shop.shop; +package com.bluedelivery.shop.shop; -import static org.junit.jupiter.api.Assertions.*; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @@ -18,7 +17,7 @@ import org.springframework.test.context.ActiveProfiles; import org.springframework.test.web.servlet.MockMvc; -import com.delivery.shop.closingday.CyclicRegularClosing; +import com.bluedelivery.shop.closingday.CyclicRegularClosing; import com.fasterxml.jackson.databind.ObjectMapper; @SpringBootTest diff --git a/src/test/java/com/delivery/shop/shop/ShopUpdateServiceTest.java b/src/test/java/com/bluedelivery/shop/shop/ShopUpdateServiceTest.java similarity index 89% rename from src/test/java/com/delivery/shop/shop/ShopUpdateServiceTest.java rename to src/test/java/com/bluedelivery/shop/shop/ShopUpdateServiceTest.java index d0414e41..8dfa7160 100644 --- a/src/test/java/com/delivery/shop/shop/ShopUpdateServiceTest.java +++ b/src/test/java/com/bluedelivery/shop/shop/ShopUpdateServiceTest.java @@ -1,4 +1,4 @@ -package com.delivery.shop.shop; +package com.bluedelivery.shop.shop; import static org.assertj.core.api.Assertions.*; import static org.mockito.Mockito.when; @@ -10,16 +10,15 @@ import java.util.List; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import com.delivery.shop.category.CategoryManagerService; -import com.delivery.shop.closingday.CyclicRegularClosing; -import com.delivery.shop.closingday.LegalHolidayClosing; +import com.bluedelivery.shop.category.CategoryManagerService; +import com.bluedelivery.shop.closingday.CyclicRegularClosing; +import com.bluedelivery.shop.closingday.LegalHolidayClosing; @ExtendWith(MockitoExtension.class) class ShopUpdateServiceTest { diff --git a/src/test/java/com/delivery/user/UserTest.java b/src/test/java/com/bluedelivery/user/UserTest.java similarity index 74% rename from src/test/java/com/delivery/user/UserTest.java rename to src/test/java/com/bluedelivery/user/UserTest.java index b8526bd7..e4dd8278 100644 --- a/src/test/java/com/delivery/user/UserTest.java +++ b/src/test/java/com/bluedelivery/user/UserTest.java @@ -1,16 +1,13 @@ -package com.delivery.user; +package com.bluedelivery.user; import static org.assertj.core.api.Assertions.*; -import static org.junit.jupiter.api.Assertions.*; import java.time.LocalDate; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import com.delivery.exception.ApiException; -import com.delivery.response.ErrorCode; -import com.delivery.user.domain.User; +import com.bluedelivery.user.domain.User; class UserTest { diff --git a/src/test/java/com/delivery/user/application/UserManagementServiceTest.java b/src/test/java/com/bluedelivery/user/application/UserManagementServiceTest.java similarity index 88% rename from src/test/java/com/delivery/user/application/UserManagementServiceTest.java rename to src/test/java/com/bluedelivery/user/application/UserManagementServiceTest.java index 036a9aea..998779cb 100644 --- a/src/test/java/com/delivery/user/application/UserManagementServiceTest.java +++ b/src/test/java/com/bluedelivery/user/application/UserManagementServiceTest.java @@ -1,4 +1,4 @@ -package com.delivery.user.application; +package com.bluedelivery.user.application; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.*; @@ -15,11 +15,11 @@ import org.mockito.junit.jupiter.MockitoExtension; import org.springframework.dao.DuplicateKeyException; -import com.delivery.exception.ApiException; -import com.delivery.response.ErrorCode; -import com.delivery.user.domain.UserRepository; -import com.delivery.user.web.dto.UserRegisterParam; -import com.delivery.utility.address.AddressService; +import com.bluedelivery.exception.ApiException; +import com.bluedelivery.response.ErrorCode; +import com.bluedelivery.user.domain.UserRepository; +import com.bluedelivery.user.web.dto.UserRegisterParam; +import com.bluedelivery.utility.address.AddressService; @ExtendWith(MockitoExtension.class) class UserManagementServiceTest { diff --git a/src/test/java/com/delivery/user/web/AuthenticationControllerLoginTest.java b/src/test/java/com/bluedelivery/user/web/AuthenticationControllerLoginTest.java similarity index 87% rename from src/test/java/com/delivery/user/web/AuthenticationControllerLoginTest.java rename to src/test/java/com/bluedelivery/user/web/AuthenticationControllerLoginTest.java index fab37d40..bbea0580 100644 --- a/src/test/java/com/delivery/user/web/AuthenticationControllerLoginTest.java +++ b/src/test/java/com/bluedelivery/user/web/AuthenticationControllerLoginTest.java @@ -1,4 +1,4 @@ -package com.delivery.user.web; +package com.bluedelivery.user.web; import static org.hamcrest.Matchers.*; import static org.mockito.Mockito.when; @@ -17,10 +17,10 @@ import org.springframework.test.web.servlet.ResultActions; import org.springframework.test.web.servlet.setup.MockMvcBuilders; -import com.delivery.authentication.Authentication; -import com.delivery.authentication.AuthenticationService; -import com.delivery.config.resolver.AuthenticatedUserArgumentResolver; -import com.delivery.user.web.dto.UserLoginParam.UserLoginRequest; +import com.bluedelivery.authentication.Authentication; +import com.bluedelivery.authentication.AuthenticationService; +import com.bluedelivery.config.resolver.AuthenticatedUserArgumentResolver; +import com.bluedelivery.user.web.dto.UserLoginParam.UserLoginRequest; import com.fasterxml.jackson.databind.ObjectMapper; @ExtendWith({MockitoExtension.class}) diff --git a/src/test/java/com/delivery/user/web/UserManagementControllerTest.java b/src/test/java/com/bluedelivery/user/web/UserManagementControllerTest.java similarity index 92% rename from src/test/java/com/delivery/user/web/UserManagementControllerTest.java rename to src/test/java/com/bluedelivery/user/web/UserManagementControllerTest.java index dd596e8e..363e7039 100644 --- a/src/test/java/com/delivery/user/web/UserManagementControllerTest.java +++ b/src/test/java/com/bluedelivery/user/web/UserManagementControllerTest.java @@ -1,4 +1,4 @@ -package com.delivery.user.web; +package com.bluedelivery.user.web; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; @@ -14,15 +14,14 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MvcResult; import org.springframework.test.web.servlet.setup.MockMvcBuilders; -import com.delivery.config.GlobalExceptionHandler; -import com.delivery.user.application.UserManagementService; -import com.delivery.user.web.dto.UserRegisterParam; +import com.bluedelivery.config.GlobalExceptionHandler; +import com.bluedelivery.user.application.UserManagementService; +import com.bluedelivery.user.web.dto.UserRegisterParam; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; diff --git a/src/test/java/com/delivery/utility/EncryptUtilsTest.java b/src/test/java/com/bluedelivery/utility/EncryptUtilsTest.java similarity index 90% rename from src/test/java/com/delivery/utility/EncryptUtilsTest.java rename to src/test/java/com/bluedelivery/utility/EncryptUtilsTest.java index c8ba44c1..ad62a7c7 100644 --- a/src/test/java/com/delivery/utility/EncryptUtilsTest.java +++ b/src/test/java/com/bluedelivery/utility/EncryptUtilsTest.java @@ -1,4 +1,4 @@ -package com.delivery.utility; +package com.bluedelivery.utility; import static org.assertj.core.api.Assertions.assertThat; diff --git a/src/test/java/com/delivery/utility/PasswordRegexTest.java b/src/test/java/com/bluedelivery/utility/PasswordRegexTest.java similarity index 95% rename from src/test/java/com/delivery/utility/PasswordRegexTest.java rename to src/test/java/com/bluedelivery/utility/PasswordRegexTest.java index 5310b76b..1950c5b3 100644 --- a/src/test/java/com/delivery/utility/PasswordRegexTest.java +++ b/src/test/java/com/bluedelivery/utility/PasswordRegexTest.java @@ -1,4 +1,4 @@ -package com.delivery.utility; +package com.bluedelivery.utility; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.DisplayName; diff --git a/src/test/java/com/delivery/utility/PhoneRegexTest.java b/src/test/java/com/bluedelivery/utility/PhoneRegexTest.java similarity index 95% rename from src/test/java/com/delivery/utility/PhoneRegexTest.java rename to src/test/java/com/bluedelivery/utility/PhoneRegexTest.java index dede235e..391d27bf 100644 --- a/src/test/java/com/delivery/utility/PhoneRegexTest.java +++ b/src/test/java/com/bluedelivery/utility/PhoneRegexTest.java @@ -1,4 +1,4 @@ -package com.delivery.utility; +package com.bluedelivery.utility; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.DisplayName; diff --git a/src/test/java/com/delivery/utility/ShopPhoneRegexTest.java b/src/test/java/com/bluedelivery/utility/ShopPhoneRegexTest.java similarity index 92% rename from src/test/java/com/delivery/utility/ShopPhoneRegexTest.java rename to src/test/java/com/bluedelivery/utility/ShopPhoneRegexTest.java index 9cf83397..fe275c05 100644 --- a/src/test/java/com/delivery/utility/ShopPhoneRegexTest.java +++ b/src/test/java/com/bluedelivery/utility/ShopPhoneRegexTest.java @@ -1,8 +1,7 @@ -package com.delivery.utility; +package com.bluedelivery.utility; import static org.assertj.core.api.Assertions.*; -import org.assertj.core.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; diff --git a/src/test/java/com/delivery/utility/address/AddressesTest.java b/src/test/java/com/bluedelivery/utility/address/AddressesTest.java similarity index 97% rename from src/test/java/com/delivery/utility/address/AddressesTest.java rename to src/test/java/com/bluedelivery/utility/address/AddressesTest.java index e7c0bc4a..3552cdee 100644 --- a/src/test/java/com/delivery/utility/address/AddressesTest.java +++ b/src/test/java/com/bluedelivery/utility/address/AddressesTest.java @@ -1,4 +1,4 @@ -package com.delivery.utility.address; +package com.bluedelivery.utility.address; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -6,8 +6,8 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import com.delivery.exception.ApiException; -import com.delivery.response.ErrorCode; +import com.bluedelivery.exception.ApiException; +import com.bluedelivery.response.ErrorCode; class AddressesTest { From d3f46c70f991ca5e6be08442a1fc1de8c98bbf73 Mon Sep 17 00:00:00 2001 From: soongjamm Date: Tue, 27 Jul 2021 12:16:22 +0900 Subject: [PATCH 02/18] =?UTF-8?q?common.authentication=20=ED=8C=A8?= =?UTF-8?q?=ED=82=A4=EC=A7=80=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../authentication/Authentication.java | 42 ----------- .../authentication/InvalidLoginException.java | 4 -- .../{utility => common}/EncryptUtils.java | 2 +- .../{utility => common}/RegexConstants.java | 2 +- .../{utility => common}/address/Address.java | 2 +- .../address/AddressRepository.java | 2 +- .../address/AddressService.java | 2 +- .../address/AddressServiceImpl.java | 2 +- .../address/Addresses.java | 2 +- .../address/BuildingInfo.java | 2 +- .../address/BuildingInfoRepository.java | 2 +- .../address/CityToDong.java | 2 +- .../AuthenticatedUserArgumentResolver.java | 6 +- .../AuthenticationRequired.java | 2 +- .../authentication}/UserAuthInterceptor.java | 6 +- .../api}/AuthenticationController.java | 9 ++- .../authentication/api/LoginRequest.java | 20 ++++++ .../AuthenticationControllerImpl.java | 11 +-- .../AuthenticationFailedException.java | 4 ++ .../application}/AuthenticationService.java | 6 +- .../application/LoginTarget.java | 15 ++++ .../adapter/AuthenticationServiceHttp.java} | 15 ++-- .../authentication/domain/Authentication.java | 72 +++++++++++++++++++ .../domain}/AuthenticationRepository.java | 4 +- .../infra}/AuthenticationRedisRepository.java | 5 +- .../com/bluedelivery/config/RedisConfig.java | 6 +- .../com/bluedelivery/config/WebConfig.java | 6 +- .../shop/category/CreateCategoryParam.java | 2 +- .../shop/category/EditCategoryParam.java | 2 +- .../shop/shop/EditPhoneRequest.java | 2 +- .../application/UserManagementService.java | 2 +- .../UserManagementServiceHttp.java | 6 +- .../com/bluedelivery/user/domain/User.java | 4 +- .../user/web/UserManagementController.java | 4 +- .../web/UserManagementControllerImpl.java | 6 +- .../user/web/dto/UpdateAccountParam.java | 2 +- .../user/web/dto/UserLoginParam.java | 30 -------- .../user/web/dto/UserRegisterParam.java | 2 +- .../{utility => common}/EncryptUtilsTest.java | 2 +- .../PasswordRegexTest.java | 2 +- .../{utility => common}/PhoneRegexTest.java | 2 +- .../ShopPhoneRegexTest.java | 2 +- .../address/AddressesTest.java | 2 +- .../interceptor/UserAuthInterceptorTest.java | 7 +- ...AuthenticatedUserArgumentResolverTest.java | 5 +- .../shop/menu/MenuOptionControllerTest.java | 4 +- .../UserManagementServiceTest.java | 2 +- .../AuthenticationControllerLoginTest.java | 11 +-- 48 files changed, 197 insertions(+), 157 deletions(-) delete mode 100644 src/main/java/com/bluedelivery/authentication/Authentication.java delete mode 100644 src/main/java/com/bluedelivery/authentication/InvalidLoginException.java rename src/main/java/com/bluedelivery/{utility => common}/EncryptUtils.java (94%) rename src/main/java/com/bluedelivery/{utility => common}/RegexConstants.java (90%) rename src/main/java/com/bluedelivery/{utility => common}/address/Address.java (97%) rename src/main/java/com/bluedelivery/{utility => common}/address/AddressRepository.java (86%) rename src/main/java/com/bluedelivery/{utility => common}/address/AddressService.java (95%) rename src/main/java/com/bluedelivery/{utility => common}/address/AddressServiceImpl.java (95%) rename src/main/java/com/bluedelivery/{utility => common}/address/Addresses.java (97%) rename src/main/java/com/bluedelivery/{utility => common}/address/BuildingInfo.java (99%) rename src/main/java/com/bluedelivery/{utility => common}/address/BuildingInfoRepository.java (78%) rename src/main/java/com/bluedelivery/{utility => common}/address/CityToDong.java (96%) rename src/main/java/com/bluedelivery/{config/resolver => common/authentication}/AuthenticatedUserArgumentResolver.java (88%) rename src/main/java/com/bluedelivery/{config/interceptor => common/authentication}/AuthenticationRequired.java (85%) rename src/main/java/com/bluedelivery/{config/interceptor => common/authentication}/UserAuthInterceptor.java (91%) rename src/main/java/com/bluedelivery/{user/web => common/authentication/api}/AuthenticationController.java (76%) create mode 100644 src/main/java/com/bluedelivery/common/authentication/api/LoginRequest.java rename src/main/java/com/bluedelivery/{user/web => common/authentication/api/adapter}/AuthenticationControllerImpl.java (78%) create mode 100644 src/main/java/com/bluedelivery/common/authentication/application/AuthenticationFailedException.java rename src/main/java/com/bluedelivery/{authentication => common/authentication/application}/AuthenticationService.java (57%) create mode 100644 src/main/java/com/bluedelivery/common/authentication/application/LoginTarget.java rename src/main/java/com/bluedelivery/{authentication/AuthenticationServiceImpl.java => common/authentication/application/adapter/AuthenticationServiceHttp.java} (69%) create mode 100644 src/main/java/com/bluedelivery/common/authentication/domain/Authentication.java rename src/main/java/com/bluedelivery/{config/interceptor => common/authentication/domain}/AuthenticationRepository.java (70%) rename src/main/java/com/bluedelivery/{config/interceptor => common/authentication/infra}/AuthenticationRedisRepository.java (85%) delete mode 100644 src/main/java/com/bluedelivery/user/web/dto/UserLoginParam.java rename src/test/java/com/bluedelivery/{utility => common}/EncryptUtilsTest.java (90%) rename src/test/java/com/bluedelivery/{utility => common}/PasswordRegexTest.java (95%) rename src/test/java/com/bluedelivery/{utility => common}/PhoneRegexTest.java (95%) rename src/test/java/com/bluedelivery/{utility => common}/ShopPhoneRegexTest.java (96%) rename src/test/java/com/bluedelivery/{utility => common}/address/AddressesTest.java (99%) diff --git a/src/main/java/com/bluedelivery/authentication/Authentication.java b/src/main/java/com/bluedelivery/authentication/Authentication.java deleted file mode 100644 index b1f75167..00000000 --- a/src/main/java/com/bluedelivery/authentication/Authentication.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.bluedelivery.authentication; - -import java.io.Serializable; -import java.time.Duration; -import java.time.Instant; - -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.ToString; - -@ToString -@EqualsAndHashCode -@Getter -public class Authentication implements Serializable { - public static String AUTH_STR = "auth"; - private String token; - private Long userId; - private Instant creationTime = Instant.now(); - private Duration maxInactiveTime = Duration.ofDays(5); - private boolean invalidated = false; - - protected Authentication() { - } - - public Authentication(String token, Long userId) { - this.token = token; - this.userId = userId; - } - - public void invalidate() { - this.invalidated = true; - } - - public boolean isInvalidated() { - if (maxInactiveTime.isNegative()) { - return false; - } - Instant now = Instant.now(); - return invalidated || now.minus(maxInactiveTime).compareTo(now) >= 0; - } - -} diff --git a/src/main/java/com/bluedelivery/authentication/InvalidLoginException.java b/src/main/java/com/bluedelivery/authentication/InvalidLoginException.java deleted file mode 100644 index 6c557d64..00000000 --- a/src/main/java/com/bluedelivery/authentication/InvalidLoginException.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.bluedelivery.authentication; - -public class InvalidLoginException extends RuntimeException { -} diff --git a/src/main/java/com/bluedelivery/utility/EncryptUtils.java b/src/main/java/com/bluedelivery/common/EncryptUtils.java similarity index 94% rename from src/main/java/com/bluedelivery/utility/EncryptUtils.java rename to src/main/java/com/bluedelivery/common/EncryptUtils.java index ffe7caf0..078603b0 100644 --- a/src/main/java/com/bluedelivery/utility/EncryptUtils.java +++ b/src/main/java/com/bluedelivery/common/EncryptUtils.java @@ -1,4 +1,4 @@ -package com.bluedelivery.utility; +package com.bluedelivery.common; import java.nio.charset.StandardCharsets; import java.security.MessageDigest; diff --git a/src/main/java/com/bluedelivery/utility/RegexConstants.java b/src/main/java/com/bluedelivery/common/RegexConstants.java similarity index 90% rename from src/main/java/com/bluedelivery/utility/RegexConstants.java rename to src/main/java/com/bluedelivery/common/RegexConstants.java index 20e89b8a..25237d5c 100644 --- a/src/main/java/com/bluedelivery/utility/RegexConstants.java +++ b/src/main/java/com/bluedelivery/common/RegexConstants.java @@ -1,4 +1,4 @@ -package com.bluedelivery.utility; +package com.bluedelivery.common; public interface RegexConstants { String PHONE = "^01([0|1|6|7|8|9]?)-?([0-9]{3,4})-?([0-9]{4})$"; diff --git a/src/main/java/com/bluedelivery/utility/address/Address.java b/src/main/java/com/bluedelivery/common/address/Address.java similarity index 97% rename from src/main/java/com/bluedelivery/utility/address/Address.java rename to src/main/java/com/bluedelivery/common/address/Address.java index 2e43badf..4050b2c4 100644 --- a/src/main/java/com/bluedelivery/utility/address/Address.java +++ b/src/main/java/com/bluedelivery/common/address/Address.java @@ -1,4 +1,4 @@ -package com.bluedelivery.utility.address; +package com.bluedelivery.common.address; import java.util.Objects; diff --git a/src/main/java/com/bluedelivery/utility/address/AddressRepository.java b/src/main/java/com/bluedelivery/common/address/AddressRepository.java similarity index 86% rename from src/main/java/com/bluedelivery/utility/address/AddressRepository.java rename to src/main/java/com/bluedelivery/common/address/AddressRepository.java index 2729a8d6..0271e121 100644 --- a/src/main/java/com/bluedelivery/utility/address/AddressRepository.java +++ b/src/main/java/com/bluedelivery/common/address/AddressRepository.java @@ -1,4 +1,4 @@ -package com.bluedelivery.utility.address; +package com.bluedelivery.common.address; import java.util.Optional; diff --git a/src/main/java/com/bluedelivery/utility/address/AddressService.java b/src/main/java/com/bluedelivery/common/address/AddressService.java similarity index 95% rename from src/main/java/com/bluedelivery/utility/address/AddressService.java rename to src/main/java/com/bluedelivery/common/address/AddressService.java index b4994c5f..1b0de871 100644 --- a/src/main/java/com/bluedelivery/utility/address/AddressService.java +++ b/src/main/java/com/bluedelivery/common/address/AddressService.java @@ -1,4 +1,4 @@ -package com.bluedelivery.utility.address; +package com.bluedelivery.common.address; import com.bluedelivery.exception.ApiException; import com.bluedelivery.user.domain.User; diff --git a/src/main/java/com/bluedelivery/utility/address/AddressServiceImpl.java b/src/main/java/com/bluedelivery/common/address/AddressServiceImpl.java similarity index 95% rename from src/main/java/com/bluedelivery/utility/address/AddressServiceImpl.java rename to src/main/java/com/bluedelivery/common/address/AddressServiceImpl.java index 8ce104a1..74b0e2dc 100644 --- a/src/main/java/com/bluedelivery/utility/address/AddressServiceImpl.java +++ b/src/main/java/com/bluedelivery/common/address/AddressServiceImpl.java @@ -1,4 +1,4 @@ -package com.bluedelivery.utility.address; +package com.bluedelivery.common.address; import static com.bluedelivery.response.ErrorCode.ADDRESS_DOES_NOT_EXIST; diff --git a/src/main/java/com/bluedelivery/utility/address/Addresses.java b/src/main/java/com/bluedelivery/common/address/Addresses.java similarity index 97% rename from src/main/java/com/bluedelivery/utility/address/Addresses.java rename to src/main/java/com/bluedelivery/common/address/Addresses.java index be00e423..3732fe3f 100644 --- a/src/main/java/com/bluedelivery/utility/address/Addresses.java +++ b/src/main/java/com/bluedelivery/common/address/Addresses.java @@ -1,4 +1,4 @@ -package com.bluedelivery.utility.address; +package com.bluedelivery.common.address; import static com.bluedelivery.response.ErrorCode.*; import static java.util.Objects.isNull; diff --git a/src/main/java/com/bluedelivery/utility/address/BuildingInfo.java b/src/main/java/com/bluedelivery/common/address/BuildingInfo.java similarity index 99% rename from src/main/java/com/bluedelivery/utility/address/BuildingInfo.java rename to src/main/java/com/bluedelivery/common/address/BuildingInfo.java index 92ecdf9e..a31fde72 100644 --- a/src/main/java/com/bluedelivery/utility/address/BuildingInfo.java +++ b/src/main/java/com/bluedelivery/common/address/BuildingInfo.java @@ -1,4 +1,4 @@ -package com.bluedelivery.utility.address; +package com.bluedelivery.common.address; import java.math.BigDecimal; import java.util.Objects; diff --git a/src/main/java/com/bluedelivery/utility/address/BuildingInfoRepository.java b/src/main/java/com/bluedelivery/common/address/BuildingInfoRepository.java similarity index 78% rename from src/main/java/com/bluedelivery/utility/address/BuildingInfoRepository.java rename to src/main/java/com/bluedelivery/common/address/BuildingInfoRepository.java index e3668748..5e250f9e 100644 --- a/src/main/java/com/bluedelivery/utility/address/BuildingInfoRepository.java +++ b/src/main/java/com/bluedelivery/common/address/BuildingInfoRepository.java @@ -1,4 +1,4 @@ -package com.bluedelivery.utility.address; +package com.bluedelivery.common.address; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/src/main/java/com/bluedelivery/utility/address/CityToDong.java b/src/main/java/com/bluedelivery/common/address/CityToDong.java similarity index 96% rename from src/main/java/com/bluedelivery/utility/address/CityToDong.java rename to src/main/java/com/bluedelivery/common/address/CityToDong.java index bdfb5df7..45b58a91 100644 --- a/src/main/java/com/bluedelivery/utility/address/CityToDong.java +++ b/src/main/java/com/bluedelivery/common/address/CityToDong.java @@ -1,4 +1,4 @@ -package com.bluedelivery.utility.address; +package com.bluedelivery.common.address; import javax.persistence.Entity; import javax.persistence.Id; diff --git a/src/main/java/com/bluedelivery/config/resolver/AuthenticatedUserArgumentResolver.java b/src/main/java/com/bluedelivery/common/authentication/AuthenticatedUserArgumentResolver.java similarity index 88% rename from src/main/java/com/bluedelivery/config/resolver/AuthenticatedUserArgumentResolver.java rename to src/main/java/com/bluedelivery/common/authentication/AuthenticatedUserArgumentResolver.java index 11494d94..580dd2db 100644 --- a/src/main/java/com/bluedelivery/config/resolver/AuthenticatedUserArgumentResolver.java +++ b/src/main/java/com/bluedelivery/common/authentication/AuthenticatedUserArgumentResolver.java @@ -1,4 +1,4 @@ -package com.bluedelivery.config.resolver; +package com.bluedelivery.common.authentication; import static org.springframework.http.HttpHeaders.AUTHORIZATION; @@ -14,8 +14,8 @@ import org.springframework.web.method.support.HandlerMethodArgumentResolver; import org.springframework.web.method.support.ModelAndViewContainer; -import com.bluedelivery.authentication.Authentication; -import com.bluedelivery.authentication.AuthenticationService; +import com.bluedelivery.common.authentication.application.AuthenticationService; +import com.bluedelivery.common.authentication.domain.Authentication; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/bluedelivery/config/interceptor/AuthenticationRequired.java b/src/main/java/com/bluedelivery/common/authentication/AuthenticationRequired.java similarity index 85% rename from src/main/java/com/bluedelivery/config/interceptor/AuthenticationRequired.java rename to src/main/java/com/bluedelivery/common/authentication/AuthenticationRequired.java index 42fed160..0596255e 100644 --- a/src/main/java/com/bluedelivery/config/interceptor/AuthenticationRequired.java +++ b/src/main/java/com/bluedelivery/common/authentication/AuthenticationRequired.java @@ -1,4 +1,4 @@ -package com.bluedelivery.config.interceptor; +package com.bluedelivery.common.authentication; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/src/main/java/com/bluedelivery/config/interceptor/UserAuthInterceptor.java b/src/main/java/com/bluedelivery/common/authentication/UserAuthInterceptor.java similarity index 91% rename from src/main/java/com/bluedelivery/config/interceptor/UserAuthInterceptor.java rename to src/main/java/com/bluedelivery/common/authentication/UserAuthInterceptor.java index f425388f..7641f7b9 100644 --- a/src/main/java/com/bluedelivery/config/interceptor/UserAuthInterceptor.java +++ b/src/main/java/com/bluedelivery/common/authentication/UserAuthInterceptor.java @@ -1,4 +1,4 @@ -package com.bluedelivery.config.interceptor; +package com.bluedelivery.common.authentication; import static com.bluedelivery.response.ErrorCode.INVALID_AUTHENTICATION; import static com.bluedelivery.response.ErrorCode.NOT_AUTHORIZED_ACCESS; @@ -14,8 +14,8 @@ import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.HandlerMapping; -import com.bluedelivery.authentication.Authentication; -import com.bluedelivery.authentication.AuthenticationService; +import com.bluedelivery.common.authentication.application.AuthenticationService; +import com.bluedelivery.common.authentication.domain.Authentication; import com.bluedelivery.exception.ApiException; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/bluedelivery/user/web/AuthenticationController.java b/src/main/java/com/bluedelivery/common/authentication/api/AuthenticationController.java similarity index 76% rename from src/main/java/com/bluedelivery/user/web/AuthenticationController.java rename to src/main/java/com/bluedelivery/common/authentication/api/AuthenticationController.java index 5d74d071..3d404d85 100644 --- a/src/main/java/com/bluedelivery/user/web/AuthenticationController.java +++ b/src/main/java/com/bluedelivery/common/authentication/api/AuthenticationController.java @@ -1,13 +1,12 @@ -package com.bluedelivery.user.web; +package com.bluedelivery.common.authentication.api; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; -import com.bluedelivery.authentication.Authentication; +import com.bluedelivery.common.authentication.domain.Authentication; import com.bluedelivery.response.HttpResponse; -import com.bluedelivery.user.web.dto.UserLoginParam.UserLoginRequest; @RequestMapping("/auth") public interface AuthenticationController { @@ -18,9 +17,9 @@ public interface AuthenticationController { * @param loggedIn 이미 인증된 객체 * @param loginRequest 로그인 정보 */ - @PostMapping("login") + @PostMapping("/login") ResponseEntity> login(Authentication loggedIn, - @RequestBody UserLoginRequest loginRequest); + @RequestBody LoginRequest loginRequest); @PostMapping("/logout") ResponseEntity logout(Authentication loggedIn); diff --git a/src/main/java/com/bluedelivery/common/authentication/api/LoginRequest.java b/src/main/java/com/bluedelivery/common/authentication/api/LoginRequest.java new file mode 100644 index 00000000..21af30e4 --- /dev/null +++ b/src/main/java/com/bluedelivery/common/authentication/api/LoginRequest.java @@ -0,0 +1,20 @@ +package com.bluedelivery.common.authentication.api; + +import com.bluedelivery.common.authentication.application.LoginTarget; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Getter +@NoArgsConstructor +@AllArgsConstructor +public class LoginRequest { + + private String email; + private String password; + + public LoginTarget toParam() { + return new LoginTarget(email, password); + } +} diff --git a/src/main/java/com/bluedelivery/user/web/AuthenticationControllerImpl.java b/src/main/java/com/bluedelivery/common/authentication/api/adapter/AuthenticationControllerImpl.java similarity index 78% rename from src/main/java/com/bluedelivery/user/web/AuthenticationControllerImpl.java rename to src/main/java/com/bluedelivery/common/authentication/api/adapter/AuthenticationControllerImpl.java index 45aea111..f3bdfd8d 100644 --- a/src/main/java/com/bluedelivery/user/web/AuthenticationControllerImpl.java +++ b/src/main/java/com/bluedelivery/common/authentication/api/adapter/AuthenticationControllerImpl.java @@ -1,4 +1,4 @@ -package com.bluedelivery.user.web; +package com.bluedelivery.common.authentication.api.adapter; import static com.bluedelivery.response.ErrorCode.ALREADY_LOGGED_IN; import static com.bluedelivery.response.ErrorCode.USER_NOT_FOUND; @@ -9,11 +9,12 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; -import com.bluedelivery.authentication.Authentication; -import com.bluedelivery.authentication.AuthenticationService; +import com.bluedelivery.common.authentication.api.AuthenticationController; +import com.bluedelivery.common.authentication.api.LoginRequest; +import com.bluedelivery.common.authentication.application.AuthenticationService; +import com.bluedelivery.common.authentication.domain.Authentication; import com.bluedelivery.exception.ApiException; import com.bluedelivery.response.HttpResponse; -import com.bluedelivery.user.web.dto.UserLoginParam.UserLoginRequest; import lombok.RequiredArgsConstructor; @@ -24,7 +25,7 @@ public class AuthenticationControllerImpl implements AuthenticationController { private final AuthenticationService authService; @Override - public ResponseEntity> login(Authentication loggedIn, UserLoginRequest dto) { + public ResponseEntity> login(Authentication loggedIn, LoginRequest dto) { if (loggedIn != null) { throw new ApiException(ALREADY_LOGGED_IN); } diff --git a/src/main/java/com/bluedelivery/common/authentication/application/AuthenticationFailedException.java b/src/main/java/com/bluedelivery/common/authentication/application/AuthenticationFailedException.java new file mode 100644 index 00000000..7c3e0ac5 --- /dev/null +++ b/src/main/java/com/bluedelivery/common/authentication/application/AuthenticationFailedException.java @@ -0,0 +1,4 @@ +package com.bluedelivery.common.authentication.application; + +public class AuthenticationFailedException extends RuntimeException { +} diff --git a/src/main/java/com/bluedelivery/authentication/AuthenticationService.java b/src/main/java/com/bluedelivery/common/authentication/application/AuthenticationService.java similarity index 57% rename from src/main/java/com/bluedelivery/authentication/AuthenticationService.java rename to src/main/java/com/bluedelivery/common/authentication/application/AuthenticationService.java index 784aafde..721a1f29 100644 --- a/src/main/java/com/bluedelivery/authentication/AuthenticationService.java +++ b/src/main/java/com/bluedelivery/common/authentication/application/AuthenticationService.java @@ -1,15 +1,15 @@ -package com.bluedelivery.authentication; +package com.bluedelivery.common.authentication.application; import java.util.Optional; -import com.bluedelivery.user.web.dto.UserLoginParam; +import com.bluedelivery.common.authentication.domain.Authentication; public interface AuthenticationService { String BEARER_PREFIX = "Bearer "; Optional getAuthentication(String authenticationHeader); - Authentication authenticate(UserLoginParam loginDto); + Authentication authenticate(LoginTarget loginDto); void expire(Authentication loggedIn); } diff --git a/src/main/java/com/bluedelivery/common/authentication/application/LoginTarget.java b/src/main/java/com/bluedelivery/common/authentication/application/LoginTarget.java new file mode 100644 index 00000000..bef20049 --- /dev/null +++ b/src/main/java/com/bluedelivery/common/authentication/application/LoginTarget.java @@ -0,0 +1,15 @@ +package com.bluedelivery.common.authentication.application; + +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +@EqualsAndHashCode +@Getter +@RequiredArgsConstructor +public class LoginTarget { + private final String email; + private final String password; +} + + diff --git a/src/main/java/com/bluedelivery/authentication/AuthenticationServiceImpl.java b/src/main/java/com/bluedelivery/common/authentication/application/adapter/AuthenticationServiceHttp.java similarity index 69% rename from src/main/java/com/bluedelivery/authentication/AuthenticationServiceImpl.java rename to src/main/java/com/bluedelivery/common/authentication/application/adapter/AuthenticationServiceHttp.java index 7a5544d7..400ea124 100644 --- a/src/main/java/com/bluedelivery/authentication/AuthenticationServiceImpl.java +++ b/src/main/java/com/bluedelivery/common/authentication/application/adapter/AuthenticationServiceHttp.java @@ -1,4 +1,4 @@ -package com.bluedelivery.authentication; +package com.bluedelivery.common.authentication.application.adapter; import static java.util.Objects.nonNull; @@ -8,17 +8,20 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import com.bluedelivery.config.interceptor.AuthenticationRepository; +import com.bluedelivery.common.authentication.application.AuthenticationFailedException; +import com.bluedelivery.common.authentication.application.AuthenticationService; +import com.bluedelivery.common.authentication.application.LoginTarget; +import com.bluedelivery.common.authentication.domain.Authentication; +import com.bluedelivery.common.authentication.domain.AuthenticationRepository; import com.bluedelivery.user.domain.User; import com.bluedelivery.user.domain.UserRepository; -import com.bluedelivery.user.web.dto.UserLoginParam; import lombok.RequiredArgsConstructor; @RequiredArgsConstructor @Transactional @Service -public class AuthenticationServiceImpl implements AuthenticationService { +public class AuthenticationServiceHttp implements AuthenticationService { private final AuthenticationRepository authenticationRepository; private final UserRepository userRepository; @@ -29,11 +32,11 @@ public Optional getAuthentication(String authorization) { } @Override - public Authentication authenticate(UserLoginParam target) { + public Authentication authenticate(LoginTarget target) { User user = userRepository.findByEmail(target.getEmail()).orElseThrow(); boolean validate = user.validate(target.getPassword()); if (!validate) { - throw new InvalidLoginException(); + throw new AuthenticationFailedException(); } Authentication auth = new Authentication(UUID.randomUUID().toString(), user.getId()); authenticationRepository.save(auth); diff --git a/src/main/java/com/bluedelivery/common/authentication/domain/Authentication.java b/src/main/java/com/bluedelivery/common/authentication/domain/Authentication.java new file mode 100644 index 00000000..dcec40fe --- /dev/null +++ b/src/main/java/com/bluedelivery/common/authentication/domain/Authentication.java @@ -0,0 +1,72 @@ +package com.bluedelivery.common.authentication.domain; + +import java.io.Serializable; +import java.time.Duration; +import java.time.Instant; +import java.util.Objects; + +public class Authentication implements Serializable { + public static String AUTH_STR = "auth"; + private String token; + private Long userId; + private Instant creationTime = Instant.now(); + private Duration maxInactiveTime = Duration.ofDays(5); + private boolean invalidated = false; + + protected Authentication() { + } + + public Authentication(String token, Long userId) { + this.token = token; + this.userId = userId; + } + + public void invalidate() { + this.invalidated = true; + } + + public boolean isInvalidated() { + if (maxInactiveTime.isNegative()) { + return false; + } + Instant now = Instant.now(); + return invalidated || now.minus(maxInactiveTime).compareTo(now) >= 0; + } + + public String getToken() { + return token; + } + + public Long getUserId() { + return userId; + } + + public Instant getCreationTime() { + return creationTime; + } + + public Duration getMaxInactiveTime() { + return maxInactiveTime; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || getClass() != obj.getClass()) { + return false; + } + Authentication that = (Authentication) obj; + return invalidated == that.invalidated + && Objects.equals(token, that.token) + && Objects.equals(userId, that.userId) + && Objects.equals(creationTime, that.creationTime) + && Objects.equals(maxInactiveTime, that.maxInactiveTime); + } + + @Override + public int hashCode() { + return Objects.hash(token, userId, creationTime, maxInactiveTime, invalidated); + } +} diff --git a/src/main/java/com/bluedelivery/config/interceptor/AuthenticationRepository.java b/src/main/java/com/bluedelivery/common/authentication/domain/AuthenticationRepository.java similarity index 70% rename from src/main/java/com/bluedelivery/config/interceptor/AuthenticationRepository.java rename to src/main/java/com/bluedelivery/common/authentication/domain/AuthenticationRepository.java index a523b277..8cff687f 100644 --- a/src/main/java/com/bluedelivery/config/interceptor/AuthenticationRepository.java +++ b/src/main/java/com/bluedelivery/common/authentication/domain/AuthenticationRepository.java @@ -1,9 +1,7 @@ -package com.bluedelivery.config.interceptor; +package com.bluedelivery.common.authentication.domain; import java.util.Optional; -import com.bluedelivery.authentication.Authentication; - public interface AuthenticationRepository { Authentication save(Authentication authentication); diff --git a/src/main/java/com/bluedelivery/config/interceptor/AuthenticationRedisRepository.java b/src/main/java/com/bluedelivery/common/authentication/infra/AuthenticationRedisRepository.java similarity index 85% rename from src/main/java/com/bluedelivery/config/interceptor/AuthenticationRedisRepository.java rename to src/main/java/com/bluedelivery/common/authentication/infra/AuthenticationRedisRepository.java index 2f10db27..00832fc2 100644 --- a/src/main/java/com/bluedelivery/config/interceptor/AuthenticationRedisRepository.java +++ b/src/main/java/com/bluedelivery/common/authentication/infra/AuthenticationRedisRepository.java @@ -1,11 +1,12 @@ -package com.bluedelivery.config.interceptor; +package com.bluedelivery.common.authentication.infra; import java.util.Optional; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Repository; -import com.bluedelivery.authentication.Authentication; +import com.bluedelivery.common.authentication.domain.Authentication; +import com.bluedelivery.common.authentication.domain.AuthenticationRepository; @Repository public class AuthenticationRedisRepository implements AuthenticationRepository { diff --git a/src/main/java/com/bluedelivery/config/RedisConfig.java b/src/main/java/com/bluedelivery/config/RedisConfig.java index 0bdcf256..db2eb349 100644 --- a/src/main/java/com/bluedelivery/config/RedisConfig.java +++ b/src/main/java/com/bluedelivery/config/RedisConfig.java @@ -9,9 +9,9 @@ import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; import org.springframework.data.redis.serializer.StringRedisSerializer; -import com.bluedelivery.authentication.Authentication; -import com.bluedelivery.config.interceptor.AuthenticationRedisRepository; -import com.bluedelivery.config.interceptor.AuthenticationRepository; +import com.bluedelivery.common.authentication.domain.Authentication; +import com.bluedelivery.common.authentication.domain.AuthenticationRepository; +import com.bluedelivery.common.authentication.infra.AuthenticationRedisRepository; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; diff --git a/src/main/java/com/bluedelivery/config/WebConfig.java b/src/main/java/com/bluedelivery/config/WebConfig.java index 52cc0c62..26ed6b59 100644 --- a/src/main/java/com/bluedelivery/config/WebConfig.java +++ b/src/main/java/com/bluedelivery/config/WebConfig.java @@ -8,9 +8,9 @@ import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -import com.bluedelivery.authentication.AuthenticationService; -import com.bluedelivery.config.interceptor.UserAuthInterceptor; -import com.bluedelivery.config.resolver.AuthenticatedUserArgumentResolver; +import com.bluedelivery.common.authentication.AuthenticatedUserArgumentResolver; +import com.bluedelivery.common.authentication.UserAuthInterceptor; +import com.bluedelivery.common.authentication.application.AuthenticationService; @Configuration public class WebConfig implements WebMvcConfigurer { diff --git a/src/main/java/com/bluedelivery/shop/category/CreateCategoryParam.java b/src/main/java/com/bluedelivery/shop/category/CreateCategoryParam.java index a4301320..aa5723e7 100644 --- a/src/main/java/com/bluedelivery/shop/category/CreateCategoryParam.java +++ b/src/main/java/com/bluedelivery/shop/category/CreateCategoryParam.java @@ -2,7 +2,7 @@ import javax.validation.constraints.Pattern; -import com.bluedelivery.utility.RegexConstants; +import com.bluedelivery.common.RegexConstants; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/src/main/java/com/bluedelivery/shop/category/EditCategoryParam.java b/src/main/java/com/bluedelivery/shop/category/EditCategoryParam.java index 16f991ab..e109ac5e 100644 --- a/src/main/java/com/bluedelivery/shop/category/EditCategoryParam.java +++ b/src/main/java/com/bluedelivery/shop/category/EditCategoryParam.java @@ -2,7 +2,7 @@ import javax.validation.constraints.Pattern; -import com.bluedelivery.utility.RegexConstants; +import com.bluedelivery.common.RegexConstants; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/bluedelivery/shop/shop/EditPhoneRequest.java b/src/main/java/com/bluedelivery/shop/shop/EditPhoneRequest.java index de0a5659..8284f4d4 100644 --- a/src/main/java/com/bluedelivery/shop/shop/EditPhoneRequest.java +++ b/src/main/java/com/bluedelivery/shop/shop/EditPhoneRequest.java @@ -3,7 +3,7 @@ import javax.validation.constraints.NotBlank; import javax.validation.constraints.Pattern; -import com.bluedelivery.utility.RegexConstants; +import com.bluedelivery.common.RegexConstants; public class EditPhoneRequest { @Pattern(regexp = RegexConstants.SHOP_PHONE, message = "잘못된 번호 형식") diff --git a/src/main/java/com/bluedelivery/user/application/UserManagementService.java b/src/main/java/com/bluedelivery/user/application/UserManagementService.java index 5f828e05..59c91a95 100644 --- a/src/main/java/com/bluedelivery/user/application/UserManagementService.java +++ b/src/main/java/com/bluedelivery/user/application/UserManagementService.java @@ -1,11 +1,11 @@ package com.bluedelivery.user.application; +import com.bluedelivery.common.address.Address; import com.bluedelivery.user.domain.User; import com.bluedelivery.user.web.dto.AddressParam; import com.bluedelivery.user.web.dto.DeleteAccountParam; import com.bluedelivery.user.web.dto.UpdateAccountParam; import com.bluedelivery.user.web.dto.UserRegisterParam; -import com.bluedelivery.utility.address.Address; public interface UserManagementService { diff --git a/src/main/java/com/bluedelivery/user/application/UserManagementServiceHttp.java b/src/main/java/com/bluedelivery/user/application/UserManagementServiceHttp.java index 21dcb741..2eaa457a 100644 --- a/src/main/java/com/bluedelivery/user/application/UserManagementServiceHttp.java +++ b/src/main/java/com/bluedelivery/user/application/UserManagementServiceHttp.java @@ -5,6 +5,9 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import com.bluedelivery.common.address.Address; +import com.bluedelivery.common.address.AddressService; +import com.bluedelivery.common.address.BuildingInfo; import com.bluedelivery.exception.ApiException; import com.bluedelivery.response.ErrorCode; import com.bluedelivery.user.domain.User; @@ -13,9 +16,6 @@ import com.bluedelivery.user.web.dto.DeleteAccountParam; import com.bluedelivery.user.web.dto.UpdateAccountParam; import com.bluedelivery.user.web.dto.UserRegisterParam; -import com.bluedelivery.utility.address.Address; -import com.bluedelivery.utility.address.AddressService; -import com.bluedelivery.utility.address.BuildingInfo; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/bluedelivery/user/domain/User.java b/src/main/java/com/bluedelivery/user/domain/User.java index 37d84716..55eacecd 100644 --- a/src/main/java/com/bluedelivery/user/domain/User.java +++ b/src/main/java/com/bluedelivery/user/domain/User.java @@ -10,8 +10,8 @@ import javax.persistence.GenerationType; import javax.persistence.Id; -import com.bluedelivery.utility.address.Address; -import com.bluedelivery.utility.address.Addresses; +import com.bluedelivery.common.address.Address; +import com.bluedelivery.common.address.Addresses; @Entity public class User { diff --git a/src/main/java/com/bluedelivery/user/web/UserManagementController.java b/src/main/java/com/bluedelivery/user/web/UserManagementController.java index cc162c73..4666ba6a 100644 --- a/src/main/java/com/bluedelivery/user/web/UserManagementController.java +++ b/src/main/java/com/bluedelivery/user/web/UserManagementController.java @@ -13,8 +13,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; -import com.bluedelivery.authentication.Authentication; -import com.bluedelivery.config.interceptor.AuthenticationRequired; +import com.bluedelivery.common.authentication.AuthenticationRequired; +import com.bluedelivery.common.authentication.domain.Authentication; import com.bluedelivery.response.HttpResponse; import com.bluedelivery.user.web.dto.AddressParam.AddressRequest; import com.bluedelivery.user.web.dto.DeleteAccountParam.DeleteAccountRequest; diff --git a/src/main/java/com/bluedelivery/user/web/UserManagementControllerImpl.java b/src/main/java/com/bluedelivery/user/web/UserManagementControllerImpl.java index c5288e43..0bd81df1 100644 --- a/src/main/java/com/bluedelivery/user/web/UserManagementControllerImpl.java +++ b/src/main/java/com/bluedelivery/user/web/UserManagementControllerImpl.java @@ -1,6 +1,6 @@ package com.bluedelivery.user.web; -import static com.bluedelivery.authentication.Authentication.AUTH_STR; +import static com.bluedelivery.common.authentication.domain.Authentication.AUTH_STR; import static com.bluedelivery.response.HttpResponse.*; import static com.bluedelivery.user.web.dto.UpdateAccountParam.*; import static org.springframework.http.HttpStatus.*; @@ -12,13 +12,13 @@ import org.springframework.web.bind.annotation.InitBinder; import org.springframework.web.bind.annotation.RestController; -import com.bluedelivery.authentication.Authentication; +import com.bluedelivery.common.address.Address; +import com.bluedelivery.common.authentication.domain.Authentication; import com.bluedelivery.response.HttpResponse; import com.bluedelivery.user.application.UserManagementService; import com.bluedelivery.user.web.dto.AddressParam.AddressRequest; import com.bluedelivery.user.web.dto.DeleteAccountParam.DeleteAccountRequest; import com.bluedelivery.user.web.dto.UserRegisterParam; -import com.bluedelivery.utility.address.Address; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/bluedelivery/user/web/dto/UpdateAccountParam.java b/src/main/java/com/bluedelivery/user/web/dto/UpdateAccountParam.java index 87d2deb4..46b87ba0 100644 --- a/src/main/java/com/bluedelivery/user/web/dto/UpdateAccountParam.java +++ b/src/main/java/com/bluedelivery/user/web/dto/UpdateAccountParam.java @@ -5,7 +5,7 @@ import javax.validation.constraints.Past; import javax.validation.constraints.Pattern; -import com.bluedelivery.utility.RegexConstants; +import com.bluedelivery.common.RegexConstants; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/bluedelivery/user/web/dto/UserLoginParam.java b/src/main/java/com/bluedelivery/user/web/dto/UserLoginParam.java deleted file mode 100644 index 3aaf96a7..00000000 --- a/src/main/java/com/bluedelivery/user/web/dto/UserLoginParam.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.bluedelivery.user.web.dto; - -import lombok.AllArgsConstructor; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.RequiredArgsConstructor; - -@EqualsAndHashCode -@Getter -@RequiredArgsConstructor -public class UserLoginParam { - private final String email; - private final String password; - - @Getter - @NoArgsConstructor - @AllArgsConstructor - public static class UserLoginRequest { - private String email; - private String password; - - public UserLoginParam toParam() { - return new UserLoginParam(email, password); - } - } - -} - - diff --git a/src/main/java/com/bluedelivery/user/web/dto/UserRegisterParam.java b/src/main/java/com/bluedelivery/user/web/dto/UserRegisterParam.java index 4657da04..8df74f98 100644 --- a/src/main/java/com/bluedelivery/user/web/dto/UserRegisterParam.java +++ b/src/main/java/com/bluedelivery/user/web/dto/UserRegisterParam.java @@ -8,8 +8,8 @@ import javax.validation.constraints.Past; import javax.validation.constraints.Pattern; +import com.bluedelivery.common.RegexConstants; import com.bluedelivery.user.domain.User; -import com.bluedelivery.utility.RegexConstants; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/src/test/java/com/bluedelivery/utility/EncryptUtilsTest.java b/src/test/java/com/bluedelivery/common/EncryptUtilsTest.java similarity index 90% rename from src/test/java/com/bluedelivery/utility/EncryptUtilsTest.java rename to src/test/java/com/bluedelivery/common/EncryptUtilsTest.java index ad62a7c7..dca68a48 100644 --- a/src/test/java/com/bluedelivery/utility/EncryptUtilsTest.java +++ b/src/test/java/com/bluedelivery/common/EncryptUtilsTest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.utility; +package com.bluedelivery.common; import static org.assertj.core.api.Assertions.assertThat; diff --git a/src/test/java/com/bluedelivery/utility/PasswordRegexTest.java b/src/test/java/com/bluedelivery/common/PasswordRegexTest.java similarity index 95% rename from src/test/java/com/bluedelivery/utility/PasswordRegexTest.java rename to src/test/java/com/bluedelivery/common/PasswordRegexTest.java index 1950c5b3..e430620d 100644 --- a/src/test/java/com/bluedelivery/utility/PasswordRegexTest.java +++ b/src/test/java/com/bluedelivery/common/PasswordRegexTest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.utility; +package com.bluedelivery.common; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.DisplayName; diff --git a/src/test/java/com/bluedelivery/utility/PhoneRegexTest.java b/src/test/java/com/bluedelivery/common/PhoneRegexTest.java similarity index 95% rename from src/test/java/com/bluedelivery/utility/PhoneRegexTest.java rename to src/test/java/com/bluedelivery/common/PhoneRegexTest.java index 391d27bf..742fb771 100644 --- a/src/test/java/com/bluedelivery/utility/PhoneRegexTest.java +++ b/src/test/java/com/bluedelivery/common/PhoneRegexTest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.utility; +package com.bluedelivery.common; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.DisplayName; diff --git a/src/test/java/com/bluedelivery/utility/ShopPhoneRegexTest.java b/src/test/java/com/bluedelivery/common/ShopPhoneRegexTest.java similarity index 96% rename from src/test/java/com/bluedelivery/utility/ShopPhoneRegexTest.java rename to src/test/java/com/bluedelivery/common/ShopPhoneRegexTest.java index fe275c05..6dcc83cb 100644 --- a/src/test/java/com/bluedelivery/utility/ShopPhoneRegexTest.java +++ b/src/test/java/com/bluedelivery/common/ShopPhoneRegexTest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.utility; +package com.bluedelivery.common; import static org.assertj.core.api.Assertions.*; diff --git a/src/test/java/com/bluedelivery/utility/address/AddressesTest.java b/src/test/java/com/bluedelivery/common/address/AddressesTest.java similarity index 99% rename from src/test/java/com/bluedelivery/utility/address/AddressesTest.java rename to src/test/java/com/bluedelivery/common/address/AddressesTest.java index 3552cdee..0391a32d 100644 --- a/src/test/java/com/bluedelivery/utility/address/AddressesTest.java +++ b/src/test/java/com/bluedelivery/common/address/AddressesTest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.utility.address; +package com.bluedelivery.common.address; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/src/test/java/com/bluedelivery/config/interceptor/UserAuthInterceptorTest.java b/src/test/java/com/bluedelivery/config/interceptor/UserAuthInterceptorTest.java index 0e869ca4..6932a611 100644 --- a/src/test/java/com/bluedelivery/config/interceptor/UserAuthInterceptorTest.java +++ b/src/test/java/com/bluedelivery/config/interceptor/UserAuthInterceptorTest.java @@ -1,6 +1,6 @@ package com.bluedelivery.config.interceptor; -import static com.bluedelivery.authentication.AuthenticationService.BEARER_PREFIX; +import static com.bluedelivery.common.authentication.application.AuthenticationService.BEARER_PREFIX; import static org.mockito.Mockito.when; import static org.springframework.http.HttpHeaders.AUTHORIZATION; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; @@ -19,8 +19,9 @@ import org.springframework.test.web.servlet.ResultActions; import org.springframework.test.web.servlet.setup.MockMvcBuilders; -import com.bluedelivery.authentication.Authentication; -import com.bluedelivery.authentication.AuthenticationService; +import com.bluedelivery.common.authentication.UserAuthInterceptor; +import com.bluedelivery.common.authentication.application.AuthenticationService; +import com.bluedelivery.common.authentication.domain.Authentication; import com.bluedelivery.config.GlobalExceptionHandler; import com.bluedelivery.user.application.UserManagementService; import com.bluedelivery.user.web.PasswordValidator; diff --git a/src/test/java/com/bluedelivery/config/resolver/AuthenticatedUserArgumentResolverTest.java b/src/test/java/com/bluedelivery/config/resolver/AuthenticatedUserArgumentResolverTest.java index 75aa552e..4e5c5dee 100644 --- a/src/test/java/com/bluedelivery/config/resolver/AuthenticatedUserArgumentResolverTest.java +++ b/src/test/java/com/bluedelivery/config/resolver/AuthenticatedUserArgumentResolverTest.java @@ -9,8 +9,9 @@ import org.mockito.junit.jupiter.MockitoExtension; import org.springframework.core.MethodParameter; -import com.bluedelivery.authentication.Authentication; -import com.bluedelivery.authentication.AuthenticationService; +import com.bluedelivery.common.authentication.AuthenticatedUserArgumentResolver; +import com.bluedelivery.common.authentication.application.AuthenticationService; +import com.bluedelivery.common.authentication.domain.Authentication; @ExtendWith(MockitoExtension.class) class AuthenticatedUserArgumentResolverTest { diff --git a/src/test/java/com/bluedelivery/shop/menu/MenuOptionControllerTest.java b/src/test/java/com/bluedelivery/shop/menu/MenuOptionControllerTest.java index cb957a39..d9f17154 100644 --- a/src/test/java/com/bluedelivery/shop/menu/MenuOptionControllerTest.java +++ b/src/test/java/com/bluedelivery/shop/menu/MenuOptionControllerTest.java @@ -11,8 +11,8 @@ import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MockMvc; -import com.bluedelivery.authentication.AuthenticationService; -import com.bluedelivery.config.interceptor.AuthenticationRepository; +import com.bluedelivery.common.authentication.application.AuthenticationService; +import com.bluedelivery.common.authentication.domain.AuthenticationRepository; import com.fasterxml.jackson.databind.ObjectMapper; @WebMvcTest(MenuOptionControllerImpl.class) diff --git a/src/test/java/com/bluedelivery/user/application/UserManagementServiceTest.java b/src/test/java/com/bluedelivery/user/application/UserManagementServiceTest.java index 998779cb..a114ac11 100644 --- a/src/test/java/com/bluedelivery/user/application/UserManagementServiceTest.java +++ b/src/test/java/com/bluedelivery/user/application/UserManagementServiceTest.java @@ -15,11 +15,11 @@ import org.mockito.junit.jupiter.MockitoExtension; import org.springframework.dao.DuplicateKeyException; +import com.bluedelivery.common.address.AddressService; import com.bluedelivery.exception.ApiException; import com.bluedelivery.response.ErrorCode; import com.bluedelivery.user.domain.UserRepository; import com.bluedelivery.user.web.dto.UserRegisterParam; -import com.bluedelivery.utility.address.AddressService; @ExtendWith(MockitoExtension.class) class UserManagementServiceTest { diff --git a/src/test/java/com/bluedelivery/user/web/AuthenticationControllerLoginTest.java b/src/test/java/com/bluedelivery/user/web/AuthenticationControllerLoginTest.java index bbea0580..25b91370 100644 --- a/src/test/java/com/bluedelivery/user/web/AuthenticationControllerLoginTest.java +++ b/src/test/java/com/bluedelivery/user/web/AuthenticationControllerLoginTest.java @@ -17,10 +17,11 @@ import org.springframework.test.web.servlet.ResultActions; import org.springframework.test.web.servlet.setup.MockMvcBuilders; -import com.bluedelivery.authentication.Authentication; -import com.bluedelivery.authentication.AuthenticationService; -import com.bluedelivery.config.resolver.AuthenticatedUserArgumentResolver; -import com.bluedelivery.user.web.dto.UserLoginParam.UserLoginRequest; +import com.bluedelivery.common.authentication.AuthenticatedUserArgumentResolver; +import com.bluedelivery.common.authentication.api.LoginRequest; +import com.bluedelivery.common.authentication.api.adapter.AuthenticationControllerImpl; +import com.bluedelivery.common.authentication.application.AuthenticationService; +import com.bluedelivery.common.authentication.domain.Authentication; import com.fasterxml.jackson.databind.ObjectMapper; @ExtendWith({MockitoExtension.class}) @@ -43,7 +44,7 @@ void setup() { @DisplayName("성공적으로 로그인하면 Authentication 객체를 반환한다") void returnCustomSessionIfLoginSuccess() throws Exception { //given - UserLoginRequest dto = new UserLoginRequest("email", "password"); + LoginRequest dto = new LoginRequest("email", "password"); Authentication authentication = new Authentication("t0ken", 1L); when(authService.authenticate(dto.toParam())).thenReturn(authentication); From 020ead9053b9bd0e4c22126407d18d3d10c50b0f Mon Sep 17 00:00:00 2001 From: soongjamm Date: Tue, 27 Jul 2021 14:13:43 +0900 Subject: [PATCH 03/18] user package --- .../common/address/AddressService.java | 2 + .../common/address/AddressServiceImpl.java | 4 ++ .../common/address/{ => domain}/Address.java | 2 +- .../{ => domain}/AddressRepository.java | 2 +- .../address/{ => domain}/Addresses.java | 2 +- .../address/{ => domain}/BuildingInfo.java | 2 +- .../{ => domain}/BuildingInfoRepository.java | 4 +- .../address/{ => domain}/CityToDong.java | 2 +- .../user/{web => }/PasswordValidator.java | 4 +- .../UserManagementController.java | 14 ++-- .../UserManagementControllerImpl.java | 17 ++--- .../user/api/dto/AddAddressRequest.java | 19 ++++++ .../user/api/dto/DeleteAccountRequest.java | 25 ++++++++ .../user/api/dto/UpdateAccountRequest.java | 32 ++++++++++ .../user/api/dto/UserRegisterRequest.java | 49 ++++++++++++++ .../user/application/AddAddressTarget.java | 13 ++++ .../user/application/DeleteAccountTarget.java | 12 ++++ .../user/application/UpdateAccountTarget.java | 22 +++++++ .../application/UserManagementService.java | 16 ++--- .../user/application/UserRegisterTarget.java | 22 +++++++ .../UserManagementServiceHttp.java | 23 +++---- .../com/bluedelivery/user/domain/User.java | 4 +- .../user/{domain => infra}/UserMapper.java | 4 +- .../user/web/dto/AddressParam.java | 24 ------- .../user/web/dto/DeleteAccountParam.java | 28 -------- .../user/web/dto/UpdateAccountParam.java | 37 ----------- .../user/web/dto/UserRegisterParam.java | 64 ------------------- .../resources/mybatis/mapper/UserMapper.xml | 2 +- .../common/address/AddressesTest.java | 3 + .../interceptor/UserAuthInterceptorTest.java | 6 +- .../AuthenticationControllerLoginTest.java | 2 +- .../UserManagementControllerTest.java | 9 +-- .../UserManagementServiceTest.java | 6 +- 33 files changed, 265 insertions(+), 212 deletions(-) rename src/main/java/com/bluedelivery/common/address/{ => domain}/Address.java (97%) rename src/main/java/com/bluedelivery/common/address/{ => domain}/AddressRepository.java (84%) rename src/main/java/com/bluedelivery/common/address/{ => domain}/Addresses.java (97%) rename src/main/java/com/bluedelivery/common/address/{ => domain}/BuildingInfo.java (99%) rename src/main/java/com/bluedelivery/common/address/{ => domain}/BuildingInfoRepository.java (58%) rename src/main/java/com/bluedelivery/common/address/{ => domain}/CityToDong.java (96%) rename src/main/java/com/bluedelivery/user/{web => }/PasswordValidator.java (86%) rename src/main/java/com/bluedelivery/user/{web => api}/UserManagementController.java (86%) rename src/main/java/com/bluedelivery/user/{web => api}/UserManagementControllerImpl.java (85%) create mode 100644 src/main/java/com/bluedelivery/user/api/dto/AddAddressRequest.java create mode 100644 src/main/java/com/bluedelivery/user/api/dto/DeleteAccountRequest.java create mode 100644 src/main/java/com/bluedelivery/user/api/dto/UpdateAccountRequest.java create mode 100644 src/main/java/com/bluedelivery/user/api/dto/UserRegisterRequest.java create mode 100644 src/main/java/com/bluedelivery/user/application/AddAddressTarget.java create mode 100644 src/main/java/com/bluedelivery/user/application/DeleteAccountTarget.java create mode 100644 src/main/java/com/bluedelivery/user/application/UpdateAccountTarget.java create mode 100644 src/main/java/com/bluedelivery/user/application/UserRegisterTarget.java rename src/main/java/com/bluedelivery/user/application/{ => adapter}/UserManagementServiceHttp.java (79%) rename src/main/java/com/bluedelivery/user/{domain => infra}/UserMapper.java (55%) delete mode 100644 src/main/java/com/bluedelivery/user/web/dto/AddressParam.java delete mode 100644 src/main/java/com/bluedelivery/user/web/dto/DeleteAccountParam.java delete mode 100644 src/main/java/com/bluedelivery/user/web/dto/UpdateAccountParam.java delete mode 100644 src/main/java/com/bluedelivery/user/web/dto/UserRegisterParam.java rename src/test/java/com/bluedelivery/user/{web => api}/AuthenticationControllerLoginTest.java (98%) rename src/test/java/com/bluedelivery/user/{web => api}/UserManagementControllerTest.java (90%) diff --git a/src/main/java/com/bluedelivery/common/address/AddressService.java b/src/main/java/com/bluedelivery/common/address/AddressService.java index 1b0de871..8f4c92d7 100644 --- a/src/main/java/com/bluedelivery/common/address/AddressService.java +++ b/src/main/java/com/bluedelivery/common/address/AddressService.java @@ -1,5 +1,7 @@ package com.bluedelivery.common.address; +import com.bluedelivery.common.address.domain.Address; +import com.bluedelivery.common.address.domain.BuildingInfo; import com.bluedelivery.exception.ApiException; import com.bluedelivery.user.domain.User; diff --git a/src/main/java/com/bluedelivery/common/address/AddressServiceImpl.java b/src/main/java/com/bluedelivery/common/address/AddressServiceImpl.java index 74b0e2dc..0df2e223 100644 --- a/src/main/java/com/bluedelivery/common/address/AddressServiceImpl.java +++ b/src/main/java/com/bluedelivery/common/address/AddressServiceImpl.java @@ -4,6 +4,10 @@ import org.springframework.stereotype.Service; +import com.bluedelivery.common.address.domain.Address; +import com.bluedelivery.common.address.domain.AddressRepository; +import com.bluedelivery.common.address.domain.BuildingInfo; +import com.bluedelivery.common.address.domain.BuildingInfoRepository; import com.bluedelivery.exception.ApiException; import com.bluedelivery.user.domain.User; diff --git a/src/main/java/com/bluedelivery/common/address/Address.java b/src/main/java/com/bluedelivery/common/address/domain/Address.java similarity index 97% rename from src/main/java/com/bluedelivery/common/address/Address.java rename to src/main/java/com/bluedelivery/common/address/domain/Address.java index 4050b2c4..e6d14b6d 100644 --- a/src/main/java/com/bluedelivery/common/address/Address.java +++ b/src/main/java/com/bluedelivery/common/address/domain/Address.java @@ -1,4 +1,4 @@ -package com.bluedelivery.common.address; +package com.bluedelivery.common.address.domain; import java.util.Objects; diff --git a/src/main/java/com/bluedelivery/common/address/AddressRepository.java b/src/main/java/com/bluedelivery/common/address/domain/AddressRepository.java similarity index 84% rename from src/main/java/com/bluedelivery/common/address/AddressRepository.java rename to src/main/java/com/bluedelivery/common/address/domain/AddressRepository.java index 0271e121..6ccdccaa 100644 --- a/src/main/java/com/bluedelivery/common/address/AddressRepository.java +++ b/src/main/java/com/bluedelivery/common/address/domain/AddressRepository.java @@ -1,4 +1,4 @@ -package com.bluedelivery.common.address; +package com.bluedelivery.common.address.domain; import java.util.Optional; diff --git a/src/main/java/com/bluedelivery/common/address/Addresses.java b/src/main/java/com/bluedelivery/common/address/domain/Addresses.java similarity index 97% rename from src/main/java/com/bluedelivery/common/address/Addresses.java rename to src/main/java/com/bluedelivery/common/address/domain/Addresses.java index 3732fe3f..900a6779 100644 --- a/src/main/java/com/bluedelivery/common/address/Addresses.java +++ b/src/main/java/com/bluedelivery/common/address/domain/Addresses.java @@ -1,4 +1,4 @@ -package com.bluedelivery.common.address; +package com.bluedelivery.common.address.domain; import static com.bluedelivery.response.ErrorCode.*; import static java.util.Objects.isNull; diff --git a/src/main/java/com/bluedelivery/common/address/BuildingInfo.java b/src/main/java/com/bluedelivery/common/address/domain/BuildingInfo.java similarity index 99% rename from src/main/java/com/bluedelivery/common/address/BuildingInfo.java rename to src/main/java/com/bluedelivery/common/address/domain/BuildingInfo.java index a31fde72..6faf3b82 100644 --- a/src/main/java/com/bluedelivery/common/address/BuildingInfo.java +++ b/src/main/java/com/bluedelivery/common/address/domain/BuildingInfo.java @@ -1,4 +1,4 @@ -package com.bluedelivery.common.address; +package com.bluedelivery.common.address.domain; import java.math.BigDecimal; import java.util.Objects; diff --git a/src/main/java/com/bluedelivery/common/address/BuildingInfoRepository.java b/src/main/java/com/bluedelivery/common/address/domain/BuildingInfoRepository.java similarity index 58% rename from src/main/java/com/bluedelivery/common/address/BuildingInfoRepository.java rename to src/main/java/com/bluedelivery/common/address/domain/BuildingInfoRepository.java index 5e250f9e..882d8477 100644 --- a/src/main/java/com/bluedelivery/common/address/BuildingInfoRepository.java +++ b/src/main/java/com/bluedelivery/common/address/domain/BuildingInfoRepository.java @@ -1,6 +1,8 @@ -package com.bluedelivery.common.address; +package com.bluedelivery.common.address.domain; import org.springframework.data.jpa.repository.JpaRepository; +import com.bluedelivery.common.address.domain.BuildingInfo; + public interface BuildingInfoRepository extends JpaRepository { } diff --git a/src/main/java/com/bluedelivery/common/address/CityToDong.java b/src/main/java/com/bluedelivery/common/address/domain/CityToDong.java similarity index 96% rename from src/main/java/com/bluedelivery/common/address/CityToDong.java rename to src/main/java/com/bluedelivery/common/address/domain/CityToDong.java index 45b58a91..d282c649 100644 --- a/src/main/java/com/bluedelivery/common/address/CityToDong.java +++ b/src/main/java/com/bluedelivery/common/address/domain/CityToDong.java @@ -1,4 +1,4 @@ -package com.bluedelivery.common.address; +package com.bluedelivery.common.address.domain; import javax.persistence.Entity; import javax.persistence.Id; diff --git a/src/main/java/com/bluedelivery/user/web/PasswordValidator.java b/src/main/java/com/bluedelivery/user/PasswordValidator.java similarity index 86% rename from src/main/java/com/bluedelivery/user/web/PasswordValidator.java rename to src/main/java/com/bluedelivery/user/PasswordValidator.java index ef271b0f..39c35c25 100644 --- a/src/main/java/com/bluedelivery/user/web/PasswordValidator.java +++ b/src/main/java/com/bluedelivery/user/PasswordValidator.java @@ -1,4 +1,4 @@ -package com.bluedelivery.user.web; +package com.bluedelivery.user; import java.util.Objects; @@ -6,7 +6,7 @@ import org.springframework.validation.Errors; import org.springframework.validation.Validator; -import com.bluedelivery.user.web.dto.UserRegisterParam.UserRegisterRequest; +import com.bluedelivery.user.api.dto.UserRegisterRequest; @Component public class PasswordValidator implements Validator { diff --git a/src/main/java/com/bluedelivery/user/web/UserManagementController.java b/src/main/java/com/bluedelivery/user/api/UserManagementController.java similarity index 86% rename from src/main/java/com/bluedelivery/user/web/UserManagementController.java rename to src/main/java/com/bluedelivery/user/api/UserManagementController.java index 4666ba6a..51a09617 100644 --- a/src/main/java/com/bluedelivery/user/web/UserManagementController.java +++ b/src/main/java/com/bluedelivery/user/api/UserManagementController.java @@ -1,4 +1,4 @@ -package com.bluedelivery.user.web; +package com.bluedelivery.user.api; import javax.servlet.http.HttpServletRequest; @@ -16,10 +16,10 @@ import com.bluedelivery.common.authentication.AuthenticationRequired; import com.bluedelivery.common.authentication.domain.Authentication; import com.bluedelivery.response.HttpResponse; -import com.bluedelivery.user.web.dto.AddressParam.AddressRequest; -import com.bluedelivery.user.web.dto.DeleteAccountParam.DeleteAccountRequest; -import com.bluedelivery.user.web.dto.UpdateAccountParam.UpdateAccountRequest; -import com.bluedelivery.user.web.dto.UserRegisterParam; +import com.bluedelivery.user.api.dto.AddAddressRequest; +import com.bluedelivery.user.api.dto.DeleteAccountRequest; +import com.bluedelivery.user.api.dto.UpdateAccountRequest; +import com.bluedelivery.user.api.dto.UserRegisterRequest; @RequestMapping("/users") @@ -56,7 +56,7 @@ ResponseEntity> updateAccount(@PathVariable Long id, */ @PostMapping("/{id}/addresses") ResponseEntity> addAddress(@PathVariable("id") Long id, - @Valid @RequestBody AddressRequest addressParam); + @Valid @RequestBody AddAddressRequest addressParam); /** * 고객의 대표 주소 설정 @@ -85,7 +85,7 @@ ResponseEntity> addAddress(@PathVariable("id") Long id, * @return 가입 성공시 201 CREATED */ @PostMapping - ResponseEntity register(@Valid @RequestBody UserRegisterParam.UserRegisterRequest registerRequest); + ResponseEntity register(@Valid @RequestBody UserRegisterRequest registerRequest); } diff --git a/src/main/java/com/bluedelivery/user/web/UserManagementControllerImpl.java b/src/main/java/com/bluedelivery/user/api/UserManagementControllerImpl.java similarity index 85% rename from src/main/java/com/bluedelivery/user/web/UserManagementControllerImpl.java rename to src/main/java/com/bluedelivery/user/api/UserManagementControllerImpl.java index 0bd81df1..ed0a8678 100644 --- a/src/main/java/com/bluedelivery/user/web/UserManagementControllerImpl.java +++ b/src/main/java/com/bluedelivery/user/api/UserManagementControllerImpl.java @@ -1,8 +1,7 @@ -package com.bluedelivery.user.web; +package com.bluedelivery.user.api; import static com.bluedelivery.common.authentication.domain.Authentication.AUTH_STR; import static com.bluedelivery.response.HttpResponse.*; -import static com.bluedelivery.user.web.dto.UpdateAccountParam.*; import static org.springframework.http.HttpStatus.*; import javax.servlet.http.HttpServletRequest; @@ -12,13 +11,15 @@ import org.springframework.web.bind.annotation.InitBinder; import org.springframework.web.bind.annotation.RestController; -import com.bluedelivery.common.address.Address; +import com.bluedelivery.common.address.domain.Address; import com.bluedelivery.common.authentication.domain.Authentication; import com.bluedelivery.response.HttpResponse; +import com.bluedelivery.user.PasswordValidator; +import com.bluedelivery.user.api.dto.AddAddressRequest; +import com.bluedelivery.user.api.dto.DeleteAccountRequest; +import com.bluedelivery.user.api.dto.UpdateAccountRequest; +import com.bluedelivery.user.api.dto.UserRegisterRequest; import com.bluedelivery.user.application.UserManagementService; -import com.bluedelivery.user.web.dto.AddressParam.AddressRequest; -import com.bluedelivery.user.web.dto.DeleteAccountParam.DeleteAccountRequest; -import com.bluedelivery.user.web.dto.UserRegisterParam; import lombok.RequiredArgsConstructor; @@ -51,7 +52,7 @@ public ResponseEntity> updateAccount(Long id, UpdateAccountReque } @Override - public ResponseEntity> addAddress(Long id, AddressRequest addressRequest) { + public ResponseEntity> addAddress(Long id, AddAddressRequest addressRequest) { Address address = userManagementService.addAddress(addressRequest.toParam(id)); return ResponseEntity.status(CREATED).body(response(address)); } @@ -74,7 +75,7 @@ public ResponseEntity removeAddress(Long id, Long addressId) { return ResponseEntity.notFound().build(); } - public ResponseEntity register(UserRegisterParam.UserRegisterRequest dto) { + public ResponseEntity register(UserRegisterRequest dto) { userManagementService.register(dto.toParam()); return ResponseEntity.status(CREATED).build(); } diff --git a/src/main/java/com/bluedelivery/user/api/dto/AddAddressRequest.java b/src/main/java/com/bluedelivery/user/api/dto/AddAddressRequest.java new file mode 100644 index 00000000..c2219144 --- /dev/null +++ b/src/main/java/com/bluedelivery/user/api/dto/AddAddressRequest.java @@ -0,0 +1,19 @@ +package com.bluedelivery.user.api.dto; + +import com.bluedelivery.user.application.AddAddressTarget; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@NoArgsConstructor +@AllArgsConstructor +@Getter +public class AddAddressRequest { + private String buildingManagementNumber; + private String detail; + + public AddAddressTarget toParam(Long id) { + return new AddAddressTarget(id, buildingManagementNumber, detail); + } +} diff --git a/src/main/java/com/bluedelivery/user/api/dto/DeleteAccountRequest.java b/src/main/java/com/bluedelivery/user/api/dto/DeleteAccountRequest.java new file mode 100644 index 00000000..980bb58f --- /dev/null +++ b/src/main/java/com/bluedelivery/user/api/dto/DeleteAccountRequest.java @@ -0,0 +1,25 @@ +package com.bluedelivery.user.api.dto; + +import javax.validation.constraints.Email; +import javax.validation.constraints.NotBlank; + +import com.bluedelivery.user.application.DeleteAccountTarget; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Getter +@NoArgsConstructor +@AllArgsConstructor +public class DeleteAccountRequest { + + @Email + private String email; + @NotBlank + private String password; + + public DeleteAccountTarget toParam(Long id) { + return new DeleteAccountTarget(id, this.email, this.password); + } +} diff --git a/src/main/java/com/bluedelivery/user/api/dto/UpdateAccountRequest.java b/src/main/java/com/bluedelivery/user/api/dto/UpdateAccountRequest.java new file mode 100644 index 00000000..6d7dfc8e --- /dev/null +++ b/src/main/java/com/bluedelivery/user/api/dto/UpdateAccountRequest.java @@ -0,0 +1,32 @@ +package com.bluedelivery.user.api.dto; + + +import java.time.LocalDate; + +import javax.validation.constraints.Past; +import javax.validation.constraints.Pattern; + +import com.bluedelivery.common.RegexConstants; +import com.bluedelivery.user.application.UpdateAccountTarget; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Getter +@NoArgsConstructor +@AllArgsConstructor +public class UpdateAccountRequest { + + private String nickname; + + @Pattern(regexp = RegexConstants.PHONE, + message = "01로 시작하는 10-11자리 숫자여야 합니다.") + private String phone; + @Past + private LocalDate dateOfBirth; + + public UpdateAccountTarget toParam(Long id) { + return new UpdateAccountTarget(id, nickname, phone, dateOfBirth); + } +} diff --git a/src/main/java/com/bluedelivery/user/api/dto/UserRegisterRequest.java b/src/main/java/com/bluedelivery/user/api/dto/UserRegisterRequest.java new file mode 100644 index 00000000..02f7ef7c --- /dev/null +++ b/src/main/java/com/bluedelivery/user/api/dto/UserRegisterRequest.java @@ -0,0 +1,49 @@ +package com.bluedelivery.user.api.dto; + +import java.time.LocalDate; + +import javax.validation.constraints.Email; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Past; +import javax.validation.constraints.Pattern; + +import com.bluedelivery.common.RegexConstants; +import com.bluedelivery.user.application.UserRegisterTarget; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Getter +@NoArgsConstructor +@AllArgsConstructor +public class UserRegisterRequest { + + @NotBlank + @Email + private String email; + + @NotBlank + private String nickname; + + @NotBlank + @Pattern(regexp = RegexConstants.PHONE, message = "01로 시작하는 10-11자리 숫자여야 합니다.") + private String phone; + + @NotBlank + @Pattern(regexp = RegexConstants.PASSWORD, message = "알파벳, 숫자, 특수문자가 각 1개이상 포함된 8~20 글자여야 합니다.") + private String password; + + @NotBlank + @Pattern(regexp = RegexConstants.PASSWORD, message = "알파벳, 숫자, 특수문자가 각 1개이상 포함된 8~20 글자여야 합니다.") + private String confirmedPassword; + + @NotNull + @Past(message = "올바르지 않은 생년월일 입니다.") + private LocalDate dateOfBirth; + + public UserRegisterTarget toParam() { + return new UserRegisterTarget(email, nickname, phone, password, dateOfBirth); + } +} diff --git a/src/main/java/com/bluedelivery/user/application/AddAddressTarget.java b/src/main/java/com/bluedelivery/user/application/AddAddressTarget.java new file mode 100644 index 00000000..b224d550 --- /dev/null +++ b/src/main/java/com/bluedelivery/user/application/AddAddressTarget.java @@ -0,0 +1,13 @@ +package com.bluedelivery.user.application; + + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +@RequiredArgsConstructor +@Getter +public class AddAddressTarget { + private final Long id; + private final String buildingManagementNumber; + private final String detail; +} diff --git a/src/main/java/com/bluedelivery/user/application/DeleteAccountTarget.java b/src/main/java/com/bluedelivery/user/application/DeleteAccountTarget.java new file mode 100644 index 00000000..5cecf694 --- /dev/null +++ b/src/main/java/com/bluedelivery/user/application/DeleteAccountTarget.java @@ -0,0 +1,12 @@ +package com.bluedelivery.user.application; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +@Getter +@RequiredArgsConstructor +public class DeleteAccountTarget { + private final Long id; + private final String email; + private final String password; +} diff --git a/src/main/java/com/bluedelivery/user/application/UpdateAccountTarget.java b/src/main/java/com/bluedelivery/user/application/UpdateAccountTarget.java new file mode 100644 index 00000000..6e374d06 --- /dev/null +++ b/src/main/java/com/bluedelivery/user/application/UpdateAccountTarget.java @@ -0,0 +1,22 @@ +package com.bluedelivery.user.application; + +import java.time.LocalDate; + +import javax.validation.constraints.Past; +import javax.validation.constraints.Pattern; + +import com.bluedelivery.common.RegexConstants; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.RequiredArgsConstructor; + +@Getter +@RequiredArgsConstructor +public class UpdateAccountTarget { + private final Long id; + private final String nickname; + private final String phone; + private final LocalDate dateOfBirth; +} diff --git a/src/main/java/com/bluedelivery/user/application/UserManagementService.java b/src/main/java/com/bluedelivery/user/application/UserManagementService.java index 59c91a95..1086e51c 100644 --- a/src/main/java/com/bluedelivery/user/application/UserManagementService.java +++ b/src/main/java/com/bluedelivery/user/application/UserManagementService.java @@ -1,11 +1,7 @@ package com.bluedelivery.user.application; -import com.bluedelivery.common.address.Address; +import com.bluedelivery.common.address.domain.Address; import com.bluedelivery.user.domain.User; -import com.bluedelivery.user.web.dto.AddressParam; -import com.bluedelivery.user.web.dto.DeleteAccountParam; -import com.bluedelivery.user.web.dto.UpdateAccountParam; -import com.bluedelivery.user.web.dto.UserRegisterParam; public interface UserManagementService { @@ -14,23 +10,23 @@ public interface UserManagementService { * * @param param */ - void register(UserRegisterParam param); + void register(UserRegisterTarget param); - User updateAccount(UpdateAccountParam param); + User updateAccount(UpdateAccountTarget param); /** * 고객 회원 탈퇴 * * @param param */ - void deleteAccount(DeleteAccountParam param); + void deleteAccount(DeleteAccountTarget param); /** * 고객 주소 추가 * - * @param addressParam 유저 id와 주소 정보 + * @param addAddressTarget 유저 id와 주소 정보 */ - Address addAddress(AddressParam addressParam); + Address addAddress(AddAddressTarget addAddressTarget); /** * 고객 주소를 대표 주소로 지정 diff --git a/src/main/java/com/bluedelivery/user/application/UserRegisterTarget.java b/src/main/java/com/bluedelivery/user/application/UserRegisterTarget.java new file mode 100644 index 00000000..de32e340 --- /dev/null +++ b/src/main/java/com/bluedelivery/user/application/UserRegisterTarget.java @@ -0,0 +1,22 @@ +package com.bluedelivery.user.application; + +import java.time.LocalDate; + +import com.bluedelivery.user.domain.User; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +@Getter +@RequiredArgsConstructor +public class UserRegisterTarget { + private final String email; + private final String nickname; + private final String phone; + private final String password; + private final LocalDate dateOfBirth; + + public User toEntity() { + return new User(email, nickname, phone, password, dateOfBirth); + } +} diff --git a/src/main/java/com/bluedelivery/user/application/UserManagementServiceHttp.java b/src/main/java/com/bluedelivery/user/application/adapter/UserManagementServiceHttp.java similarity index 79% rename from src/main/java/com/bluedelivery/user/application/UserManagementServiceHttp.java rename to src/main/java/com/bluedelivery/user/application/adapter/UserManagementServiceHttp.java index 2eaa457a..44e673a6 100644 --- a/src/main/java/com/bluedelivery/user/application/UserManagementServiceHttp.java +++ b/src/main/java/com/bluedelivery/user/application/adapter/UserManagementServiceHttp.java @@ -1,21 +1,22 @@ -package com.bluedelivery.user.application; +package com.bluedelivery.user.application.adapter; import java.util.Locale; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import com.bluedelivery.common.address.Address; import com.bluedelivery.common.address.AddressService; -import com.bluedelivery.common.address.BuildingInfo; +import com.bluedelivery.common.address.domain.Address; +import com.bluedelivery.common.address.domain.BuildingInfo; import com.bluedelivery.exception.ApiException; import com.bluedelivery.response.ErrorCode; +import com.bluedelivery.user.application.AddAddressTarget; +import com.bluedelivery.user.application.DeleteAccountTarget; +import com.bluedelivery.user.application.UpdateAccountTarget; +import com.bluedelivery.user.application.UserManagementService; +import com.bluedelivery.user.application.UserRegisterTarget; import com.bluedelivery.user.domain.User; import com.bluedelivery.user.domain.UserRepository; -import com.bluedelivery.user.web.dto.AddressParam; -import com.bluedelivery.user.web.dto.DeleteAccountParam; -import com.bluedelivery.user.web.dto.UpdateAccountParam; -import com.bluedelivery.user.web.dto.UserRegisterParam; import lombok.RequiredArgsConstructor; @@ -27,7 +28,7 @@ public class UserManagementServiceHttp implements UserManagementService { private final UserRepository userRepository; private final AddressService addressService; - public void register(UserRegisterParam dto) { + public void register(UserRegisterTarget dto) { try { userRepository.save(dto.toEntity()); } catch (RuntimeException ex) { @@ -35,7 +36,7 @@ public void register(UserRegisterParam dto) { } } - public User updateAccount(UpdateAccountParam param) { + public User updateAccount(UpdateAccountTarget param) { User foundUser = getUserByIdAndCheckNotNull(param.getId()); foundUser.changePhone(param.getPhone()); foundUser.changeNickname(param.getNickname()); @@ -43,14 +44,14 @@ public User updateAccount(UpdateAccountParam param) { return foundUser; } - public void deleteAccount(DeleteAccountParam param) { + public void deleteAccount(DeleteAccountTarget param) { User user = getUserByIdAndCheckNotNull(param.getId()); user.validate(param.getPassword()); userRepository.delete(user); } @Override - public Address addAddress(AddressParam param) { + public Address addAddress(AddAddressTarget param) { User user = getUserByIdAndCheckNotNull(param.getId()); BuildingInfo buildingInfo = addressService.getBuildingAddress(param.getBuildingManagementNumber()); diff --git a/src/main/java/com/bluedelivery/user/domain/User.java b/src/main/java/com/bluedelivery/user/domain/User.java index 55eacecd..a53a6631 100644 --- a/src/main/java/com/bluedelivery/user/domain/User.java +++ b/src/main/java/com/bluedelivery/user/domain/User.java @@ -10,8 +10,8 @@ import javax.persistence.GenerationType; import javax.persistence.Id; -import com.bluedelivery.common.address.Address; -import com.bluedelivery.common.address.Addresses; +import com.bluedelivery.common.address.domain.Address; +import com.bluedelivery.common.address.domain.Addresses; @Entity public class User { diff --git a/src/main/java/com/bluedelivery/user/domain/UserMapper.java b/src/main/java/com/bluedelivery/user/infra/UserMapper.java similarity index 55% rename from src/main/java/com/bluedelivery/user/domain/UserMapper.java rename to src/main/java/com/bluedelivery/user/infra/UserMapper.java index e8decccc..38e09300 100644 --- a/src/main/java/com/bluedelivery/user/domain/UserMapper.java +++ b/src/main/java/com/bluedelivery/user/infra/UserMapper.java @@ -1,7 +1,9 @@ -package com.bluedelivery.user.domain; +package com.bluedelivery.user.infra; import org.apache.ibatis.annotations.Mapper; +import com.bluedelivery.user.domain.UserRepository; + @Mapper public interface UserMapper extends UserRepository { } diff --git a/src/main/java/com/bluedelivery/user/web/dto/AddressParam.java b/src/main/java/com/bluedelivery/user/web/dto/AddressParam.java deleted file mode 100644 index 7e6523a8..00000000 --- a/src/main/java/com/bluedelivery/user/web/dto/AddressParam.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.bluedelivery.user.web.dto; - - -import lombok.Getter; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor -@Getter -public class AddressParam { - private final Long id; - private final String buildingManagementNumber; - private final String detail; - - @RequiredArgsConstructor - @Getter - public static class AddressRequest { - private final String buildingManagementNumber; - private final String detail; - - public AddressParam toParam(Long id) { - return new AddressParam(id, buildingManagementNumber, detail); - } - } -} diff --git a/src/main/java/com/bluedelivery/user/web/dto/DeleteAccountParam.java b/src/main/java/com/bluedelivery/user/web/dto/DeleteAccountParam.java deleted file mode 100644 index 2342d3a0..00000000 --- a/src/main/java/com/bluedelivery/user/web/dto/DeleteAccountParam.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.bluedelivery.user.web.dto; - -import javax.validation.constraints.Email; -import javax.validation.constraints.NotBlank; - -import lombok.Getter; -import lombok.RequiredArgsConstructor; - -@Getter -@RequiredArgsConstructor -public class DeleteAccountParam { - private final Long id; - private final String email; - private final String password; - - @Getter - @RequiredArgsConstructor - public static class DeleteAccountRequest { - @Email - private final String email; - @NotBlank - private final String password; - - public DeleteAccountParam toParam(Long id) { - return new DeleteAccountParam(id, this.email, this.password); - } - } -} diff --git a/src/main/java/com/bluedelivery/user/web/dto/UpdateAccountParam.java b/src/main/java/com/bluedelivery/user/web/dto/UpdateAccountParam.java deleted file mode 100644 index 46b87ba0..00000000 --- a/src/main/java/com/bluedelivery/user/web/dto/UpdateAccountParam.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.bluedelivery.user.web.dto; - -import java.time.LocalDate; - -import javax.validation.constraints.Past; -import javax.validation.constraints.Pattern; - -import com.bluedelivery.common.RegexConstants; - -import lombok.Getter; -import lombok.RequiredArgsConstructor; - -@Getter -@RequiredArgsConstructor -public class UpdateAccountParam { - private final Long id; - private final String nickname; - private final String phone; - private final LocalDate dateOfBirth; - - @Getter - @RequiredArgsConstructor - public static class UpdateAccountRequest { - - private final String nickname; - - @Pattern(regexp = RegexConstants.PHONE, - message = "01로 시작하는 10-11자리 숫자여야 합니다.") - private final String phone; - @Past - private final LocalDate dateOfBirth; - - public UpdateAccountParam toParam(Long id) { - return new UpdateAccountParam(id, nickname, phone, dateOfBirth); - } - } -} diff --git a/src/main/java/com/bluedelivery/user/web/dto/UserRegisterParam.java b/src/main/java/com/bluedelivery/user/web/dto/UserRegisterParam.java deleted file mode 100644 index 8df74f98..00000000 --- a/src/main/java/com/bluedelivery/user/web/dto/UserRegisterParam.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.bluedelivery.user.web.dto; - -import java.time.LocalDate; - -import javax.validation.constraints.Email; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Past; -import javax.validation.constraints.Pattern; - -import com.bluedelivery.common.RegexConstants; -import com.bluedelivery.user.domain.User; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.RequiredArgsConstructor; - -@Getter -@RequiredArgsConstructor -public class UserRegisterParam { - private final String email; - private final String nickname; - private final String phone; - private final String password; - private final LocalDate dateOfBirth; - - public User toEntity() { - return new User(email, nickname, phone, password, dateOfBirth); - } - - @Getter - @NoArgsConstructor - @AllArgsConstructor - public static class UserRegisterRequest { - - @NotBlank - @Email - private String email; - - @NotBlank - private String nickname; - - @NotBlank - @Pattern(regexp = RegexConstants.PHONE, message = "01로 시작하는 10-11자리 숫자여야 합니다.") - private String phone; - - @NotBlank - @Pattern(regexp = RegexConstants.PASSWORD, message = "알파벳, 숫자, 특수문자가 각 1개이상 포함된 8~20 글자여야 합니다.") - private String password; - - @NotBlank - @Pattern(regexp = RegexConstants.PASSWORD, message = "알파벳, 숫자, 특수문자가 각 1개이상 포함된 8~20 글자여야 합니다.") - private String confirmedPassword; - - @NotNull - @Past(message = "올바르지 않은 생년월일 입니다.") - private LocalDate dateOfBirth; - - public UserRegisterParam toParam() { - return new UserRegisterParam(email, nickname, phone, password, dateOfBirth); - } - } -} diff --git a/src/main/resources/mybatis/mapper/UserMapper.xml b/src/main/resources/mybatis/mapper/UserMapper.xml index 8a873134..e3d96dc2 100644 --- a/src/main/resources/mybatis/mapper/UserMapper.xml +++ b/src/main/resources/mybatis/mapper/UserMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + diff --git a/src/test/java/com/bluedelivery/common/address/AddressesTest.java b/src/test/java/com/bluedelivery/common/address/AddressesTest.java index 0391a32d..781cf442 100644 --- a/src/test/java/com/bluedelivery/common/address/AddressesTest.java +++ b/src/test/java/com/bluedelivery/common/address/AddressesTest.java @@ -6,6 +6,9 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import com.bluedelivery.common.address.domain.Address; +import com.bluedelivery.common.address.domain.Addresses; +import com.bluedelivery.common.address.domain.BuildingInfo; import com.bluedelivery.exception.ApiException; import com.bluedelivery.response.ErrorCode; diff --git a/src/test/java/com/bluedelivery/config/interceptor/UserAuthInterceptorTest.java b/src/test/java/com/bluedelivery/config/interceptor/UserAuthInterceptorTest.java index 6932a611..03fa152f 100644 --- a/src/test/java/com/bluedelivery/config/interceptor/UserAuthInterceptorTest.java +++ b/src/test/java/com/bluedelivery/config/interceptor/UserAuthInterceptorTest.java @@ -23,10 +23,10 @@ import com.bluedelivery.common.authentication.application.AuthenticationService; import com.bluedelivery.common.authentication.domain.Authentication; import com.bluedelivery.config.GlobalExceptionHandler; +import com.bluedelivery.user.PasswordValidator; +import com.bluedelivery.user.api.UserManagementController; +import com.bluedelivery.user.api.UserManagementControllerImpl; import com.bluedelivery.user.application.UserManagementService; -import com.bluedelivery.user.web.PasswordValidator; -import com.bluedelivery.user.web.UserManagementController; -import com.bluedelivery.user.web.UserManagementControllerImpl; @ExtendWith(MockitoExtension.class) class UserAuthInterceptorTest { diff --git a/src/test/java/com/bluedelivery/user/web/AuthenticationControllerLoginTest.java b/src/test/java/com/bluedelivery/user/api/AuthenticationControllerLoginTest.java similarity index 98% rename from src/test/java/com/bluedelivery/user/web/AuthenticationControllerLoginTest.java rename to src/test/java/com/bluedelivery/user/api/AuthenticationControllerLoginTest.java index 25b91370..c23d0846 100644 --- a/src/test/java/com/bluedelivery/user/web/AuthenticationControllerLoginTest.java +++ b/src/test/java/com/bluedelivery/user/api/AuthenticationControllerLoginTest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.user.web; +package com.bluedelivery.user.api; import static org.hamcrest.Matchers.*; import static org.mockito.Mockito.when; diff --git a/src/test/java/com/bluedelivery/user/web/UserManagementControllerTest.java b/src/test/java/com/bluedelivery/user/api/UserManagementControllerTest.java similarity index 90% rename from src/test/java/com/bluedelivery/user/web/UserManagementControllerTest.java rename to src/test/java/com/bluedelivery/user/api/UserManagementControllerTest.java index 363e7039..f063b08c 100644 --- a/src/test/java/com/bluedelivery/user/web/UserManagementControllerTest.java +++ b/src/test/java/com/bluedelivery/user/api/UserManagementControllerTest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.user.web; +package com.bluedelivery.user.api; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; @@ -20,8 +20,9 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders; import com.bluedelivery.config.GlobalExceptionHandler; +import com.bluedelivery.user.PasswordValidator; +import com.bluedelivery.user.api.dto.UserRegisterRequest; import com.bluedelivery.user.application.UserManagementService; -import com.bluedelivery.user.web.dto.UserRegisterParam; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; @@ -58,7 +59,7 @@ void checkPasswordValidation() throws Exception { String password = "P@ssw0rd!"; MvcResult mvcResult = mockMvc.perform(post("/users") .content(objMapper.writeValueAsString( - new UserRegisterParam.UserRegisterRequest("nothing@email.com", "nickname", "010-1234-1234", + new UserRegisterRequest("nothing@email.com", "nickname", "010-1234-1234", password, password + "wrong", LocalDate.of(2020, Month.MAY, 1)))) .contentType(MediaType.APPLICATION_JSON)) @@ -74,7 +75,7 @@ void checkPasswordNotValidated() throws Exception { String password = "P@ssw0rd!"; mockMvc.perform(post("/users") .content(objMapper.writeValueAsString( - new UserRegisterParam.UserRegisterRequest("nothing@email.com", "nickname", "010-1234-1234", + new UserRegisterRequest("nothing@email.com", "nickname", "010-1234-1234", password, password, LocalDate.of(2020, Month.MAY, 1)))) .contentType(MediaType.APPLICATION_JSON)) diff --git a/src/test/java/com/bluedelivery/user/application/UserManagementServiceTest.java b/src/test/java/com/bluedelivery/user/application/UserManagementServiceTest.java index a114ac11..99b7c87e 100644 --- a/src/test/java/com/bluedelivery/user/application/UserManagementServiceTest.java +++ b/src/test/java/com/bluedelivery/user/application/UserManagementServiceTest.java @@ -18,8 +18,8 @@ import com.bluedelivery.common.address.AddressService; import com.bluedelivery.exception.ApiException; import com.bluedelivery.response.ErrorCode; +import com.bluedelivery.user.application.adapter.UserManagementServiceHttp; import com.bluedelivery.user.domain.UserRepository; -import com.bluedelivery.user.web.dto.UserRegisterParam; @ExtendWith(MockitoExtension.class) class UserManagementServiceTest { @@ -32,13 +32,13 @@ class UserManagementServiceTest { String email; String password; - UserRegisterParam param; + UserRegisterTarget param; @BeforeEach void setup() { service = new UserManagementServiceHttp(userRepository, addressService); email = "myEmail@email.com"; - param = new UserRegisterParam( + param = new UserRegisterTarget( email, "nickname", "010-1234-5676", password, LocalDate.of(2000, Month.MAY, 1)); } From 4cd1da06fb863ac5144bb667986d99c37fa6ac09 Mon Sep 17 00:00:00 2001 From: soongjamm Date: Tue, 27 Jul 2021 14:44:43 +0900 Subject: [PATCH 04/18] api-application-domain-infra --- .../AuthenticationController.java | 6 ++--- .../authentication}/LoginRequest.java | 4 +-- .../adapter/AuthenticationControllerImpl.java | 22 ++++++++-------- .../dto => api/user}/AddAddressRequest.java | 4 +-- .../user}/DeleteAccountRequest.java | 4 +-- .../user}/UpdateAccountRequest.java | 4 +-- .../user}/UserManagementController.java | 12 +++------ .../dto => api/user}/UserRegisterRequest.java | 4 +-- .../UserManagementControllerImpl.java | 25 +++++++++--------- .../address/AddressService.java | 10 +++---- .../address/adapter}/AddressServiceImpl.java | 17 ++++++------ .../AuthenticationFailedException.java | 2 +- .../AuthenticationService.java | 4 +-- .../authentication}/LoginTarget.java | 2 +- .../adapter/AuthenticationServiceHttp.java | 16 ++++++------ .../user}/AddAddressTarget.java | 2 +- .../user}/DeleteAccountTarget.java | 2 +- .../user}/UpdateAccountTarget.java | 9 +------ .../user}/UserManagementService.java | 6 ++--- .../user}/UserRegisterTarget.java | 4 +-- .../adapter/UserManagementServiceHttp.java | 26 +++++++++---------- .../response}/ApiException.java | 4 +-- .../{ => common}/response/ErrorCode.java | 4 +-- .../{ => common}/response/HttpResponse.java | 2 +- .../config/GlobalExceptionHandler.java | 8 +++--- .../com/bluedelivery/config/RedisConfig.java | 6 ++--- .../com/bluedelivery/config/WebConfig.java | 6 ++--- .../domain => domain/address}/Address.java | 4 +-- .../address}/AddressRepository.java | 4 +-- .../domain => domain/address}/Addresses.java | 6 ++--- .../address}/BuildingInfo.java | 2 +- .../address}/BuildingInfoRepository.java | 4 +-- .../domain => domain/address}/CityToDong.java | 2 +- .../authentication}/Authentication.java | 2 +- .../AuthenticationRepository.java | 2 +- .../{user/domain => domain/user}/User.java | 6 ++--- .../user}/UserRepository.java | 2 +- .../AuthenticatedUserArgumentResolver.java | 6 ++--- .../AuthenticationRedisRepository.java | 6 ++--- .../AuthenticationRequired.java | 2 +- .../authentication/UserAuthInterceptor.java | 12 ++++----- .../{ => infra}/user/PasswordValidator.java | 4 +-- .../infra => infra/user}/UserMapper.java | 4 +-- .../category/CategoryManagerController.java | 2 +- .../CategoryManagerControllerImpl.java | 8 +++--- .../shop/menu/MenuController.java | 4 +-- .../shop/menu/MenuGroupController.java | 4 +-- .../shop/menu/MenuOptionController.java | 2 +- .../shop/menu/MenuOptionControllerImpl.java | 2 +- .../shop/menu/MenuOptionServiceImpl.java | 4 +-- .../bluedelivery/shop/menu/MenuService.java | 4 +-- .../shop/shop/ShopUpdateController.java | 2 +- .../shop/shop/ShopUpdateControllerImpl.java | 6 ++--- .../shop/shop/ShopUpdateService.java | 4 +-- .../resources/mybatis/mapper/UserMapper.xml | 4 +-- .../address/AddressesTest.java | 12 ++++----- .../user}/UserManagementServiceTest.java | 12 ++++----- .../interceptor/UserAuthInterceptorTest.java | 16 ++++++------ ...AuthenticatedUserArgumentResolverTest.java | 6 ++--- .../shop/menu/MenuOptionControllerTest.java | 4 +-- .../shop/menu/MenuServiceTest.java | 6 ++--- .../java/com/bluedelivery/user/UserTest.java | 2 +- .../AuthenticationControllerLoginTest.java | 10 +++---- .../api/UserManagementControllerTest.java | 8 +++--- 64 files changed, 197 insertions(+), 208 deletions(-) rename src/main/java/com/bluedelivery/{common/authentication/api => api/authentication}/AuthenticationController.java (81%) rename src/main/java/com/bluedelivery/{common/authentication/api => api/authentication}/LoginRequest.java (72%) rename src/main/java/com/bluedelivery/{common/authentication/api => api/authentication}/adapter/AuthenticationControllerImpl.java (61%) rename src/main/java/com/bluedelivery/{user/api/dto => api/user}/AddAddressRequest.java (79%) rename src/main/java/com/bluedelivery/{user/api/dto => api/user}/DeleteAccountRequest.java (82%) rename src/main/java/com/bluedelivery/{user/api/dto => api/user}/UpdateAccountRequest.java (87%) rename src/main/java/com/bluedelivery/{user/api => api/user}/UserManagementController.java (86%) rename src/main/java/com/bluedelivery/{user/api/dto => api/user}/UserRegisterRequest.java (93%) rename src/main/java/com/bluedelivery/{user/api => api/user/adapter}/UserManagementControllerImpl.java (78%) rename src/main/java/com/bluedelivery/{common => application}/address/AddressService.java (74%) rename src/main/java/com/bluedelivery/{common/address => application/address/adapter}/AddressServiceImpl.java (60%) rename src/main/java/com/bluedelivery/{common/authentication/application => application/authentication}/AuthenticationFailedException.java (54%) rename src/main/java/com/bluedelivery/{common/authentication/application => application/authentication}/AuthenticationService.java (69%) rename src/main/java/com/bluedelivery/{common/authentication/application => application/authentication}/LoginTarget.java (80%) rename src/main/java/com/bluedelivery/{common/authentication/application => application/authentication}/adapter/AuthenticationServiceHttp.java (73%) rename src/main/java/com/bluedelivery/{user/application => application/user}/AddAddressTarget.java (84%) rename src/main/java/com/bluedelivery/{user/application => application/user}/DeleteAccountTarget.java (84%) rename src/main/java/com/bluedelivery/{user/application => application/user}/UpdateAccountTarget.java (54%) rename src/main/java/com/bluedelivery/{user/application => application/user}/UserManagementService.java (90%) rename src/main/java/com/bluedelivery/{user/application => application/user}/UserRegisterTarget.java (84%) rename src/main/java/com/bluedelivery/{user/application => application/user}/adapter/UserManagementServiceHttp.java (79%) rename src/main/java/com/bluedelivery/{exception => common/response}/ApiException.java (76%) rename src/main/java/com/bluedelivery/{ => common}/response/ErrorCode.java (95%) rename src/main/java/com/bluedelivery/{ => common}/response/HttpResponse.java (97%) rename src/main/java/com/bluedelivery/{common/address/domain => domain/address}/Address.java (95%) rename src/main/java/com/bluedelivery/{common/address/domain => domain/address}/AddressRepository.java (71%) rename src/main/java/com/bluedelivery/{common/address/domain => domain/address}/Addresses.java (92%) rename src/main/java/com/bluedelivery/{common/address/domain => domain/address}/BuildingInfo.java (99%) rename src/main/java/com/bluedelivery/{common/address/domain => domain/address}/BuildingInfoRepository.java (58%) rename src/main/java/com/bluedelivery/{common/address/domain => domain/address}/CityToDong.java (96%) rename src/main/java/com/bluedelivery/{common/authentication/domain => domain/authentication}/Authentication.java (97%) rename src/main/java/com/bluedelivery/{common/authentication/domain => domain/authentication}/AuthenticationRepository.java (81%) rename src/main/java/com/bluedelivery/{user/domain => domain/user}/User.java (95%) rename src/main/java/com/bluedelivery/{user/domain => domain/user}/UserRepository.java (87%) rename src/main/java/com/bluedelivery/{common => infra}/authentication/AuthenticatedUserArgumentResolver.java (88%) rename src/main/java/com/bluedelivery/{common/authentication/infra => infra/authentication}/AuthenticationRedisRepository.java (85%) rename src/main/java/com/bluedelivery/{common => infra}/authentication/AuthenticationRequired.java (85%) rename src/main/java/com/bluedelivery/{common => infra}/authentication/UserAuthInterceptor.java (83%) rename src/main/java/com/bluedelivery/{ => infra}/user/PasswordValidator.java (88%) rename src/main/java/com/bluedelivery/{user/infra => infra/user}/UserMapper.java (55%) rename src/test/java/com/bluedelivery/{common => application}/address/AddressesTest.java (93%) rename src/test/java/com/bluedelivery/{user/application => application/user}/UserManagementServiceTest.java (88%) diff --git a/src/main/java/com/bluedelivery/common/authentication/api/AuthenticationController.java b/src/main/java/com/bluedelivery/api/authentication/AuthenticationController.java similarity index 81% rename from src/main/java/com/bluedelivery/common/authentication/api/AuthenticationController.java rename to src/main/java/com/bluedelivery/api/authentication/AuthenticationController.java index 3d404d85..ee6df304 100644 --- a/src/main/java/com/bluedelivery/common/authentication/api/AuthenticationController.java +++ b/src/main/java/com/bluedelivery/api/authentication/AuthenticationController.java @@ -1,12 +1,12 @@ -package com.bluedelivery.common.authentication.api; +package com.bluedelivery.api.authentication; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; -import com.bluedelivery.common.authentication.domain.Authentication; -import com.bluedelivery.response.HttpResponse; +import com.bluedelivery.common.response.HttpResponse; +import com.bluedelivery.domain.authentication.Authentication; @RequestMapping("/auth") public interface AuthenticationController { diff --git a/src/main/java/com/bluedelivery/common/authentication/api/LoginRequest.java b/src/main/java/com/bluedelivery/api/authentication/LoginRequest.java similarity index 72% rename from src/main/java/com/bluedelivery/common/authentication/api/LoginRequest.java rename to src/main/java/com/bluedelivery/api/authentication/LoginRequest.java index 21af30e4..18813a40 100644 --- a/src/main/java/com/bluedelivery/common/authentication/api/LoginRequest.java +++ b/src/main/java/com/bluedelivery/api/authentication/LoginRequest.java @@ -1,6 +1,6 @@ -package com.bluedelivery.common.authentication.api; +package com.bluedelivery.api.authentication; -import com.bluedelivery.common.authentication.application.LoginTarget; +import com.bluedelivery.application.authentication.LoginTarget; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/src/main/java/com/bluedelivery/common/authentication/api/adapter/AuthenticationControllerImpl.java b/src/main/java/com/bluedelivery/api/authentication/adapter/AuthenticationControllerImpl.java similarity index 61% rename from src/main/java/com/bluedelivery/common/authentication/api/adapter/AuthenticationControllerImpl.java rename to src/main/java/com/bluedelivery/api/authentication/adapter/AuthenticationControllerImpl.java index f3bdfd8d..cd57f448 100644 --- a/src/main/java/com/bluedelivery/common/authentication/api/adapter/AuthenticationControllerImpl.java +++ b/src/main/java/com/bluedelivery/api/authentication/adapter/AuthenticationControllerImpl.java @@ -1,20 +1,20 @@ -package com.bluedelivery.common.authentication.api.adapter; +package com.bluedelivery.api.authentication.adapter; -import static com.bluedelivery.response.ErrorCode.ALREADY_LOGGED_IN; -import static com.bluedelivery.response.ErrorCode.USER_NOT_FOUND; -import static com.bluedelivery.response.HttpResponse.SUCCESS; -import static com.bluedelivery.response.HttpResponse.response; +import static com.bluedelivery.common.response.ErrorCode.ALREADY_LOGGED_IN; +import static com.bluedelivery.common.response.ErrorCode.USER_NOT_FOUND; +import static com.bluedelivery.common.response.HttpResponse.SUCCESS; +import static com.bluedelivery.common.response.HttpResponse.response; import static org.springframework.http.HttpStatus.*; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; -import com.bluedelivery.common.authentication.api.AuthenticationController; -import com.bluedelivery.common.authentication.api.LoginRequest; -import com.bluedelivery.common.authentication.application.AuthenticationService; -import com.bluedelivery.common.authentication.domain.Authentication; -import com.bluedelivery.exception.ApiException; -import com.bluedelivery.response.HttpResponse; +import com.bluedelivery.api.authentication.AuthenticationController; +import com.bluedelivery.api.authentication.LoginRequest; +import com.bluedelivery.application.authentication.AuthenticationService; +import com.bluedelivery.common.response.ApiException; +import com.bluedelivery.common.response.HttpResponse; +import com.bluedelivery.domain.authentication.Authentication; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/bluedelivery/user/api/dto/AddAddressRequest.java b/src/main/java/com/bluedelivery/api/user/AddAddressRequest.java similarity index 79% rename from src/main/java/com/bluedelivery/user/api/dto/AddAddressRequest.java rename to src/main/java/com/bluedelivery/api/user/AddAddressRequest.java index c2219144..f366113d 100644 --- a/src/main/java/com/bluedelivery/user/api/dto/AddAddressRequest.java +++ b/src/main/java/com/bluedelivery/api/user/AddAddressRequest.java @@ -1,6 +1,6 @@ -package com.bluedelivery.user.api.dto; +package com.bluedelivery.api.user; -import com.bluedelivery.user.application.AddAddressTarget; +import com.bluedelivery.application.user.AddAddressTarget; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/src/main/java/com/bluedelivery/user/api/dto/DeleteAccountRequest.java b/src/main/java/com/bluedelivery/api/user/DeleteAccountRequest.java similarity index 82% rename from src/main/java/com/bluedelivery/user/api/dto/DeleteAccountRequest.java rename to src/main/java/com/bluedelivery/api/user/DeleteAccountRequest.java index 980bb58f..8e59daf9 100644 --- a/src/main/java/com/bluedelivery/user/api/dto/DeleteAccountRequest.java +++ b/src/main/java/com/bluedelivery/api/user/DeleteAccountRequest.java @@ -1,9 +1,9 @@ -package com.bluedelivery.user.api.dto; +package com.bluedelivery.api.user; import javax.validation.constraints.Email; import javax.validation.constraints.NotBlank; -import com.bluedelivery.user.application.DeleteAccountTarget; +import com.bluedelivery.application.user.DeleteAccountTarget; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/src/main/java/com/bluedelivery/user/api/dto/UpdateAccountRequest.java b/src/main/java/com/bluedelivery/api/user/UpdateAccountRequest.java similarity index 87% rename from src/main/java/com/bluedelivery/user/api/dto/UpdateAccountRequest.java rename to src/main/java/com/bluedelivery/api/user/UpdateAccountRequest.java index 6d7dfc8e..d0c23071 100644 --- a/src/main/java/com/bluedelivery/user/api/dto/UpdateAccountRequest.java +++ b/src/main/java/com/bluedelivery/api/user/UpdateAccountRequest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.user.api.dto; +package com.bluedelivery.api.user; import java.time.LocalDate; @@ -6,8 +6,8 @@ import javax.validation.constraints.Past; import javax.validation.constraints.Pattern; +import com.bluedelivery.application.user.UpdateAccountTarget; import com.bluedelivery.common.RegexConstants; -import com.bluedelivery.user.application.UpdateAccountTarget; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/src/main/java/com/bluedelivery/user/api/UserManagementController.java b/src/main/java/com/bluedelivery/api/user/UserManagementController.java similarity index 86% rename from src/main/java/com/bluedelivery/user/api/UserManagementController.java rename to src/main/java/com/bluedelivery/api/user/UserManagementController.java index 51a09617..ab48e1e3 100644 --- a/src/main/java/com/bluedelivery/user/api/UserManagementController.java +++ b/src/main/java/com/bluedelivery/api/user/UserManagementController.java @@ -1,4 +1,4 @@ -package com.bluedelivery.user.api; +package com.bluedelivery.api.user; import javax.servlet.http.HttpServletRequest; @@ -13,13 +13,9 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; -import com.bluedelivery.common.authentication.AuthenticationRequired; -import com.bluedelivery.common.authentication.domain.Authentication; -import com.bluedelivery.response.HttpResponse; -import com.bluedelivery.user.api.dto.AddAddressRequest; -import com.bluedelivery.user.api.dto.DeleteAccountRequest; -import com.bluedelivery.user.api.dto.UpdateAccountRequest; -import com.bluedelivery.user.api.dto.UserRegisterRequest; +import com.bluedelivery.common.response.HttpResponse; +import com.bluedelivery.domain.authentication.Authentication; +import com.bluedelivery.infra.authentication.AuthenticationRequired; @RequestMapping("/users") diff --git a/src/main/java/com/bluedelivery/user/api/dto/UserRegisterRequest.java b/src/main/java/com/bluedelivery/api/user/UserRegisterRequest.java similarity index 93% rename from src/main/java/com/bluedelivery/user/api/dto/UserRegisterRequest.java rename to src/main/java/com/bluedelivery/api/user/UserRegisterRequest.java index 02f7ef7c..942443d7 100644 --- a/src/main/java/com/bluedelivery/user/api/dto/UserRegisterRequest.java +++ b/src/main/java/com/bluedelivery/api/user/UserRegisterRequest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.user.api.dto; +package com.bluedelivery.api.user; import java.time.LocalDate; @@ -8,8 +8,8 @@ import javax.validation.constraints.Past; import javax.validation.constraints.Pattern; +import com.bluedelivery.application.user.UserRegisterTarget; import com.bluedelivery.common.RegexConstants; -import com.bluedelivery.user.application.UserRegisterTarget; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/src/main/java/com/bluedelivery/user/api/UserManagementControllerImpl.java b/src/main/java/com/bluedelivery/api/user/adapter/UserManagementControllerImpl.java similarity index 78% rename from src/main/java/com/bluedelivery/user/api/UserManagementControllerImpl.java rename to src/main/java/com/bluedelivery/api/user/adapter/UserManagementControllerImpl.java index ed0a8678..b4cea529 100644 --- a/src/main/java/com/bluedelivery/user/api/UserManagementControllerImpl.java +++ b/src/main/java/com/bluedelivery/api/user/adapter/UserManagementControllerImpl.java @@ -1,7 +1,7 @@ -package com.bluedelivery.user.api; +package com.bluedelivery.api.user.adapter; -import static com.bluedelivery.common.authentication.domain.Authentication.AUTH_STR; -import static com.bluedelivery.response.HttpResponse.*; +import static com.bluedelivery.common.response.HttpResponse.*; +import static com.bluedelivery.domain.authentication.Authentication.AUTH_STR; import static org.springframework.http.HttpStatus.*; import javax.servlet.http.HttpServletRequest; @@ -11,15 +11,16 @@ import org.springframework.web.bind.annotation.InitBinder; import org.springframework.web.bind.annotation.RestController; -import com.bluedelivery.common.address.domain.Address; -import com.bluedelivery.common.authentication.domain.Authentication; -import com.bluedelivery.response.HttpResponse; -import com.bluedelivery.user.PasswordValidator; -import com.bluedelivery.user.api.dto.AddAddressRequest; -import com.bluedelivery.user.api.dto.DeleteAccountRequest; -import com.bluedelivery.user.api.dto.UpdateAccountRequest; -import com.bluedelivery.user.api.dto.UserRegisterRequest; -import com.bluedelivery.user.application.UserManagementService; +import com.bluedelivery.api.user.AddAddressRequest; +import com.bluedelivery.api.user.DeleteAccountRequest; +import com.bluedelivery.api.user.UpdateAccountRequest; +import com.bluedelivery.api.user.UserManagementController; +import com.bluedelivery.api.user.UserRegisterRequest; +import com.bluedelivery.application.user.UserManagementService; +import com.bluedelivery.common.response.HttpResponse; +import com.bluedelivery.domain.address.Address; +import com.bluedelivery.domain.authentication.Authentication; +import com.bluedelivery.infra.user.PasswordValidator; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/bluedelivery/common/address/AddressService.java b/src/main/java/com/bluedelivery/application/address/AddressService.java similarity index 74% rename from src/main/java/com/bluedelivery/common/address/AddressService.java rename to src/main/java/com/bluedelivery/application/address/AddressService.java index 8f4c92d7..404d4410 100644 --- a/src/main/java/com/bluedelivery/common/address/AddressService.java +++ b/src/main/java/com/bluedelivery/application/address/AddressService.java @@ -1,9 +1,9 @@ -package com.bluedelivery.common.address; +package com.bluedelivery.application.address; -import com.bluedelivery.common.address.domain.Address; -import com.bluedelivery.common.address.domain.BuildingInfo; -import com.bluedelivery.exception.ApiException; -import com.bluedelivery.user.domain.User; +import com.bluedelivery.common.response.ApiException; +import com.bluedelivery.domain.address.Address; +import com.bluedelivery.domain.address.BuildingInfo; +import com.bluedelivery.domain.user.User; public interface AddressService { /** diff --git a/src/main/java/com/bluedelivery/common/address/AddressServiceImpl.java b/src/main/java/com/bluedelivery/application/address/adapter/AddressServiceImpl.java similarity index 60% rename from src/main/java/com/bluedelivery/common/address/AddressServiceImpl.java rename to src/main/java/com/bluedelivery/application/address/adapter/AddressServiceImpl.java index 0df2e223..6942bc00 100644 --- a/src/main/java/com/bluedelivery/common/address/AddressServiceImpl.java +++ b/src/main/java/com/bluedelivery/application/address/adapter/AddressServiceImpl.java @@ -1,15 +1,16 @@ -package com.bluedelivery.common.address; +package com.bluedelivery.application.address.adapter; -import static com.bluedelivery.response.ErrorCode.ADDRESS_DOES_NOT_EXIST; +import static com.bluedelivery.common.response.ErrorCode.ADDRESS_DOES_NOT_EXIST; import org.springframework.stereotype.Service; -import com.bluedelivery.common.address.domain.Address; -import com.bluedelivery.common.address.domain.AddressRepository; -import com.bluedelivery.common.address.domain.BuildingInfo; -import com.bluedelivery.common.address.domain.BuildingInfoRepository; -import com.bluedelivery.exception.ApiException; -import com.bluedelivery.user.domain.User; +import com.bluedelivery.application.address.AddressService; +import com.bluedelivery.common.response.ApiException; +import com.bluedelivery.domain.address.Address; +import com.bluedelivery.domain.address.AddressRepository; +import com.bluedelivery.domain.address.BuildingInfo; +import com.bluedelivery.domain.address.BuildingInfoRepository; +import com.bluedelivery.domain.user.User; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/bluedelivery/common/authentication/application/AuthenticationFailedException.java b/src/main/java/com/bluedelivery/application/authentication/AuthenticationFailedException.java similarity index 54% rename from src/main/java/com/bluedelivery/common/authentication/application/AuthenticationFailedException.java rename to src/main/java/com/bluedelivery/application/authentication/AuthenticationFailedException.java index 7c3e0ac5..b24eaaac 100644 --- a/src/main/java/com/bluedelivery/common/authentication/application/AuthenticationFailedException.java +++ b/src/main/java/com/bluedelivery/application/authentication/AuthenticationFailedException.java @@ -1,4 +1,4 @@ -package com.bluedelivery.common.authentication.application; +package com.bluedelivery.application.authentication; public class AuthenticationFailedException extends RuntimeException { } diff --git a/src/main/java/com/bluedelivery/common/authentication/application/AuthenticationService.java b/src/main/java/com/bluedelivery/application/authentication/AuthenticationService.java similarity index 69% rename from src/main/java/com/bluedelivery/common/authentication/application/AuthenticationService.java rename to src/main/java/com/bluedelivery/application/authentication/AuthenticationService.java index 721a1f29..238d30fb 100644 --- a/src/main/java/com/bluedelivery/common/authentication/application/AuthenticationService.java +++ b/src/main/java/com/bluedelivery/application/authentication/AuthenticationService.java @@ -1,8 +1,8 @@ -package com.bluedelivery.common.authentication.application; +package com.bluedelivery.application.authentication; import java.util.Optional; -import com.bluedelivery.common.authentication.domain.Authentication; +import com.bluedelivery.domain.authentication.Authentication; public interface AuthenticationService { String BEARER_PREFIX = "Bearer "; diff --git a/src/main/java/com/bluedelivery/common/authentication/application/LoginTarget.java b/src/main/java/com/bluedelivery/application/authentication/LoginTarget.java similarity index 80% rename from src/main/java/com/bluedelivery/common/authentication/application/LoginTarget.java rename to src/main/java/com/bluedelivery/application/authentication/LoginTarget.java index bef20049..512571a0 100644 --- a/src/main/java/com/bluedelivery/common/authentication/application/LoginTarget.java +++ b/src/main/java/com/bluedelivery/application/authentication/LoginTarget.java @@ -1,4 +1,4 @@ -package com.bluedelivery.common.authentication.application; +package com.bluedelivery.application.authentication; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/src/main/java/com/bluedelivery/common/authentication/application/adapter/AuthenticationServiceHttp.java b/src/main/java/com/bluedelivery/application/authentication/adapter/AuthenticationServiceHttp.java similarity index 73% rename from src/main/java/com/bluedelivery/common/authentication/application/adapter/AuthenticationServiceHttp.java rename to src/main/java/com/bluedelivery/application/authentication/adapter/AuthenticationServiceHttp.java index 400ea124..c7a7dff8 100644 --- a/src/main/java/com/bluedelivery/common/authentication/application/adapter/AuthenticationServiceHttp.java +++ b/src/main/java/com/bluedelivery/application/authentication/adapter/AuthenticationServiceHttp.java @@ -1,4 +1,4 @@ -package com.bluedelivery.common.authentication.application.adapter; +package com.bluedelivery.application.authentication.adapter; import static java.util.Objects.nonNull; @@ -8,13 +8,13 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import com.bluedelivery.common.authentication.application.AuthenticationFailedException; -import com.bluedelivery.common.authentication.application.AuthenticationService; -import com.bluedelivery.common.authentication.application.LoginTarget; -import com.bluedelivery.common.authentication.domain.Authentication; -import com.bluedelivery.common.authentication.domain.AuthenticationRepository; -import com.bluedelivery.user.domain.User; -import com.bluedelivery.user.domain.UserRepository; +import com.bluedelivery.application.authentication.AuthenticationFailedException; +import com.bluedelivery.application.authentication.AuthenticationService; +import com.bluedelivery.application.authentication.LoginTarget; +import com.bluedelivery.domain.authentication.Authentication; +import com.bluedelivery.domain.authentication.AuthenticationRepository; +import com.bluedelivery.domain.user.User; +import com.bluedelivery.domain.user.UserRepository; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/bluedelivery/user/application/AddAddressTarget.java b/src/main/java/com/bluedelivery/application/user/AddAddressTarget.java similarity index 84% rename from src/main/java/com/bluedelivery/user/application/AddAddressTarget.java rename to src/main/java/com/bluedelivery/application/user/AddAddressTarget.java index b224d550..00d13b7a 100644 --- a/src/main/java/com/bluedelivery/user/application/AddAddressTarget.java +++ b/src/main/java/com/bluedelivery/application/user/AddAddressTarget.java @@ -1,4 +1,4 @@ -package com.bluedelivery.user.application; +package com.bluedelivery.application.user; import lombok.Getter; diff --git a/src/main/java/com/bluedelivery/user/application/DeleteAccountTarget.java b/src/main/java/com/bluedelivery/application/user/DeleteAccountTarget.java similarity index 84% rename from src/main/java/com/bluedelivery/user/application/DeleteAccountTarget.java rename to src/main/java/com/bluedelivery/application/user/DeleteAccountTarget.java index 5cecf694..5dedad99 100644 --- a/src/main/java/com/bluedelivery/user/application/DeleteAccountTarget.java +++ b/src/main/java/com/bluedelivery/application/user/DeleteAccountTarget.java @@ -1,4 +1,4 @@ -package com.bluedelivery.user.application; +package com.bluedelivery.application.user; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/bluedelivery/user/application/UpdateAccountTarget.java b/src/main/java/com/bluedelivery/application/user/UpdateAccountTarget.java similarity index 54% rename from src/main/java/com/bluedelivery/user/application/UpdateAccountTarget.java rename to src/main/java/com/bluedelivery/application/user/UpdateAccountTarget.java index 6e374d06..f57ccd88 100644 --- a/src/main/java/com/bluedelivery/user/application/UpdateAccountTarget.java +++ b/src/main/java/com/bluedelivery/application/user/UpdateAccountTarget.java @@ -1,15 +1,8 @@ -package com.bluedelivery.user.application; +package com.bluedelivery.application.user; import java.time.LocalDate; -import javax.validation.constraints.Past; -import javax.validation.constraints.Pattern; - -import com.bluedelivery.common.RegexConstants; - -import lombok.AllArgsConstructor; import lombok.Getter; -import lombok.NoArgsConstructor; import lombok.RequiredArgsConstructor; @Getter diff --git a/src/main/java/com/bluedelivery/user/application/UserManagementService.java b/src/main/java/com/bluedelivery/application/user/UserManagementService.java similarity index 90% rename from src/main/java/com/bluedelivery/user/application/UserManagementService.java rename to src/main/java/com/bluedelivery/application/user/UserManagementService.java index 1086e51c..cb49b30c 100644 --- a/src/main/java/com/bluedelivery/user/application/UserManagementService.java +++ b/src/main/java/com/bluedelivery/application/user/UserManagementService.java @@ -1,7 +1,7 @@ -package com.bluedelivery.user.application; +package com.bluedelivery.application.user; -import com.bluedelivery.common.address.domain.Address; -import com.bluedelivery.user.domain.User; +import com.bluedelivery.domain.address.Address; +import com.bluedelivery.domain.user.User; public interface UserManagementService { diff --git a/src/main/java/com/bluedelivery/user/application/UserRegisterTarget.java b/src/main/java/com/bluedelivery/application/user/UserRegisterTarget.java similarity index 84% rename from src/main/java/com/bluedelivery/user/application/UserRegisterTarget.java rename to src/main/java/com/bluedelivery/application/user/UserRegisterTarget.java index de32e340..111ed4ee 100644 --- a/src/main/java/com/bluedelivery/user/application/UserRegisterTarget.java +++ b/src/main/java/com/bluedelivery/application/user/UserRegisterTarget.java @@ -1,8 +1,8 @@ -package com.bluedelivery.user.application; +package com.bluedelivery.application.user; import java.time.LocalDate; -import com.bluedelivery.user.domain.User; +import com.bluedelivery.domain.user.User; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/bluedelivery/user/application/adapter/UserManagementServiceHttp.java b/src/main/java/com/bluedelivery/application/user/adapter/UserManagementServiceHttp.java similarity index 79% rename from src/main/java/com/bluedelivery/user/application/adapter/UserManagementServiceHttp.java rename to src/main/java/com/bluedelivery/application/user/adapter/UserManagementServiceHttp.java index 44e673a6..3af59c87 100644 --- a/src/main/java/com/bluedelivery/user/application/adapter/UserManagementServiceHttp.java +++ b/src/main/java/com/bluedelivery/application/user/adapter/UserManagementServiceHttp.java @@ -1,22 +1,22 @@ -package com.bluedelivery.user.application.adapter; +package com.bluedelivery.application.user.adapter; import java.util.Locale; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import com.bluedelivery.common.address.AddressService; -import com.bluedelivery.common.address.domain.Address; -import com.bluedelivery.common.address.domain.BuildingInfo; -import com.bluedelivery.exception.ApiException; -import com.bluedelivery.response.ErrorCode; -import com.bluedelivery.user.application.AddAddressTarget; -import com.bluedelivery.user.application.DeleteAccountTarget; -import com.bluedelivery.user.application.UpdateAccountTarget; -import com.bluedelivery.user.application.UserManagementService; -import com.bluedelivery.user.application.UserRegisterTarget; -import com.bluedelivery.user.domain.User; -import com.bluedelivery.user.domain.UserRepository; +import com.bluedelivery.application.address.AddressService; +import com.bluedelivery.application.user.AddAddressTarget; +import com.bluedelivery.application.user.DeleteAccountTarget; +import com.bluedelivery.application.user.UpdateAccountTarget; +import com.bluedelivery.application.user.UserManagementService; +import com.bluedelivery.application.user.UserRegisterTarget; +import com.bluedelivery.common.response.ApiException; +import com.bluedelivery.common.response.ErrorCode; +import com.bluedelivery.domain.address.Address; +import com.bluedelivery.domain.address.BuildingInfo; +import com.bluedelivery.domain.user.User; +import com.bluedelivery.domain.user.UserRepository; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/bluedelivery/exception/ApiException.java b/src/main/java/com/bluedelivery/common/response/ApiException.java similarity index 76% rename from src/main/java/com/bluedelivery/exception/ApiException.java rename to src/main/java/com/bluedelivery/common/response/ApiException.java index 43f164cf..b4037aa3 100644 --- a/src/main/java/com/bluedelivery/exception/ApiException.java +++ b/src/main/java/com/bluedelivery/common/response/ApiException.java @@ -1,6 +1,4 @@ -package com.bluedelivery.exception; - -import com.bluedelivery.response.ErrorCode; +package com.bluedelivery.common.response; public class ApiException extends RuntimeException { diff --git a/src/main/java/com/bluedelivery/response/ErrorCode.java b/src/main/java/com/bluedelivery/common/response/ErrorCode.java similarity index 95% rename from src/main/java/com/bluedelivery/response/ErrorCode.java rename to src/main/java/com/bluedelivery/common/response/ErrorCode.java index 36f035e9..9fc86b73 100644 --- a/src/main/java/com/bluedelivery/response/ErrorCode.java +++ b/src/main/java/com/bluedelivery/common/response/ErrorCode.java @@ -1,6 +1,6 @@ -package com.bluedelivery.response; +package com.bluedelivery.common.response; -import static com.bluedelivery.response.HttpResponse.*; +import static com.bluedelivery.common.response.HttpResponse.*; import org.springframework.http.HttpStatus; diff --git a/src/main/java/com/bluedelivery/response/HttpResponse.java b/src/main/java/com/bluedelivery/common/response/HttpResponse.java similarity index 97% rename from src/main/java/com/bluedelivery/response/HttpResponse.java rename to src/main/java/com/bluedelivery/common/response/HttpResponse.java index 81c49185..e733a841 100644 --- a/src/main/java/com/bluedelivery/response/HttpResponse.java +++ b/src/main/java/com/bluedelivery/common/response/HttpResponse.java @@ -1,4 +1,4 @@ -package com.bluedelivery.response; +package com.bluedelivery.common.response; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/main/java/com/bluedelivery/config/GlobalExceptionHandler.java b/src/main/java/com/bluedelivery/config/GlobalExceptionHandler.java index 06710712..959b7b59 100644 --- a/src/main/java/com/bluedelivery/config/GlobalExceptionHandler.java +++ b/src/main/java/com/bluedelivery/config/GlobalExceptionHandler.java @@ -1,6 +1,6 @@ package com.bluedelivery.config; -import static com.bluedelivery.response.HttpResponse.*; +import static com.bluedelivery.common.response.HttpResponse.*; import java.util.LinkedHashMap; import java.util.Map; @@ -12,9 +12,9 @@ import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.RestControllerAdvice; -import com.bluedelivery.exception.ApiException; -import com.bluedelivery.response.ErrorCode; -import com.bluedelivery.response.HttpResponse; +import com.bluedelivery.common.response.ApiException; +import com.bluedelivery.common.response.ErrorCode; +import com.bluedelivery.common.response.HttpResponse; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/com/bluedelivery/config/RedisConfig.java b/src/main/java/com/bluedelivery/config/RedisConfig.java index db2eb349..101d5d83 100644 --- a/src/main/java/com/bluedelivery/config/RedisConfig.java +++ b/src/main/java/com/bluedelivery/config/RedisConfig.java @@ -9,9 +9,9 @@ import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; import org.springframework.data.redis.serializer.StringRedisSerializer; -import com.bluedelivery.common.authentication.domain.Authentication; -import com.bluedelivery.common.authentication.domain.AuthenticationRepository; -import com.bluedelivery.common.authentication.infra.AuthenticationRedisRepository; +import com.bluedelivery.domain.authentication.Authentication; +import com.bluedelivery.domain.authentication.AuthenticationRepository; +import com.bluedelivery.infra.authentication.AuthenticationRedisRepository; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; diff --git a/src/main/java/com/bluedelivery/config/WebConfig.java b/src/main/java/com/bluedelivery/config/WebConfig.java index 26ed6b59..7ab8b0aa 100644 --- a/src/main/java/com/bluedelivery/config/WebConfig.java +++ b/src/main/java/com/bluedelivery/config/WebConfig.java @@ -8,9 +8,9 @@ import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -import com.bluedelivery.common.authentication.AuthenticatedUserArgumentResolver; -import com.bluedelivery.common.authentication.UserAuthInterceptor; -import com.bluedelivery.common.authentication.application.AuthenticationService; +import com.bluedelivery.application.authentication.AuthenticationService; +import com.bluedelivery.infra.authentication.AuthenticatedUserArgumentResolver; +import com.bluedelivery.infra.authentication.UserAuthInterceptor; @Configuration public class WebConfig implements WebMvcConfigurer { diff --git a/src/main/java/com/bluedelivery/common/address/domain/Address.java b/src/main/java/com/bluedelivery/domain/address/Address.java similarity index 95% rename from src/main/java/com/bluedelivery/common/address/domain/Address.java rename to src/main/java/com/bluedelivery/domain/address/Address.java index e6d14b6d..72e3e315 100644 --- a/src/main/java/com/bluedelivery/common/address/domain/Address.java +++ b/src/main/java/com/bluedelivery/domain/address/Address.java @@ -1,4 +1,4 @@ -package com.bluedelivery.common.address.domain; +package com.bluedelivery.domain.address; import java.util.Objects; @@ -11,7 +11,7 @@ import javax.persistence.ManyToOne; import javax.persistence.OneToOne; -import com.bluedelivery.user.domain.User; +import com.bluedelivery.domain.user.User; @Entity public class Address { diff --git a/src/main/java/com/bluedelivery/common/address/domain/AddressRepository.java b/src/main/java/com/bluedelivery/domain/address/AddressRepository.java similarity index 71% rename from src/main/java/com/bluedelivery/common/address/domain/AddressRepository.java rename to src/main/java/com/bluedelivery/domain/address/AddressRepository.java index 6ccdccaa..e17f50c4 100644 --- a/src/main/java/com/bluedelivery/common/address/domain/AddressRepository.java +++ b/src/main/java/com/bluedelivery/domain/address/AddressRepository.java @@ -1,10 +1,10 @@ -package com.bluedelivery.common.address.domain; +package com.bluedelivery.domain.address; import java.util.Optional; import org.springframework.data.jpa.repository.JpaRepository; -import com.bluedelivery.user.domain.User; +import com.bluedelivery.domain.user.User; public interface AddressRepository extends JpaRepository { Optional
findByIdAndUser(Long id, User user); diff --git a/src/main/java/com/bluedelivery/common/address/domain/Addresses.java b/src/main/java/com/bluedelivery/domain/address/Addresses.java similarity index 92% rename from src/main/java/com/bluedelivery/common/address/domain/Addresses.java rename to src/main/java/com/bluedelivery/domain/address/Addresses.java index 900a6779..913afb86 100644 --- a/src/main/java/com/bluedelivery/common/address/domain/Addresses.java +++ b/src/main/java/com/bluedelivery/domain/address/Addresses.java @@ -1,6 +1,6 @@ -package com.bluedelivery.common.address.domain; +package com.bluedelivery.domain.address; -import static com.bluedelivery.response.ErrorCode.*; +import static com.bluedelivery.common.response.ErrorCode.*; import static java.util.Objects.isNull; import java.util.HashSet; @@ -15,7 +15,7 @@ import javax.persistence.OneToMany; import javax.persistence.OneToOne; -import com.bluedelivery.exception.ApiException; +import com.bluedelivery.common.response.ApiException; @Embeddable public class Addresses { diff --git a/src/main/java/com/bluedelivery/common/address/domain/BuildingInfo.java b/src/main/java/com/bluedelivery/domain/address/BuildingInfo.java similarity index 99% rename from src/main/java/com/bluedelivery/common/address/domain/BuildingInfo.java rename to src/main/java/com/bluedelivery/domain/address/BuildingInfo.java index 6faf3b82..aef25be0 100644 --- a/src/main/java/com/bluedelivery/common/address/domain/BuildingInfo.java +++ b/src/main/java/com/bluedelivery/domain/address/BuildingInfo.java @@ -1,4 +1,4 @@ -package com.bluedelivery.common.address.domain; +package com.bluedelivery.domain.address; import java.math.BigDecimal; import java.util.Objects; diff --git a/src/main/java/com/bluedelivery/common/address/domain/BuildingInfoRepository.java b/src/main/java/com/bluedelivery/domain/address/BuildingInfoRepository.java similarity index 58% rename from src/main/java/com/bluedelivery/common/address/domain/BuildingInfoRepository.java rename to src/main/java/com/bluedelivery/domain/address/BuildingInfoRepository.java index 882d8477..5d1de871 100644 --- a/src/main/java/com/bluedelivery/common/address/domain/BuildingInfoRepository.java +++ b/src/main/java/com/bluedelivery/domain/address/BuildingInfoRepository.java @@ -1,8 +1,6 @@ -package com.bluedelivery.common.address.domain; +package com.bluedelivery.domain.address; import org.springframework.data.jpa.repository.JpaRepository; -import com.bluedelivery.common.address.domain.BuildingInfo; - public interface BuildingInfoRepository extends JpaRepository { } diff --git a/src/main/java/com/bluedelivery/common/address/domain/CityToDong.java b/src/main/java/com/bluedelivery/domain/address/CityToDong.java similarity index 96% rename from src/main/java/com/bluedelivery/common/address/domain/CityToDong.java rename to src/main/java/com/bluedelivery/domain/address/CityToDong.java index d282c649..7f953c66 100644 --- a/src/main/java/com/bluedelivery/common/address/domain/CityToDong.java +++ b/src/main/java/com/bluedelivery/domain/address/CityToDong.java @@ -1,4 +1,4 @@ -package com.bluedelivery.common.address.domain; +package com.bluedelivery.domain.address; import javax.persistence.Entity; import javax.persistence.Id; diff --git a/src/main/java/com/bluedelivery/common/authentication/domain/Authentication.java b/src/main/java/com/bluedelivery/domain/authentication/Authentication.java similarity index 97% rename from src/main/java/com/bluedelivery/common/authentication/domain/Authentication.java rename to src/main/java/com/bluedelivery/domain/authentication/Authentication.java index dcec40fe..5e3a9f89 100644 --- a/src/main/java/com/bluedelivery/common/authentication/domain/Authentication.java +++ b/src/main/java/com/bluedelivery/domain/authentication/Authentication.java @@ -1,4 +1,4 @@ -package com.bluedelivery.common.authentication.domain; +package com.bluedelivery.domain.authentication; import java.io.Serializable; import java.time.Duration; diff --git a/src/main/java/com/bluedelivery/common/authentication/domain/AuthenticationRepository.java b/src/main/java/com/bluedelivery/domain/authentication/AuthenticationRepository.java similarity index 81% rename from src/main/java/com/bluedelivery/common/authentication/domain/AuthenticationRepository.java rename to src/main/java/com/bluedelivery/domain/authentication/AuthenticationRepository.java index 8cff687f..4b985d15 100644 --- a/src/main/java/com/bluedelivery/common/authentication/domain/AuthenticationRepository.java +++ b/src/main/java/com/bluedelivery/domain/authentication/AuthenticationRepository.java @@ -1,4 +1,4 @@ -package com.bluedelivery.common.authentication.domain; +package com.bluedelivery.domain.authentication; import java.util.Optional; diff --git a/src/main/java/com/bluedelivery/user/domain/User.java b/src/main/java/com/bluedelivery/domain/user/User.java similarity index 95% rename from src/main/java/com/bluedelivery/user/domain/User.java rename to src/main/java/com/bluedelivery/domain/user/User.java index a53a6631..52d90bf6 100644 --- a/src/main/java/com/bluedelivery/user/domain/User.java +++ b/src/main/java/com/bluedelivery/domain/user/User.java @@ -1,4 +1,4 @@ -package com.bluedelivery.user.domain; +package com.bluedelivery.domain.user; import java.time.LocalDate; import java.util.Objects; @@ -10,8 +10,8 @@ import javax.persistence.GenerationType; import javax.persistence.Id; -import com.bluedelivery.common.address.domain.Address; -import com.bluedelivery.common.address.domain.Addresses; +import com.bluedelivery.domain.address.Address; +import com.bluedelivery.domain.address.Addresses; @Entity public class User { diff --git a/src/main/java/com/bluedelivery/user/domain/UserRepository.java b/src/main/java/com/bluedelivery/domain/user/UserRepository.java similarity index 87% rename from src/main/java/com/bluedelivery/user/domain/UserRepository.java rename to src/main/java/com/bluedelivery/domain/user/UserRepository.java index 5d5ab851..b5a9e240 100644 --- a/src/main/java/com/bluedelivery/user/domain/UserRepository.java +++ b/src/main/java/com/bluedelivery/domain/user/UserRepository.java @@ -1,4 +1,4 @@ -package com.bluedelivery.user.domain; +package com.bluedelivery.domain.user; import java.util.Optional; diff --git a/src/main/java/com/bluedelivery/common/authentication/AuthenticatedUserArgumentResolver.java b/src/main/java/com/bluedelivery/infra/authentication/AuthenticatedUserArgumentResolver.java similarity index 88% rename from src/main/java/com/bluedelivery/common/authentication/AuthenticatedUserArgumentResolver.java rename to src/main/java/com/bluedelivery/infra/authentication/AuthenticatedUserArgumentResolver.java index 580dd2db..052077c7 100644 --- a/src/main/java/com/bluedelivery/common/authentication/AuthenticatedUserArgumentResolver.java +++ b/src/main/java/com/bluedelivery/infra/authentication/AuthenticatedUserArgumentResolver.java @@ -1,4 +1,4 @@ -package com.bluedelivery.common.authentication; +package com.bluedelivery.infra.authentication; import static org.springframework.http.HttpHeaders.AUTHORIZATION; @@ -14,8 +14,8 @@ import org.springframework.web.method.support.HandlerMethodArgumentResolver; import org.springframework.web.method.support.ModelAndViewContainer; -import com.bluedelivery.common.authentication.application.AuthenticationService; -import com.bluedelivery.common.authentication.domain.Authentication; +import com.bluedelivery.application.authentication.AuthenticationService; +import com.bluedelivery.domain.authentication.Authentication; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/bluedelivery/common/authentication/infra/AuthenticationRedisRepository.java b/src/main/java/com/bluedelivery/infra/authentication/AuthenticationRedisRepository.java similarity index 85% rename from src/main/java/com/bluedelivery/common/authentication/infra/AuthenticationRedisRepository.java rename to src/main/java/com/bluedelivery/infra/authentication/AuthenticationRedisRepository.java index 00832fc2..118f0b3e 100644 --- a/src/main/java/com/bluedelivery/common/authentication/infra/AuthenticationRedisRepository.java +++ b/src/main/java/com/bluedelivery/infra/authentication/AuthenticationRedisRepository.java @@ -1,12 +1,12 @@ -package com.bluedelivery.common.authentication.infra; +package com.bluedelivery.infra.authentication; import java.util.Optional; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Repository; -import com.bluedelivery.common.authentication.domain.Authentication; -import com.bluedelivery.common.authentication.domain.AuthenticationRepository; +import com.bluedelivery.domain.authentication.Authentication; +import com.bluedelivery.domain.authentication.AuthenticationRepository; @Repository public class AuthenticationRedisRepository implements AuthenticationRepository { diff --git a/src/main/java/com/bluedelivery/common/authentication/AuthenticationRequired.java b/src/main/java/com/bluedelivery/infra/authentication/AuthenticationRequired.java similarity index 85% rename from src/main/java/com/bluedelivery/common/authentication/AuthenticationRequired.java rename to src/main/java/com/bluedelivery/infra/authentication/AuthenticationRequired.java index 0596255e..1f4f5073 100644 --- a/src/main/java/com/bluedelivery/common/authentication/AuthenticationRequired.java +++ b/src/main/java/com/bluedelivery/infra/authentication/AuthenticationRequired.java @@ -1,4 +1,4 @@ -package com.bluedelivery.common.authentication; +package com.bluedelivery.infra.authentication; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/src/main/java/com/bluedelivery/common/authentication/UserAuthInterceptor.java b/src/main/java/com/bluedelivery/infra/authentication/UserAuthInterceptor.java similarity index 83% rename from src/main/java/com/bluedelivery/common/authentication/UserAuthInterceptor.java rename to src/main/java/com/bluedelivery/infra/authentication/UserAuthInterceptor.java index 7641f7b9..f6c287a5 100644 --- a/src/main/java/com/bluedelivery/common/authentication/UserAuthInterceptor.java +++ b/src/main/java/com/bluedelivery/infra/authentication/UserAuthInterceptor.java @@ -1,7 +1,7 @@ -package com.bluedelivery.common.authentication; +package com.bluedelivery.infra.authentication; -import static com.bluedelivery.response.ErrorCode.INVALID_AUTHENTICATION; -import static com.bluedelivery.response.ErrorCode.NOT_AUTHORIZED_ACCESS; +import static com.bluedelivery.common.response.ErrorCode.INVALID_AUTHENTICATION; +import static com.bluedelivery.common.response.ErrorCode.NOT_AUTHORIZED_ACCESS; import static org.springframework.http.HttpHeaders.AUTHORIZATION; import java.util.Map; @@ -14,9 +14,9 @@ import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.HandlerMapping; -import com.bluedelivery.common.authentication.application.AuthenticationService; -import com.bluedelivery.common.authentication.domain.Authentication; -import com.bluedelivery.exception.ApiException; +import com.bluedelivery.application.authentication.AuthenticationService; +import com.bluedelivery.common.response.ApiException; +import com.bluedelivery.domain.authentication.Authentication; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/bluedelivery/user/PasswordValidator.java b/src/main/java/com/bluedelivery/infra/user/PasswordValidator.java similarity index 88% rename from src/main/java/com/bluedelivery/user/PasswordValidator.java rename to src/main/java/com/bluedelivery/infra/user/PasswordValidator.java index 39c35c25..10195b50 100644 --- a/src/main/java/com/bluedelivery/user/PasswordValidator.java +++ b/src/main/java/com/bluedelivery/infra/user/PasswordValidator.java @@ -1,4 +1,4 @@ -package com.bluedelivery.user; +package com.bluedelivery.infra.user; import java.util.Objects; @@ -6,7 +6,7 @@ import org.springframework.validation.Errors; import org.springframework.validation.Validator; -import com.bluedelivery.user.api.dto.UserRegisterRequest; +import com.bluedelivery.api.user.UserRegisterRequest; @Component public class PasswordValidator implements Validator { diff --git a/src/main/java/com/bluedelivery/user/infra/UserMapper.java b/src/main/java/com/bluedelivery/infra/user/UserMapper.java similarity index 55% rename from src/main/java/com/bluedelivery/user/infra/UserMapper.java rename to src/main/java/com/bluedelivery/infra/user/UserMapper.java index 38e09300..ea9bfcb4 100644 --- a/src/main/java/com/bluedelivery/user/infra/UserMapper.java +++ b/src/main/java/com/bluedelivery/infra/user/UserMapper.java @@ -1,8 +1,8 @@ -package com.bluedelivery.user.infra; +package com.bluedelivery.infra.user; import org.apache.ibatis.annotations.Mapper; -import com.bluedelivery.user.domain.UserRepository; +import com.bluedelivery.domain.user.UserRepository; @Mapper public interface UserMapper extends UserRepository { diff --git a/src/main/java/com/bluedelivery/shop/category/CategoryManagerController.java b/src/main/java/com/bluedelivery/shop/category/CategoryManagerController.java index bfc1b26d..5083b0f6 100644 --- a/src/main/java/com/bluedelivery/shop/category/CategoryManagerController.java +++ b/src/main/java/com/bluedelivery/shop/category/CategoryManagerController.java @@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; -import com.bluedelivery.response.HttpResponse; +import com.bluedelivery.common.response.HttpResponse; import com.bluedelivery.shop.category.EditCategoryParam.EditCategoryRequest; @RequestMapping("/categories") diff --git a/src/main/java/com/bluedelivery/shop/category/CategoryManagerControllerImpl.java b/src/main/java/com/bluedelivery/shop/category/CategoryManagerControllerImpl.java index c5464b36..c8cf3daa 100644 --- a/src/main/java/com/bluedelivery/shop/category/CategoryManagerControllerImpl.java +++ b/src/main/java/com/bluedelivery/shop/category/CategoryManagerControllerImpl.java @@ -1,6 +1,6 @@ package com.bluedelivery.shop.category; -import static com.bluedelivery.response.HttpResponse.response; +import static com.bluedelivery.common.response.HttpResponse.response; import static com.bluedelivery.shop.category.CreateCategoryParam.*; import java.util.List; @@ -10,9 +10,9 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; -import com.bluedelivery.exception.ApiException; -import com.bluedelivery.response.ErrorCode; -import com.bluedelivery.response.HttpResponse; +import com.bluedelivery.common.response.ApiException; +import com.bluedelivery.common.response.ErrorCode; +import com.bluedelivery.common.response.HttpResponse; import com.bluedelivery.shop.category.EditCategoryParam.EditCategoryRequest; @RestController diff --git a/src/main/java/com/bluedelivery/shop/menu/MenuController.java b/src/main/java/com/bluedelivery/shop/menu/MenuController.java index 91e9f32d..20f619f2 100644 --- a/src/main/java/com/bluedelivery/shop/menu/MenuController.java +++ b/src/main/java/com/bluedelivery/shop/menu/MenuController.java @@ -1,6 +1,6 @@ package com.bluedelivery.shop.menu; -import static com.bluedelivery.response.HttpResponse.*; +import static com.bluedelivery.common.response.HttpResponse.*; import javax.validation.Valid; @@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import com.bluedelivery.response.HttpResponse; +import com.bluedelivery.common.response.HttpResponse; @RestController @RequestMapping("/menu-groups") diff --git a/src/main/java/com/bluedelivery/shop/menu/MenuGroupController.java b/src/main/java/com/bluedelivery/shop/menu/MenuGroupController.java index 3fdd143e..d1dd1b26 100644 --- a/src/main/java/com/bluedelivery/shop/menu/MenuGroupController.java +++ b/src/main/java/com/bluedelivery/shop/menu/MenuGroupController.java @@ -14,8 +14,8 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import com.bluedelivery.exception.ApiException; -import com.bluedelivery.response.ErrorCode; +import com.bluedelivery.common.response.ApiException; +import com.bluedelivery.common.response.ErrorCode; @RestController @RequestMapping("/shops") diff --git a/src/main/java/com/bluedelivery/shop/menu/MenuOptionController.java b/src/main/java/com/bluedelivery/shop/menu/MenuOptionController.java index 30c99d16..fe9dc176 100644 --- a/src/main/java/com/bluedelivery/shop/menu/MenuOptionController.java +++ b/src/main/java/com/bluedelivery/shop/menu/MenuOptionController.java @@ -2,7 +2,7 @@ import org.springframework.http.ResponseEntity; -import com.bluedelivery.response.HttpResponse; +import com.bluedelivery.common.response.HttpResponse; public interface MenuOptionController { diff --git a/src/main/java/com/bluedelivery/shop/menu/MenuOptionControllerImpl.java b/src/main/java/com/bluedelivery/shop/menu/MenuOptionControllerImpl.java index bff4749e..4264fbef 100644 --- a/src/main/java/com/bluedelivery/shop/menu/MenuOptionControllerImpl.java +++ b/src/main/java/com/bluedelivery/shop/menu/MenuOptionControllerImpl.java @@ -9,7 +9,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; -import com.bluedelivery.response.HttpResponse; +import com.bluedelivery.common.response.HttpResponse; @RestController public class MenuOptionControllerImpl implements MenuOptionController { diff --git a/src/main/java/com/bluedelivery/shop/menu/MenuOptionServiceImpl.java b/src/main/java/com/bluedelivery/shop/menu/MenuOptionServiceImpl.java index 6e06d578..821bec0f 100644 --- a/src/main/java/com/bluedelivery/shop/menu/MenuOptionServiceImpl.java +++ b/src/main/java/com/bluedelivery/shop/menu/MenuOptionServiceImpl.java @@ -4,8 +4,8 @@ import org.springframework.stereotype.Service; -import com.bluedelivery.exception.ApiException; -import com.bluedelivery.response.ErrorCode; +import com.bluedelivery.common.response.ApiException; +import com.bluedelivery.common.response.ErrorCode; @Service public class MenuOptionServiceImpl implements MenuOptionService { diff --git a/src/main/java/com/bluedelivery/shop/menu/MenuService.java b/src/main/java/com/bluedelivery/shop/menu/MenuService.java index 60ba1031..548e5ec5 100644 --- a/src/main/java/com/bluedelivery/shop/menu/MenuService.java +++ b/src/main/java/com/bluedelivery/shop/menu/MenuService.java @@ -1,11 +1,11 @@ package com.bluedelivery.shop.menu; -import static com.bluedelivery.response.ErrorCode.*; +import static com.bluedelivery.common.response.ErrorCode.*; import static com.bluedelivery.shop.menu.Menu.*; import org.springframework.stereotype.Service; -import com.bluedelivery.exception.ApiException; +import com.bluedelivery.common.response.ApiException; @Service public class MenuService { diff --git a/src/main/java/com/bluedelivery/shop/shop/ShopUpdateController.java b/src/main/java/com/bluedelivery/shop/shop/ShopUpdateController.java index 1a61dd82..efb65060 100644 --- a/src/main/java/com/bluedelivery/shop/shop/ShopUpdateController.java +++ b/src/main/java/com/bluedelivery/shop/shop/ShopUpdateController.java @@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; -import com.bluedelivery.response.HttpResponse; +import com.bluedelivery.common.response.HttpResponse; import com.bluedelivery.shop.businesshour.UpdateBusinessHoursDto; import com.bluedelivery.shop.suspension.SuspensionRequest; diff --git a/src/main/java/com/bluedelivery/shop/shop/ShopUpdateControllerImpl.java b/src/main/java/com/bluedelivery/shop/shop/ShopUpdateControllerImpl.java index 022d3161..b29238bb 100644 --- a/src/main/java/com/bluedelivery/shop/shop/ShopUpdateControllerImpl.java +++ b/src/main/java/com/bluedelivery/shop/shop/ShopUpdateControllerImpl.java @@ -3,9 +3,9 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; -import com.bluedelivery.exception.ApiException; -import com.bluedelivery.response.ErrorCode; -import com.bluedelivery.response.HttpResponse; +import com.bluedelivery.common.response.ApiException; +import com.bluedelivery.common.response.ErrorCode; +import com.bluedelivery.common.response.HttpResponse; import com.bluedelivery.shop.businesshour.UpdateBusinessHoursDto; import com.bluedelivery.shop.category.CategoryNotFoundException; import com.bluedelivery.shop.suspension.SuspensionRequest; diff --git a/src/main/java/com/bluedelivery/shop/shop/ShopUpdateService.java b/src/main/java/com/bluedelivery/shop/shop/ShopUpdateService.java index f028982c..2a7c277a 100644 --- a/src/main/java/com/bluedelivery/shop/shop/ShopUpdateService.java +++ b/src/main/java/com/bluedelivery/shop/shop/ShopUpdateService.java @@ -1,13 +1,13 @@ package com.bluedelivery.shop.shop; -import static com.bluedelivery.response.ErrorCode.*; +import static com.bluedelivery.common.response.ErrorCode.*; import java.util.List; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import com.bluedelivery.exception.ApiException; +import com.bluedelivery.common.response.ApiException; import com.bluedelivery.shop.businesshour.BusinessHourConditions; import com.bluedelivery.shop.businesshour.BusinessHourPolicy; import com.bluedelivery.shop.businesshour.UpdateBusinessHoursDto; diff --git a/src/main/resources/mybatis/mapper/UserMapper.xml b/src/main/resources/mybatis/mapper/UserMapper.xml index e3d96dc2..cdadd9b2 100644 --- a/src/main/resources/mybatis/mapper/UserMapper.xml +++ b/src/main/resources/mybatis/mapper/UserMapper.xml @@ -3,8 +3,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - + + diff --git a/src/test/java/com/bluedelivery/common/address/AddressesTest.java b/src/test/java/com/bluedelivery/application/address/AddressesTest.java similarity index 93% rename from src/test/java/com/bluedelivery/common/address/AddressesTest.java rename to src/test/java/com/bluedelivery/application/address/AddressesTest.java index 781cf442..26535b6f 100644 --- a/src/test/java/com/bluedelivery/common/address/AddressesTest.java +++ b/src/test/java/com/bluedelivery/application/address/AddressesTest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.common.address; +package com.bluedelivery.application.address; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -6,11 +6,11 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import com.bluedelivery.common.address.domain.Address; -import com.bluedelivery.common.address.domain.Addresses; -import com.bluedelivery.common.address.domain.BuildingInfo; -import com.bluedelivery.exception.ApiException; -import com.bluedelivery.response.ErrorCode; +import com.bluedelivery.common.response.ApiException; +import com.bluedelivery.common.response.ErrorCode; +import com.bluedelivery.domain.address.Address; +import com.bluedelivery.domain.address.Addresses; +import com.bluedelivery.domain.address.BuildingInfo; class AddressesTest { diff --git a/src/test/java/com/bluedelivery/user/application/UserManagementServiceTest.java b/src/test/java/com/bluedelivery/application/user/UserManagementServiceTest.java similarity index 88% rename from src/test/java/com/bluedelivery/user/application/UserManagementServiceTest.java rename to src/test/java/com/bluedelivery/application/user/UserManagementServiceTest.java index 99b7c87e..50e320b1 100644 --- a/src/test/java/com/bluedelivery/user/application/UserManagementServiceTest.java +++ b/src/test/java/com/bluedelivery/application/user/UserManagementServiceTest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.user.application; +package com.bluedelivery.application.user; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.*; @@ -15,11 +15,11 @@ import org.mockito.junit.jupiter.MockitoExtension; import org.springframework.dao.DuplicateKeyException; -import com.bluedelivery.common.address.AddressService; -import com.bluedelivery.exception.ApiException; -import com.bluedelivery.response.ErrorCode; -import com.bluedelivery.user.application.adapter.UserManagementServiceHttp; -import com.bluedelivery.user.domain.UserRepository; +import com.bluedelivery.application.address.AddressService; +import com.bluedelivery.application.user.adapter.UserManagementServiceHttp; +import com.bluedelivery.common.response.ApiException; +import com.bluedelivery.common.response.ErrorCode; +import com.bluedelivery.domain.user.UserRepository; @ExtendWith(MockitoExtension.class) class UserManagementServiceTest { diff --git a/src/test/java/com/bluedelivery/config/interceptor/UserAuthInterceptorTest.java b/src/test/java/com/bluedelivery/config/interceptor/UserAuthInterceptorTest.java index 03fa152f..87e65513 100644 --- a/src/test/java/com/bluedelivery/config/interceptor/UserAuthInterceptorTest.java +++ b/src/test/java/com/bluedelivery/config/interceptor/UserAuthInterceptorTest.java @@ -1,6 +1,6 @@ package com.bluedelivery.config.interceptor; -import static com.bluedelivery.common.authentication.application.AuthenticationService.BEARER_PREFIX; +import static com.bluedelivery.application.authentication.AuthenticationService.BEARER_PREFIX; import static org.mockito.Mockito.when; import static org.springframework.http.HttpHeaders.AUTHORIZATION; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; @@ -19,14 +19,14 @@ import org.springframework.test.web.servlet.ResultActions; import org.springframework.test.web.servlet.setup.MockMvcBuilders; -import com.bluedelivery.common.authentication.UserAuthInterceptor; -import com.bluedelivery.common.authentication.application.AuthenticationService; -import com.bluedelivery.common.authentication.domain.Authentication; +import com.bluedelivery.api.user.UserManagementController; +import com.bluedelivery.api.user.adapter.UserManagementControllerImpl; +import com.bluedelivery.application.authentication.AuthenticationService; +import com.bluedelivery.application.user.UserManagementService; import com.bluedelivery.config.GlobalExceptionHandler; -import com.bluedelivery.user.PasswordValidator; -import com.bluedelivery.user.api.UserManagementController; -import com.bluedelivery.user.api.UserManagementControllerImpl; -import com.bluedelivery.user.application.UserManagementService; +import com.bluedelivery.domain.authentication.Authentication; +import com.bluedelivery.infra.authentication.UserAuthInterceptor; +import com.bluedelivery.infra.user.PasswordValidator; @ExtendWith(MockitoExtension.class) class UserAuthInterceptorTest { diff --git a/src/test/java/com/bluedelivery/config/resolver/AuthenticatedUserArgumentResolverTest.java b/src/test/java/com/bluedelivery/config/resolver/AuthenticatedUserArgumentResolverTest.java index 4e5c5dee..ad61c8dd 100644 --- a/src/test/java/com/bluedelivery/config/resolver/AuthenticatedUserArgumentResolverTest.java +++ b/src/test/java/com/bluedelivery/config/resolver/AuthenticatedUserArgumentResolverTest.java @@ -9,9 +9,9 @@ import org.mockito.junit.jupiter.MockitoExtension; import org.springframework.core.MethodParameter; -import com.bluedelivery.common.authentication.AuthenticatedUserArgumentResolver; -import com.bluedelivery.common.authentication.application.AuthenticationService; -import com.bluedelivery.common.authentication.domain.Authentication; +import com.bluedelivery.application.authentication.AuthenticationService; +import com.bluedelivery.domain.authentication.Authentication; +import com.bluedelivery.infra.authentication.AuthenticatedUserArgumentResolver; @ExtendWith(MockitoExtension.class) class AuthenticatedUserArgumentResolverTest { diff --git a/src/test/java/com/bluedelivery/shop/menu/MenuOptionControllerTest.java b/src/test/java/com/bluedelivery/shop/menu/MenuOptionControllerTest.java index d9f17154..67129b3f 100644 --- a/src/test/java/com/bluedelivery/shop/menu/MenuOptionControllerTest.java +++ b/src/test/java/com/bluedelivery/shop/menu/MenuOptionControllerTest.java @@ -11,8 +11,8 @@ import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MockMvc; -import com.bluedelivery.common.authentication.application.AuthenticationService; -import com.bluedelivery.common.authentication.domain.AuthenticationRepository; +import com.bluedelivery.application.authentication.AuthenticationService; +import com.bluedelivery.domain.authentication.AuthenticationRepository; import com.fasterxml.jackson.databind.ObjectMapper; @WebMvcTest(MenuOptionControllerImpl.class) diff --git a/src/test/java/com/bluedelivery/shop/menu/MenuServiceTest.java b/src/test/java/com/bluedelivery/shop/menu/MenuServiceTest.java index 26ce3b15..06d40d6e 100644 --- a/src/test/java/com/bluedelivery/shop/menu/MenuServiceTest.java +++ b/src/test/java/com/bluedelivery/shop/menu/MenuServiceTest.java @@ -1,6 +1,6 @@ package com.bluedelivery.shop.menu; -import static com.bluedelivery.response.ErrorCode.*; +import static com.bluedelivery.common.response.ErrorCode.*; import static com.bluedelivery.shop.menu.Menu.*; import static org.assertj.core.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*; @@ -14,8 +14,8 @@ import org.mockito.junit.jupiter.MockitoExtension; import org.springframework.test.context.ActiveProfiles; -import com.bluedelivery.exception.ApiException; -import com.bluedelivery.response.ErrorCode; +import com.bluedelivery.common.response.ApiException; +import com.bluedelivery.common.response.ErrorCode; @ExtendWith(MockitoExtension.class) diff --git a/src/test/java/com/bluedelivery/user/UserTest.java b/src/test/java/com/bluedelivery/user/UserTest.java index e4dd8278..22bb2110 100644 --- a/src/test/java/com/bluedelivery/user/UserTest.java +++ b/src/test/java/com/bluedelivery/user/UserTest.java @@ -7,7 +7,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import com.bluedelivery.user.domain.User; +import com.bluedelivery.domain.user.User; class UserTest { diff --git a/src/test/java/com/bluedelivery/user/api/AuthenticationControllerLoginTest.java b/src/test/java/com/bluedelivery/user/api/AuthenticationControllerLoginTest.java index c23d0846..3ac287a6 100644 --- a/src/test/java/com/bluedelivery/user/api/AuthenticationControllerLoginTest.java +++ b/src/test/java/com/bluedelivery/user/api/AuthenticationControllerLoginTest.java @@ -17,11 +17,11 @@ import org.springframework.test.web.servlet.ResultActions; import org.springframework.test.web.servlet.setup.MockMvcBuilders; -import com.bluedelivery.common.authentication.AuthenticatedUserArgumentResolver; -import com.bluedelivery.common.authentication.api.LoginRequest; -import com.bluedelivery.common.authentication.api.adapter.AuthenticationControllerImpl; -import com.bluedelivery.common.authentication.application.AuthenticationService; -import com.bluedelivery.common.authentication.domain.Authentication; +import com.bluedelivery.api.authentication.LoginRequest; +import com.bluedelivery.api.authentication.adapter.AuthenticationControllerImpl; +import com.bluedelivery.application.authentication.AuthenticationService; +import com.bluedelivery.domain.authentication.Authentication; +import com.bluedelivery.infra.authentication.AuthenticatedUserArgumentResolver; import com.fasterxml.jackson.databind.ObjectMapper; @ExtendWith({MockitoExtension.class}) diff --git a/src/test/java/com/bluedelivery/user/api/UserManagementControllerTest.java b/src/test/java/com/bluedelivery/user/api/UserManagementControllerTest.java index f063b08c..80a3d4d3 100644 --- a/src/test/java/com/bluedelivery/user/api/UserManagementControllerTest.java +++ b/src/test/java/com/bluedelivery/user/api/UserManagementControllerTest.java @@ -19,10 +19,12 @@ import org.springframework.test.web.servlet.MvcResult; import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import com.bluedelivery.api.user.UserManagementController; +import com.bluedelivery.api.user.UserRegisterRequest; +import com.bluedelivery.api.user.adapter.UserManagementControllerImpl; +import com.bluedelivery.application.user.UserManagementService; import com.bluedelivery.config.GlobalExceptionHandler; -import com.bluedelivery.user.PasswordValidator; -import com.bluedelivery.user.api.dto.UserRegisterRequest; -import com.bluedelivery.user.application.UserManagementService; +import com.bluedelivery.infra.user.PasswordValidator; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; From 7fcef5769959232970b0ad2ed4951a5e1e15d0ad Mon Sep 17 00:00:00 2001 From: soongjamm Date: Tue, 27 Jul 2021 14:46:41 +0900 Subject: [PATCH 05/18] config -> common.config --- .../bluedelivery/{ => common}/config/CacheConfiguration.java | 2 +- .../{ => common}/config/GlobalExceptionHandler.java | 2 +- .../com/bluedelivery/{ => common}/config/RedisConfig.java | 2 +- .../java/com/bluedelivery/{ => common}/config/WebConfig.java | 2 +- .../config/interceptor/UserAuthInterceptorTest.java | 4 ++-- .../resolver/AuthenticatedUserArgumentResolverTest.java | 2 +- .../shop/category/CategoryManagerControllerImplTest.java | 2 +- .../bluedelivery/user/api/UserManagementControllerTest.java | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) rename src/main/java/com/bluedelivery/{ => common}/config/CacheConfiguration.java (98%) rename src/main/java/com/bluedelivery/{ => common}/config/GlobalExceptionHandler.java (98%) rename src/main/java/com/bluedelivery/{ => common}/config/RedisConfig.java (98%) rename src/main/java/com/bluedelivery/{ => common}/config/WebConfig.java (96%) rename src/test/java/com/bluedelivery/{ => common}/config/interceptor/UserAuthInterceptorTest.java (96%) rename src/test/java/com/bluedelivery/{ => common}/config/resolver/AuthenticatedUserArgumentResolverTest.java (97%) diff --git a/src/main/java/com/bluedelivery/config/CacheConfiguration.java b/src/main/java/com/bluedelivery/common/config/CacheConfiguration.java similarity index 98% rename from src/main/java/com/bluedelivery/config/CacheConfiguration.java rename to src/main/java/com/bluedelivery/common/config/CacheConfiguration.java index 299eea94..41f340db 100644 --- a/src/main/java/com/bluedelivery/config/CacheConfiguration.java +++ b/src/main/java/com/bluedelivery/common/config/CacheConfiguration.java @@ -1,4 +1,4 @@ -package com.bluedelivery.config; +package com.bluedelivery.common.config; import java.time.Duration; diff --git a/src/main/java/com/bluedelivery/config/GlobalExceptionHandler.java b/src/main/java/com/bluedelivery/common/config/GlobalExceptionHandler.java similarity index 98% rename from src/main/java/com/bluedelivery/config/GlobalExceptionHandler.java rename to src/main/java/com/bluedelivery/common/config/GlobalExceptionHandler.java index 959b7b59..8128608f 100644 --- a/src/main/java/com/bluedelivery/config/GlobalExceptionHandler.java +++ b/src/main/java/com/bluedelivery/common/config/GlobalExceptionHandler.java @@ -1,4 +1,4 @@ -package com.bluedelivery.config; +package com.bluedelivery.common.config; import static com.bluedelivery.common.response.HttpResponse.*; diff --git a/src/main/java/com/bluedelivery/config/RedisConfig.java b/src/main/java/com/bluedelivery/common/config/RedisConfig.java similarity index 98% rename from src/main/java/com/bluedelivery/config/RedisConfig.java rename to src/main/java/com/bluedelivery/common/config/RedisConfig.java index 101d5d83..dd4d609a 100644 --- a/src/main/java/com/bluedelivery/config/RedisConfig.java +++ b/src/main/java/com/bluedelivery/common/config/RedisConfig.java @@ -1,4 +1,4 @@ -package com.bluedelivery.config; +package com.bluedelivery.common.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/src/main/java/com/bluedelivery/config/WebConfig.java b/src/main/java/com/bluedelivery/common/config/WebConfig.java similarity index 96% rename from src/main/java/com/bluedelivery/config/WebConfig.java rename to src/main/java/com/bluedelivery/common/config/WebConfig.java index 7ab8b0aa..037d07fd 100644 --- a/src/main/java/com/bluedelivery/config/WebConfig.java +++ b/src/main/java/com/bluedelivery/common/config/WebConfig.java @@ -1,4 +1,4 @@ -package com.bluedelivery.config; +package com.bluedelivery.common.config; import java.util.List; diff --git a/src/test/java/com/bluedelivery/config/interceptor/UserAuthInterceptorTest.java b/src/test/java/com/bluedelivery/common/config/interceptor/UserAuthInterceptorTest.java similarity index 96% rename from src/test/java/com/bluedelivery/config/interceptor/UserAuthInterceptorTest.java rename to src/test/java/com/bluedelivery/common/config/interceptor/UserAuthInterceptorTest.java index 87e65513..00f32644 100644 --- a/src/test/java/com/bluedelivery/config/interceptor/UserAuthInterceptorTest.java +++ b/src/test/java/com/bluedelivery/common/config/interceptor/UserAuthInterceptorTest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.config.interceptor; +package com.bluedelivery.common.config.interceptor; import static com.bluedelivery.application.authentication.AuthenticationService.BEARER_PREFIX; import static org.mockito.Mockito.when; @@ -23,7 +23,7 @@ import com.bluedelivery.api.user.adapter.UserManagementControllerImpl; import com.bluedelivery.application.authentication.AuthenticationService; import com.bluedelivery.application.user.UserManagementService; -import com.bluedelivery.config.GlobalExceptionHandler; +import com.bluedelivery.common.config.GlobalExceptionHandler; import com.bluedelivery.domain.authentication.Authentication; import com.bluedelivery.infra.authentication.UserAuthInterceptor; import com.bluedelivery.infra.user.PasswordValidator; diff --git a/src/test/java/com/bluedelivery/config/resolver/AuthenticatedUserArgumentResolverTest.java b/src/test/java/com/bluedelivery/common/config/resolver/AuthenticatedUserArgumentResolverTest.java similarity index 97% rename from src/test/java/com/bluedelivery/config/resolver/AuthenticatedUserArgumentResolverTest.java rename to src/test/java/com/bluedelivery/common/config/resolver/AuthenticatedUserArgumentResolverTest.java index ad61c8dd..0e3cd63b 100644 --- a/src/test/java/com/bluedelivery/config/resolver/AuthenticatedUserArgumentResolverTest.java +++ b/src/test/java/com/bluedelivery/common/config/resolver/AuthenticatedUserArgumentResolverTest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.config.resolver; +package com.bluedelivery.common.config.resolver; import static org.assertj.core.api.Assertions.assertThat; diff --git a/src/test/java/com/bluedelivery/shop/category/CategoryManagerControllerImplTest.java b/src/test/java/com/bluedelivery/shop/category/CategoryManagerControllerImplTest.java index 25235c0c..52a22902 100644 --- a/src/test/java/com/bluedelivery/shop/category/CategoryManagerControllerImplTest.java +++ b/src/test/java/com/bluedelivery/shop/category/CategoryManagerControllerImplTest.java @@ -21,7 +21,7 @@ import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; -import com.bluedelivery.config.GlobalExceptionHandler; +import com.bluedelivery.common.config.GlobalExceptionHandler; import com.bluedelivery.shop.category.CreateCategoryParam.CreateCategoryRequest; import com.bluedelivery.shop.category.EditCategoryParam.EditCategoryRequest; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/bluedelivery/user/api/UserManagementControllerTest.java b/src/test/java/com/bluedelivery/user/api/UserManagementControllerTest.java index 80a3d4d3..939ea091 100644 --- a/src/test/java/com/bluedelivery/user/api/UserManagementControllerTest.java +++ b/src/test/java/com/bluedelivery/user/api/UserManagementControllerTest.java @@ -23,7 +23,7 @@ import com.bluedelivery.api.user.UserRegisterRequest; import com.bluedelivery.api.user.adapter.UserManagementControllerImpl; import com.bluedelivery.application.user.UserManagementService; -import com.bluedelivery.config.GlobalExceptionHandler; +import com.bluedelivery.common.config.GlobalExceptionHandler; import com.bluedelivery.infra.user.PasswordValidator; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; From d30591b82609f9a18e26719b66e698aa8565d427 Mon Sep 17 00:00:00 2001 From: soongjamm Date: Tue, 27 Jul 2021 16:22:22 +0900 Subject: [PATCH 06/18] =?UTF-8?q?PasswordValidator=EB=A5=BC=20controller?= =?UTF-8?q?=EC=99=80=20=EA=B0=99=EC=9D=80=20=ED=8C=A8=ED=82=A4=EC=A7=80?= =?UTF-8?q?=EB=A1=9C=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../authentication/AuthenticatedUserArgumentResolver.java | 2 +- .../authentication/AuthenticationRequired.java | 2 +- .../{infra => api}/authentication/UserAuthInterceptor.java | 2 +- .../com/bluedelivery/api/user/UserManagementController.java | 5 ++--- .../{infra/user => api/user/adapter}/PasswordValidator.java | 2 +- .../api/user/adapter/UserManagementControllerImpl.java | 1 - src/main/java/com/bluedelivery/common/config/WebConfig.java | 4 ++-- 7 files changed, 8 insertions(+), 10 deletions(-) rename src/main/java/com/bluedelivery/{infra => api}/authentication/AuthenticatedUserArgumentResolver.java (97%) rename src/main/java/com/bluedelivery/{infra => api}/authentication/AuthenticationRequired.java (86%) rename src/main/java/com/bluedelivery/{infra => api}/authentication/UserAuthInterceptor.java (97%) rename src/main/java/com/bluedelivery/{infra/user => api/user/adapter}/PasswordValidator.java (94%) diff --git a/src/main/java/com/bluedelivery/infra/authentication/AuthenticatedUserArgumentResolver.java b/src/main/java/com/bluedelivery/api/authentication/AuthenticatedUserArgumentResolver.java similarity index 97% rename from src/main/java/com/bluedelivery/infra/authentication/AuthenticatedUserArgumentResolver.java rename to src/main/java/com/bluedelivery/api/authentication/AuthenticatedUserArgumentResolver.java index 052077c7..9cdabbc3 100644 --- a/src/main/java/com/bluedelivery/infra/authentication/AuthenticatedUserArgumentResolver.java +++ b/src/main/java/com/bluedelivery/api/authentication/AuthenticatedUserArgumentResolver.java @@ -1,4 +1,4 @@ -package com.bluedelivery.infra.authentication; +package com.bluedelivery.api.authentication; import static org.springframework.http.HttpHeaders.AUTHORIZATION; diff --git a/src/main/java/com/bluedelivery/infra/authentication/AuthenticationRequired.java b/src/main/java/com/bluedelivery/api/authentication/AuthenticationRequired.java similarity index 86% rename from src/main/java/com/bluedelivery/infra/authentication/AuthenticationRequired.java rename to src/main/java/com/bluedelivery/api/authentication/AuthenticationRequired.java index 1f4f5073..233082b3 100644 --- a/src/main/java/com/bluedelivery/infra/authentication/AuthenticationRequired.java +++ b/src/main/java/com/bluedelivery/api/authentication/AuthenticationRequired.java @@ -1,4 +1,4 @@ -package com.bluedelivery.infra.authentication; +package com.bluedelivery.api.authentication; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/src/main/java/com/bluedelivery/infra/authentication/UserAuthInterceptor.java b/src/main/java/com/bluedelivery/api/authentication/UserAuthInterceptor.java similarity index 97% rename from src/main/java/com/bluedelivery/infra/authentication/UserAuthInterceptor.java rename to src/main/java/com/bluedelivery/api/authentication/UserAuthInterceptor.java index f6c287a5..2eb516ce 100644 --- a/src/main/java/com/bluedelivery/infra/authentication/UserAuthInterceptor.java +++ b/src/main/java/com/bluedelivery/api/authentication/UserAuthInterceptor.java @@ -1,4 +1,4 @@ -package com.bluedelivery.infra.authentication; +package com.bluedelivery.api.authentication; import static com.bluedelivery.common.response.ErrorCode.INVALID_AUTHENTICATION; import static com.bluedelivery.common.response.ErrorCode.NOT_AUTHORIZED_ACCESS; diff --git a/src/main/java/com/bluedelivery/api/user/UserManagementController.java b/src/main/java/com/bluedelivery/api/user/UserManagementController.java index ab48e1e3..43e722a6 100644 --- a/src/main/java/com/bluedelivery/api/user/UserManagementController.java +++ b/src/main/java/com/bluedelivery/api/user/UserManagementController.java @@ -13,15 +13,15 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; +import com.bluedelivery.api.authentication.AuthenticationRequired; import com.bluedelivery.common.response.HttpResponse; import com.bluedelivery.domain.authentication.Authentication; -import com.bluedelivery.infra.authentication.AuthenticationRequired; @RequestMapping("/users") @AuthenticationRequired public interface UserManagementController { - @GetMapping("/{id}") + @GetMapping("/") ResponseEntity> getLoggedInUser(Authentication user); /** @@ -83,5 +83,4 @@ ResponseEntity> addAddress(@PathVariable("id") Long id, @PostMapping ResponseEntity register(@Valid @RequestBody UserRegisterRequest registerRequest); - } diff --git a/src/main/java/com/bluedelivery/infra/user/PasswordValidator.java b/src/main/java/com/bluedelivery/api/user/adapter/PasswordValidator.java similarity index 94% rename from src/main/java/com/bluedelivery/infra/user/PasswordValidator.java rename to src/main/java/com/bluedelivery/api/user/adapter/PasswordValidator.java index 10195b50..ea729f4e 100644 --- a/src/main/java/com/bluedelivery/infra/user/PasswordValidator.java +++ b/src/main/java/com/bluedelivery/api/user/adapter/PasswordValidator.java @@ -1,4 +1,4 @@ -package com.bluedelivery.infra.user; +package com.bluedelivery.api.user.adapter; import java.util.Objects; diff --git a/src/main/java/com/bluedelivery/api/user/adapter/UserManagementControllerImpl.java b/src/main/java/com/bluedelivery/api/user/adapter/UserManagementControllerImpl.java index b4cea529..fe170b2d 100644 --- a/src/main/java/com/bluedelivery/api/user/adapter/UserManagementControllerImpl.java +++ b/src/main/java/com/bluedelivery/api/user/adapter/UserManagementControllerImpl.java @@ -20,7 +20,6 @@ import com.bluedelivery.common.response.HttpResponse; import com.bluedelivery.domain.address.Address; import com.bluedelivery.domain.authentication.Authentication; -import com.bluedelivery.infra.user.PasswordValidator; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/bluedelivery/common/config/WebConfig.java b/src/main/java/com/bluedelivery/common/config/WebConfig.java index 037d07fd..d5757ac4 100644 --- a/src/main/java/com/bluedelivery/common/config/WebConfig.java +++ b/src/main/java/com/bluedelivery/common/config/WebConfig.java @@ -8,9 +8,9 @@ import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import com.bluedelivery.api.authentication.AuthenticatedUserArgumentResolver; +import com.bluedelivery.api.authentication.UserAuthInterceptor; import com.bluedelivery.application.authentication.AuthenticationService; -import com.bluedelivery.infra.authentication.AuthenticatedUserArgumentResolver; -import com.bluedelivery.infra.authentication.UserAuthInterceptor; @Configuration public class WebConfig implements WebMvcConfigurer { From b732e2f689bf4034f341484707e0e5a8af9c398c Mon Sep 17 00:00:00 2001 From: soongjamm Date: Tue, 27 Jul 2021 16:25:40 +0900 Subject: [PATCH 07/18] test package --- ...AuthenticatedUserArgumentResolverTest.java | 3 +- .../AuthenticationControllerLoginTest.java | 4 +- .../UserAuthInterceptorTest.java | 38 ++++++++++--------- .../user}/UserManagementControllerTest.java | 4 +- .../common/{ => regex}/EncryptUtilsTest.java | 4 +- .../common/{ => regex}/PasswordRegexTest.java | 4 +- .../common/{ => regex}/PhoneRegexTest.java | 4 +- .../{ => regex}/ShopPhoneRegexTest.java | 4 +- .../address/AddressesTest.java | 5 +-- .../{ => domain}/user/UserTest.java | 2 +- 10 files changed, 39 insertions(+), 33 deletions(-) rename src/test/java/com/bluedelivery/{common/config/resolver => api/authentication}/AuthenticatedUserArgumentResolverTest.java (94%) rename src/test/java/com/bluedelivery/{user/api => api/authentication}/AuthenticationControllerLoginTest.java (95%) rename src/test/java/com/bluedelivery/{common/config/interceptor => api/authentication}/UserAuthInterceptorTest.java (75%) rename src/test/java/com/bluedelivery/{user/api => api/user}/UserManagementControllerTest.java (97%) rename src/test/java/com/bluedelivery/common/{ => regex}/EncryptUtilsTest.java (79%) rename src/test/java/com/bluedelivery/common/{ => regex}/PasswordRegexTest.java (90%) rename src/test/java/com/bluedelivery/common/{ => regex}/PhoneRegexTest.java (90%) rename src/test/java/com/bluedelivery/common/{ => regex}/ShopPhoneRegexTest.java (90%) rename src/test/java/com/bluedelivery/{application => domain}/address/AddressesTest.java (95%) rename src/test/java/com/bluedelivery/{ => domain}/user/UserTest.java (94%) diff --git a/src/test/java/com/bluedelivery/common/config/resolver/AuthenticatedUserArgumentResolverTest.java b/src/test/java/com/bluedelivery/api/authentication/AuthenticatedUserArgumentResolverTest.java similarity index 94% rename from src/test/java/com/bluedelivery/common/config/resolver/AuthenticatedUserArgumentResolverTest.java rename to src/test/java/com/bluedelivery/api/authentication/AuthenticatedUserArgumentResolverTest.java index 0e3cd63b..dba509a2 100644 --- a/src/test/java/com/bluedelivery/common/config/resolver/AuthenticatedUserArgumentResolverTest.java +++ b/src/test/java/com/bluedelivery/api/authentication/AuthenticatedUserArgumentResolverTest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.common.config.resolver; +package com.bluedelivery.api.authentication; import static org.assertj.core.api.Assertions.assertThat; @@ -11,7 +11,6 @@ import com.bluedelivery.application.authentication.AuthenticationService; import com.bluedelivery.domain.authentication.Authentication; -import com.bluedelivery.infra.authentication.AuthenticatedUserArgumentResolver; @ExtendWith(MockitoExtension.class) class AuthenticatedUserArgumentResolverTest { diff --git a/src/test/java/com/bluedelivery/user/api/AuthenticationControllerLoginTest.java b/src/test/java/com/bluedelivery/api/authentication/AuthenticationControllerLoginTest.java similarity index 95% rename from src/test/java/com/bluedelivery/user/api/AuthenticationControllerLoginTest.java rename to src/test/java/com/bluedelivery/api/authentication/AuthenticationControllerLoginTest.java index 3ac287a6..4f07a118 100644 --- a/src/test/java/com/bluedelivery/user/api/AuthenticationControllerLoginTest.java +++ b/src/test/java/com/bluedelivery/api/authentication/AuthenticationControllerLoginTest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.user.api; +package com.bluedelivery.api.authentication; import static org.hamcrest.Matchers.*; import static org.mockito.Mockito.when; @@ -17,11 +17,11 @@ import org.springframework.test.web.servlet.ResultActions; import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import com.bluedelivery.api.authentication.AuthenticatedUserArgumentResolver; import com.bluedelivery.api.authentication.LoginRequest; import com.bluedelivery.api.authentication.adapter.AuthenticationControllerImpl; import com.bluedelivery.application.authentication.AuthenticationService; import com.bluedelivery.domain.authentication.Authentication; -import com.bluedelivery.infra.authentication.AuthenticatedUserArgumentResolver; import com.fasterxml.jackson.databind.ObjectMapper; @ExtendWith({MockitoExtension.class}) diff --git a/src/test/java/com/bluedelivery/common/config/interceptor/UserAuthInterceptorTest.java b/src/test/java/com/bluedelivery/api/authentication/UserAuthInterceptorTest.java similarity index 75% rename from src/test/java/com/bluedelivery/common/config/interceptor/UserAuthInterceptorTest.java rename to src/test/java/com/bluedelivery/api/authentication/UserAuthInterceptorTest.java index 00f32644..ac197534 100644 --- a/src/test/java/com/bluedelivery/common/config/interceptor/UserAuthInterceptorTest.java +++ b/src/test/java/com/bluedelivery/api/authentication/UserAuthInterceptorTest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.common.config.interceptor; +package com.bluedelivery.api.authentication; import static com.bluedelivery.application.authentication.AuthenticationService.BEARER_PREFIX; import static org.mockito.Mockito.when; @@ -18,36 +18,29 @@ import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.ResultActions; import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; -import com.bluedelivery.api.user.UserManagementController; -import com.bluedelivery.api.user.adapter.UserManagementControllerImpl; +import com.bluedelivery.api.authentication.AuthenticationRequired; +import com.bluedelivery.api.authentication.UserAuthInterceptor; import com.bluedelivery.application.authentication.AuthenticationService; -import com.bluedelivery.application.user.UserManagementService; import com.bluedelivery.common.config.GlobalExceptionHandler; import com.bluedelivery.domain.authentication.Authentication; -import com.bluedelivery.infra.authentication.UserAuthInterceptor; -import com.bluedelivery.infra.user.PasswordValidator; @ExtendWith(MockitoExtension.class) class UserAuthInterceptorTest { private MockMvc mockMvc; - private UserManagementController userManagementController; - - @Mock - private UserManagementService userManagementService; - - @Mock - private PasswordValidator validator; + private TestController testController; @Mock private AuthenticationService authService; @BeforeEach void setup() { - userManagementController = new UserManagementControllerImpl(userManagementService, validator); - mockMvc = MockMvcBuilders.standaloneSetup(userManagementController) + testController = new TestController(); + mockMvc = MockMvcBuilders.standaloneSetup(testController) .addInterceptors(new UserAuthInterceptor(authService)) .setControllerAdvice(new GlobalExceptionHandler()) .alwaysDo(print()) @@ -61,7 +54,7 @@ void successWhenEverythingIsOk() throws Exception { Authentication auth = new Authentication("t0ken", 1L); when(authService.getAuthentication(BEARER_PREFIX + "t0ken")).thenReturn(Optional.of(auth)); //when - ResultActions perform = mockMvc.perform(get("/users/1") + ResultActions perform = mockMvc.perform(get("/{id}", 1) .header(AUTHORIZATION, BEARER_PREFIX + "t0ken")); //then perform.andExpect(status().isOk()); @@ -72,7 +65,7 @@ void successWhenEverythingIsOk() throws Exception { void throwApiExceptionWhenThereIsNoAuthentication() throws Exception { //given //when - ResultActions perform = mockMvc.perform(get("/users/1")); + ResultActions perform = mockMvc.perform(get("/{id}", 1)); //then perform.andExpect(status().isUnauthorized()); } @@ -85,8 +78,17 @@ void throwApiExceptionWhenThereIsWrongAuthentication() throws Exception { String authenticationHeader = BEARER_PREFIX + "t0ken"; when(authService.getAuthentication(authenticationHeader)).thenReturn(Optional.of(auth)); //when - ResultActions perform = mockMvc.perform(get("/users/1").header(AUTHORIZATION, authenticationHeader)); + ResultActions perform = mockMvc.perform(get("/{id}", 1).header(AUTHORIZATION, authenticationHeader)); //then perform.andExpect(status().isForbidden()); } + + @AuthenticationRequired + @RestController + public static class TestController { + @GetMapping("/{id}") + public void testMethod() { + + } + } } diff --git a/src/test/java/com/bluedelivery/user/api/UserManagementControllerTest.java b/src/test/java/com/bluedelivery/api/user/UserManagementControllerTest.java similarity index 97% rename from src/test/java/com/bluedelivery/user/api/UserManagementControllerTest.java rename to src/test/java/com/bluedelivery/api/user/UserManagementControllerTest.java index 939ea091..196d16ec 100644 --- a/src/test/java/com/bluedelivery/user/api/UserManagementControllerTest.java +++ b/src/test/java/com/bluedelivery/api/user/UserManagementControllerTest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.user.api; +package com.bluedelivery.api.user; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; @@ -21,10 +21,10 @@ import com.bluedelivery.api.user.UserManagementController; import com.bluedelivery.api.user.UserRegisterRequest; +import com.bluedelivery.api.user.adapter.PasswordValidator; import com.bluedelivery.api.user.adapter.UserManagementControllerImpl; import com.bluedelivery.application.user.UserManagementService; import com.bluedelivery.common.config.GlobalExceptionHandler; -import com.bluedelivery.infra.user.PasswordValidator; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; diff --git a/src/test/java/com/bluedelivery/common/EncryptUtilsTest.java b/src/test/java/com/bluedelivery/common/regex/EncryptUtilsTest.java similarity index 79% rename from src/test/java/com/bluedelivery/common/EncryptUtilsTest.java rename to src/test/java/com/bluedelivery/common/regex/EncryptUtilsTest.java index dca68a48..b8bdbbc6 100644 --- a/src/test/java/com/bluedelivery/common/EncryptUtilsTest.java +++ b/src/test/java/com/bluedelivery/common/regex/EncryptUtilsTest.java @@ -1,9 +1,11 @@ -package com.bluedelivery.common; +package com.bluedelivery.common.regex; import static org.assertj.core.api.Assertions.assertThat; import org.junit.jupiter.api.Test; +import com.bluedelivery.common.EncryptUtils; + class EncryptUtilsTest { @Test diff --git a/src/test/java/com/bluedelivery/common/PasswordRegexTest.java b/src/test/java/com/bluedelivery/common/regex/PasswordRegexTest.java similarity index 90% rename from src/test/java/com/bluedelivery/common/PasswordRegexTest.java rename to src/test/java/com/bluedelivery/common/regex/PasswordRegexTest.java index e430620d..a00e370a 100644 --- a/src/test/java/com/bluedelivery/common/PasswordRegexTest.java +++ b/src/test/java/com/bluedelivery/common/regex/PasswordRegexTest.java @@ -1,10 +1,12 @@ -package com.bluedelivery.common; +package com.bluedelivery.common.regex; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; +import com.bluedelivery.common.RegexConstants; + @DisplayName("특수문자, 숫자, 알파벳을 각 1개 이상 포함하고 8~20자 사이여야 한다.") public class PasswordRegexTest { diff --git a/src/test/java/com/bluedelivery/common/PhoneRegexTest.java b/src/test/java/com/bluedelivery/common/regex/PhoneRegexTest.java similarity index 90% rename from src/test/java/com/bluedelivery/common/PhoneRegexTest.java rename to src/test/java/com/bluedelivery/common/regex/PhoneRegexTest.java index 742fb771..c9791506 100644 --- a/src/test/java/com/bluedelivery/common/PhoneRegexTest.java +++ b/src/test/java/com/bluedelivery/common/regex/PhoneRegexTest.java @@ -1,10 +1,12 @@ -package com.bluedelivery.common; +package com.bluedelivery.common.regex; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; +import com.bluedelivery.common.RegexConstants; + @DisplayName("01X로 시작하는 10~11자리 숫자여야 한다. '-'은 포함될수도 있고 안될수도 있다.") public class PhoneRegexTest { diff --git a/src/test/java/com/bluedelivery/common/ShopPhoneRegexTest.java b/src/test/java/com/bluedelivery/common/regex/ShopPhoneRegexTest.java similarity index 90% rename from src/test/java/com/bluedelivery/common/ShopPhoneRegexTest.java rename to src/test/java/com/bluedelivery/common/regex/ShopPhoneRegexTest.java index 6dcc83cb..c54a1d23 100644 --- a/src/test/java/com/bluedelivery/common/ShopPhoneRegexTest.java +++ b/src/test/java/com/bluedelivery/common/regex/ShopPhoneRegexTest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.common; +package com.bluedelivery.common.regex; import static org.assertj.core.api.Assertions.*; @@ -6,6 +6,8 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; +import com.bluedelivery.common.RegexConstants; + @DisplayName("휴대폰번호 또는 지역번호로 시작하는 전화번호인지 확인") public class ShopPhoneRegexTest { diff --git a/src/test/java/com/bluedelivery/application/address/AddressesTest.java b/src/test/java/com/bluedelivery/domain/address/AddressesTest.java similarity index 95% rename from src/test/java/com/bluedelivery/application/address/AddressesTest.java rename to src/test/java/com/bluedelivery/domain/address/AddressesTest.java index 26535b6f..8fe03a75 100644 --- a/src/test/java/com/bluedelivery/application/address/AddressesTest.java +++ b/src/test/java/com/bluedelivery/domain/address/AddressesTest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.application.address; +package com.bluedelivery.domain.address; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -8,9 +8,6 @@ import com.bluedelivery.common.response.ApiException; import com.bluedelivery.common.response.ErrorCode; -import com.bluedelivery.domain.address.Address; -import com.bluedelivery.domain.address.Addresses; -import com.bluedelivery.domain.address.BuildingInfo; class AddressesTest { diff --git a/src/test/java/com/bluedelivery/user/UserTest.java b/src/test/java/com/bluedelivery/domain/user/UserTest.java similarity index 94% rename from src/test/java/com/bluedelivery/user/UserTest.java rename to src/test/java/com/bluedelivery/domain/user/UserTest.java index 22bb2110..70081f7c 100644 --- a/src/test/java/com/bluedelivery/user/UserTest.java +++ b/src/test/java/com/bluedelivery/domain/user/UserTest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.user; +package com.bluedelivery.domain.user; import static org.assertj.core.api.Assertions.*; From 69115a4ba099cca440a3ed98e023a3c63c61bb59 Mon Sep 17 00:00:00 2001 From: soongjamm Date: Tue, 27 Jul 2021 16:38:21 +0900 Subject: [PATCH 08/18] =?UTF-8?q?(AddressService)=20application=20->=20dom?= =?UTF-8?q?ain=20=EC=9C=BC=EB=A1=9C=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/address/AddressService.java | 26 ------------------- .../adapter/UserManagementServiceHttp.java | 2 +- .../address/AddressService.java} | 24 +++++++++++------ .../user/UserManagementServiceTest.java | 2 +- 4 files changed, 18 insertions(+), 36 deletions(-) delete mode 100644 src/main/java/com/bluedelivery/application/address/AddressService.java rename src/main/java/com/bluedelivery/{application/address/adapter/AddressServiceImpl.java => domain/address/AddressService.java} (58%) diff --git a/src/main/java/com/bluedelivery/application/address/AddressService.java b/src/main/java/com/bluedelivery/application/address/AddressService.java deleted file mode 100644 index 404d4410..00000000 --- a/src/main/java/com/bluedelivery/application/address/AddressService.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.bluedelivery.application.address; - -import com.bluedelivery.common.response.ApiException; -import com.bluedelivery.domain.address.Address; -import com.bluedelivery.domain.address.BuildingInfo; -import com.bluedelivery.domain.user.User; - -public interface AddressService { - /** - * 주어진 건물관리번호에 해당하는 건물 정보를 조회한다. - * - * @param buildingManagementNumber - * @return 주소를 포함한 건물 정보 - * @throws ApiException 검색 결과가 없는 경우 (ErrorCode# ADDRESS_DOES_NOT_EXIST) - */ - BuildingInfo getBuildingAddress(String buildingManagementNumber); - - /** - * 주어진 주소 id와 유저 정보로 주소를 조회한다. - * - * @param addressId 주소 id - * @param user 유저 객체 - * @return * @throws ApiException 검색 결과가 없는 경우 (ErrorCode# ADDRESS_DOES_NOT_EXIST) - */ - Address getAddress(Long addressId, User user); -} diff --git a/src/main/java/com/bluedelivery/application/user/adapter/UserManagementServiceHttp.java b/src/main/java/com/bluedelivery/application/user/adapter/UserManagementServiceHttp.java index 3af59c87..33f1a4b3 100644 --- a/src/main/java/com/bluedelivery/application/user/adapter/UserManagementServiceHttp.java +++ b/src/main/java/com/bluedelivery/application/user/adapter/UserManagementServiceHttp.java @@ -5,7 +5,6 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import com.bluedelivery.application.address.AddressService; import com.bluedelivery.application.user.AddAddressTarget; import com.bluedelivery.application.user.DeleteAccountTarget; import com.bluedelivery.application.user.UpdateAccountTarget; @@ -14,6 +13,7 @@ import com.bluedelivery.common.response.ApiException; import com.bluedelivery.common.response.ErrorCode; import com.bluedelivery.domain.address.Address; +import com.bluedelivery.domain.address.AddressService; import com.bluedelivery.domain.address.BuildingInfo; import com.bluedelivery.domain.user.User; import com.bluedelivery.domain.user.UserRepository; diff --git a/src/main/java/com/bluedelivery/application/address/adapter/AddressServiceImpl.java b/src/main/java/com/bluedelivery/domain/address/AddressService.java similarity index 58% rename from src/main/java/com/bluedelivery/application/address/adapter/AddressServiceImpl.java rename to src/main/java/com/bluedelivery/domain/address/AddressService.java index 6942bc00..f1aae4da 100644 --- a/src/main/java/com/bluedelivery/application/address/adapter/AddressServiceImpl.java +++ b/src/main/java/com/bluedelivery/domain/address/AddressService.java @@ -1,32 +1,40 @@ -package com.bluedelivery.application.address.adapter; +package com.bluedelivery.domain.address; import static com.bluedelivery.common.response.ErrorCode.ADDRESS_DOES_NOT_EXIST; import org.springframework.stereotype.Service; -import com.bluedelivery.application.address.AddressService; import com.bluedelivery.common.response.ApiException; -import com.bluedelivery.domain.address.Address; -import com.bluedelivery.domain.address.AddressRepository; -import com.bluedelivery.domain.address.BuildingInfo; -import com.bluedelivery.domain.address.BuildingInfoRepository; import com.bluedelivery.domain.user.User; import lombok.RequiredArgsConstructor; @RequiredArgsConstructor @Service -public class AddressServiceImpl implements AddressService { +public class AddressService { private final AddressRepository addressRepository; private final BuildingInfoRepository buildingInfoRepository; + /** + * 주어진 건물관리번호에 해당하는 건물 정보를 조회한다. + * + * @param buildingManagementNumber + * @return 주소를 포함한 건물 정보 + * @throws ApiException 검색 결과가 없는 경우 (ErrorCode# ADDRESS_DOES_NOT_EXIST) + */ public BuildingInfo getBuildingAddress(String buildingManagementNumber) { return buildingInfoRepository.findById(buildingManagementNumber) .orElseThrow(() -> new ApiException(ADDRESS_DOES_NOT_EXIST)); } - @Override + /** + * 주어진 주소 id와 유저 정보로 주소를 조회한다. + * + * @param addressId 주소 id + * @param user 유저 객체 + * @return * @throws ApiException 검색 결과가 없는 경우 (ErrorCode# ADDRESS_DOES_NOT_EXIST) + */ public Address getAddress(Long addressId, User user) { return addressRepository.findByIdAndUser(addressId, user) .orElseThrow(() -> new ApiException(ADDRESS_DOES_NOT_EXIST)); diff --git a/src/test/java/com/bluedelivery/application/user/UserManagementServiceTest.java b/src/test/java/com/bluedelivery/application/user/UserManagementServiceTest.java index 50e320b1..38b0ab28 100644 --- a/src/test/java/com/bluedelivery/application/user/UserManagementServiceTest.java +++ b/src/test/java/com/bluedelivery/application/user/UserManagementServiceTest.java @@ -15,10 +15,10 @@ import org.mockito.junit.jupiter.MockitoExtension; import org.springframework.dao.DuplicateKeyException; -import com.bluedelivery.application.address.AddressService; import com.bluedelivery.application.user.adapter.UserManagementServiceHttp; import com.bluedelivery.common.response.ApiException; import com.bluedelivery.common.response.ErrorCode; +import com.bluedelivery.domain.address.AddressService; import com.bluedelivery.domain.user.UserRepository; @ExtendWith(MockitoExtension.class) From eb5df2ace0d9e66351bd611fee497cc44bad3bd9 Mon Sep 17 00:00:00 2001 From: soongjamm Date: Tue, 27 Jul 2021 17:01:27 +0900 Subject: [PATCH 09/18] category package --- .../category/CategoryManagerController.java | 6 ++-- .../CategoryManagerControllerImpl.java | 8 +++-- .../api/category/CreateCategoryRequest.java | 22 ++++++++++++ .../api/category/EditCategoryRequest.java | 23 ++++++++++++ .../category/GetShopsByCategoryResponse.java | 2 +- .../category/CategoryManagerService.java | 4 ++- .../category/CategoryNotFoundException.java | 2 +- .../category/CreateCategoryParam.java | 12 +++++++ .../category/EditCategoryParam.java | 11 ++++++ .../adapter}/CategoryManagerServiceHttp.java | 9 ++++- .../{shop => domain}/category/Categories.java | 2 +- .../{shop => domain}/category/Category.java | 2 +- .../category/CategoryRepository.java | 3 +- .../category/CategoryMapper.java | 4 ++- .../shop/category/CreateCategoryParam.java | 35 ------------------- .../shop/category/EditCategoryParam.java | 33 ----------------- .../shop/search/ShopExposeController.java | 2 +- .../shop/search/ShopExposeHttpController.java | 2 +- .../shop/search/ShopExposeServiceImpl.java | 2 +- .../shop/shop/EditPhoneRequest.java | 12 +++---- .../java/com/bluedelivery/shop/shop/Shop.java | 4 +-- .../shop/shop/ShopUpdateControllerImpl.java | 2 +- .../shop/shop/ShopUpdateService.java | 2 +- src/main/resources/application.yml | 2 +- .../mybatis/mapper/CategoryMapper.xml | 2 +- .../resources/mybatis/mapper/ShopMapper.xml | 2 +- .../CategoryManagerControllerImplTest.java | 6 ++-- .../category/CategoryManagerServiceTest.java | 6 +++- .../category/CategoriesTest.java | 5 ++- .../category/CategoryTest.java | 4 ++- .../com/bluedelivery/shop/shop/ShopTest.java | 4 +-- .../shop/shop/ShopUpdateServiceTest.java | 2 +- 32 files changed, 128 insertions(+), 109 deletions(-) rename src/main/java/com/bluedelivery/{shop => api}/category/CategoryManagerController.java (89%) rename src/main/java/com/bluedelivery/{shop => api}/category/CategoryManagerControllerImpl.java (88%) create mode 100644 src/main/java/com/bluedelivery/api/category/CreateCategoryRequest.java create mode 100644 src/main/java/com/bluedelivery/api/category/EditCategoryRequest.java rename src/main/java/com/bluedelivery/{shop => api}/category/GetShopsByCategoryResponse.java (91%) rename src/main/java/com/bluedelivery/{shop => application}/category/CategoryManagerService.java (90%) rename src/main/java/com/bluedelivery/{shop => application}/category/CategoryNotFoundException.java (59%) create mode 100644 src/main/java/com/bluedelivery/application/category/CreateCategoryParam.java create mode 100644 src/main/java/com/bluedelivery/application/category/EditCategoryParam.java rename src/main/java/com/bluedelivery/{shop/category => application/category/adapter}/CategoryManagerServiceHttp.java (78%) rename src/main/java/com/bluedelivery/{shop => domain}/category/Categories.java (92%) rename src/main/java/com/bluedelivery/{shop => domain}/category/Category.java (95%) rename src/main/java/com/bluedelivery/{shop => domain}/category/CategoryRepository.java (85%) rename src/main/java/com/bluedelivery/{shop => infra}/category/CategoryMapper.java (53%) delete mode 100644 src/main/java/com/bluedelivery/shop/category/CreateCategoryParam.java delete mode 100644 src/main/java/com/bluedelivery/shop/category/EditCategoryParam.java rename src/test/java/com/bluedelivery/{shop => api}/category/CategoryManagerControllerImplTest.java (96%) rename src/test/java/com/bluedelivery/{shop => application}/category/CategoryManagerServiceTest.java (83%) rename src/test/java/com/bluedelivery/{shop => domain}/category/CategoriesTest.java (93%) rename src/test/java/com/bluedelivery/{shop => domain}/category/CategoryTest.java (84%) diff --git a/src/main/java/com/bluedelivery/shop/category/CategoryManagerController.java b/src/main/java/com/bluedelivery/api/category/CategoryManagerController.java similarity index 89% rename from src/main/java/com/bluedelivery/shop/category/CategoryManagerController.java rename to src/main/java/com/bluedelivery/api/category/CategoryManagerController.java index 5083b0f6..f5a9360c 100644 --- a/src/main/java/com/bluedelivery/shop/category/CategoryManagerController.java +++ b/src/main/java/com/bluedelivery/api/category/CategoryManagerController.java @@ -1,6 +1,4 @@ -package com.bluedelivery.shop.category; - -import static com.bluedelivery.shop.category.CreateCategoryParam.*; +package com.bluedelivery.api.category; import java.util.List; @@ -14,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import com.bluedelivery.common.response.HttpResponse; -import com.bluedelivery.shop.category.EditCategoryParam.EditCategoryRequest; +import com.bluedelivery.domain.category.Categories; @RequestMapping("/categories") public interface CategoryManagerController { diff --git a/src/main/java/com/bluedelivery/shop/category/CategoryManagerControllerImpl.java b/src/main/java/com/bluedelivery/api/category/CategoryManagerControllerImpl.java similarity index 88% rename from src/main/java/com/bluedelivery/shop/category/CategoryManagerControllerImpl.java rename to src/main/java/com/bluedelivery/api/category/CategoryManagerControllerImpl.java index c8cf3daa..e09652fd 100644 --- a/src/main/java/com/bluedelivery/shop/category/CategoryManagerControllerImpl.java +++ b/src/main/java/com/bluedelivery/api/category/CategoryManagerControllerImpl.java @@ -1,7 +1,6 @@ -package com.bluedelivery.shop.category; +package com.bluedelivery.api.category; import static com.bluedelivery.common.response.HttpResponse.response; -import static com.bluedelivery.shop.category.CreateCategoryParam.*; import java.util.List; @@ -10,10 +9,13 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; +import com.bluedelivery.application.category.CategoryManagerService; +import com.bluedelivery.application.category.CategoryNotFoundException; import com.bluedelivery.common.response.ApiException; import com.bluedelivery.common.response.ErrorCode; import com.bluedelivery.common.response.HttpResponse; -import com.bluedelivery.shop.category.EditCategoryParam.EditCategoryRequest; +import com.bluedelivery.domain.category.Categories; +import com.bluedelivery.domain.category.Category; @RestController public class CategoryManagerControllerImpl implements CategoryManagerController { diff --git a/src/main/java/com/bluedelivery/api/category/CreateCategoryRequest.java b/src/main/java/com/bluedelivery/api/category/CreateCategoryRequest.java new file mode 100644 index 00000000..3d624069 --- /dev/null +++ b/src/main/java/com/bluedelivery/api/category/CreateCategoryRequest.java @@ -0,0 +1,22 @@ +package com.bluedelivery.api.category; + +import javax.validation.constraints.Pattern; + +import com.bluedelivery.application.category.CreateCategoryParam; +import com.bluedelivery.common.RegexConstants; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Getter +@NoArgsConstructor +@AllArgsConstructor +public class CreateCategoryRequest { + @Pattern(regexp = RegexConstants.CATEGORY_NAME) + private String name; + + public CreateCategoryParam toParam() { + return new CreateCategoryParam(name); + } +} diff --git a/src/main/java/com/bluedelivery/api/category/EditCategoryRequest.java b/src/main/java/com/bluedelivery/api/category/EditCategoryRequest.java new file mode 100644 index 00000000..60d11d8d --- /dev/null +++ b/src/main/java/com/bluedelivery/api/category/EditCategoryRequest.java @@ -0,0 +1,23 @@ +package com.bluedelivery.api.category; + + +import javax.validation.constraints.Pattern; + +import com.bluedelivery.application.category.EditCategoryParam; +import com.bluedelivery.common.RegexConstants; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Getter +@NoArgsConstructor +@AllArgsConstructor +public class EditCategoryRequest { + @Pattern(regexp = RegexConstants.CATEGORY_NAME) + private String name; + + public EditCategoryParam toParam(Long id) { + return new EditCategoryParam(id, this.name); + } +} diff --git a/src/main/java/com/bluedelivery/shop/category/GetShopsByCategoryResponse.java b/src/main/java/com/bluedelivery/api/category/GetShopsByCategoryResponse.java similarity index 91% rename from src/main/java/com/bluedelivery/shop/category/GetShopsByCategoryResponse.java rename to src/main/java/com/bluedelivery/api/category/GetShopsByCategoryResponse.java index 57a17512..e7218571 100644 --- a/src/main/java/com/bluedelivery/shop/category/GetShopsByCategoryResponse.java +++ b/src/main/java/com/bluedelivery/api/category/GetShopsByCategoryResponse.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.category; +package com.bluedelivery.api.category; import java.util.List; diff --git a/src/main/java/com/bluedelivery/shop/category/CategoryManagerService.java b/src/main/java/com/bluedelivery/application/category/CategoryManagerService.java similarity index 90% rename from src/main/java/com/bluedelivery/shop/category/CategoryManagerService.java rename to src/main/java/com/bluedelivery/application/category/CategoryManagerService.java index b33f2000..64bb534b 100644 --- a/src/main/java/com/bluedelivery/shop/category/CategoryManagerService.java +++ b/src/main/java/com/bluedelivery/application/category/CategoryManagerService.java @@ -1,7 +1,9 @@ -package com.bluedelivery.shop.category; +package com.bluedelivery.application.category; import java.util.List; +import com.bluedelivery.domain.category.Category; + public interface CategoryManagerService { /** diff --git a/src/main/java/com/bluedelivery/shop/category/CategoryNotFoundException.java b/src/main/java/com/bluedelivery/application/category/CategoryNotFoundException.java similarity index 59% rename from src/main/java/com/bluedelivery/shop/category/CategoryNotFoundException.java rename to src/main/java/com/bluedelivery/application/category/CategoryNotFoundException.java index 13dcf9c5..a7deb912 100644 --- a/src/main/java/com/bluedelivery/shop/category/CategoryNotFoundException.java +++ b/src/main/java/com/bluedelivery/application/category/CategoryNotFoundException.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.category; +package com.bluedelivery.application.category; public class CategoryNotFoundException extends RuntimeException { } diff --git a/src/main/java/com/bluedelivery/application/category/CreateCategoryParam.java b/src/main/java/com/bluedelivery/application/category/CreateCategoryParam.java new file mode 100644 index 00000000..691a18cc --- /dev/null +++ b/src/main/java/com/bluedelivery/application/category/CreateCategoryParam.java @@ -0,0 +1,12 @@ +package com.bluedelivery.application.category; + +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +@EqualsAndHashCode +@RequiredArgsConstructor +@Getter +public class CreateCategoryParam { + private final String name; +} diff --git a/src/main/java/com/bluedelivery/application/category/EditCategoryParam.java b/src/main/java/com/bluedelivery/application/category/EditCategoryParam.java new file mode 100644 index 00000000..221ef727 --- /dev/null +++ b/src/main/java/com/bluedelivery/application/category/EditCategoryParam.java @@ -0,0 +1,11 @@ +package com.bluedelivery.application.category; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +@RequiredArgsConstructor +@Getter +public class EditCategoryParam { + private final Long id; + private final String name; +} diff --git a/src/main/java/com/bluedelivery/shop/category/CategoryManagerServiceHttp.java b/src/main/java/com/bluedelivery/application/category/adapter/CategoryManagerServiceHttp.java similarity index 78% rename from src/main/java/com/bluedelivery/shop/category/CategoryManagerServiceHttp.java rename to src/main/java/com/bluedelivery/application/category/adapter/CategoryManagerServiceHttp.java index 77603916..b36b00b7 100644 --- a/src/main/java/com/bluedelivery/shop/category/CategoryManagerServiceHttp.java +++ b/src/main/java/com/bluedelivery/application/category/adapter/CategoryManagerServiceHttp.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.category; +package com.bluedelivery.application.category.adapter; import java.util.List; @@ -6,6 +6,13 @@ import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; +import com.bluedelivery.application.category.CategoryManagerService; +import com.bluedelivery.application.category.CategoryNotFoundException; +import com.bluedelivery.application.category.CreateCategoryParam; +import com.bluedelivery.application.category.EditCategoryParam; +import com.bluedelivery.domain.category.Category; +import com.bluedelivery.domain.category.CategoryRepository; + @Service public class CategoryManagerServiceHttp implements CategoryManagerService { diff --git a/src/main/java/com/bluedelivery/shop/category/Categories.java b/src/main/java/com/bluedelivery/domain/category/Categories.java similarity index 92% rename from src/main/java/com/bluedelivery/shop/category/Categories.java rename to src/main/java/com/bluedelivery/domain/category/Categories.java index 607509cf..e5ed89f7 100644 --- a/src/main/java/com/bluedelivery/shop/category/Categories.java +++ b/src/main/java/com/bluedelivery/domain/category/Categories.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.category; +package com.bluedelivery.domain.category; import java.util.Collection; import java.util.Collections; diff --git a/src/main/java/com/bluedelivery/shop/category/Category.java b/src/main/java/com/bluedelivery/domain/category/Category.java similarity index 95% rename from src/main/java/com/bluedelivery/shop/category/Category.java rename to src/main/java/com/bluedelivery/domain/category/Category.java index 5cd0b7b0..0eeb3218 100644 --- a/src/main/java/com/bluedelivery/shop/category/Category.java +++ b/src/main/java/com/bluedelivery/domain/category/Category.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.category; +package com.bluedelivery.domain.category; import java.util.Objects; diff --git a/src/main/java/com/bluedelivery/shop/category/CategoryRepository.java b/src/main/java/com/bluedelivery/domain/category/CategoryRepository.java similarity index 85% rename from src/main/java/com/bluedelivery/shop/category/CategoryRepository.java rename to src/main/java/com/bluedelivery/domain/category/CategoryRepository.java index d219f567..0554d522 100644 --- a/src/main/java/com/bluedelivery/shop/category/CategoryRepository.java +++ b/src/main/java/com/bluedelivery/domain/category/CategoryRepository.java @@ -1,10 +1,11 @@ -package com.bluedelivery.shop.category; +package com.bluedelivery.domain.category; import java.util.List; import java.util.Optional; import org.springframework.stereotype.Repository; +import com.bluedelivery.application.category.EditCategoryParam; import com.bluedelivery.shop.search.SearchShopByCategoryParam; import com.bluedelivery.shop.shop.Shop; diff --git a/src/main/java/com/bluedelivery/shop/category/CategoryMapper.java b/src/main/java/com/bluedelivery/infra/category/CategoryMapper.java similarity index 53% rename from src/main/java/com/bluedelivery/shop/category/CategoryMapper.java rename to src/main/java/com/bluedelivery/infra/category/CategoryMapper.java index 96a9aefe..4d837136 100644 --- a/src/main/java/com/bluedelivery/shop/category/CategoryMapper.java +++ b/src/main/java/com/bluedelivery/infra/category/CategoryMapper.java @@ -1,7 +1,9 @@ -package com.bluedelivery.shop.category; +package com.bluedelivery.infra.category; import org.apache.ibatis.annotations.Mapper; +import com.bluedelivery.domain.category.CategoryRepository; + @Mapper public interface CategoryMapper extends CategoryRepository { } diff --git a/src/main/java/com/bluedelivery/shop/category/CreateCategoryParam.java b/src/main/java/com/bluedelivery/shop/category/CreateCategoryParam.java deleted file mode 100644 index aa5723e7..00000000 --- a/src/main/java/com/bluedelivery/shop/category/CreateCategoryParam.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.bluedelivery.shop.category; - -import javax.validation.constraints.Pattern; - -import com.bluedelivery.common.RegexConstants; - -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.RequiredArgsConstructor; - -@EqualsAndHashCode -@RequiredArgsConstructor -@Getter -public class CreateCategoryParam { - private final String name; - - @Getter - static class CreateCategoryRequest { - @Pattern(regexp = RegexConstants.CATEGORY_NAME) - private String name; - - public CreateCategoryRequest() { - } - - public CreateCategoryRequest(String name) { - this.name = name; - } - - public CreateCategoryParam toParam() { - return new CreateCategoryParam(name); - } - - - } -} diff --git a/src/main/java/com/bluedelivery/shop/category/EditCategoryParam.java b/src/main/java/com/bluedelivery/shop/category/EditCategoryParam.java deleted file mode 100644 index e109ac5e..00000000 --- a/src/main/java/com/bluedelivery/shop/category/EditCategoryParam.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.bluedelivery.shop.category; - -import javax.validation.constraints.Pattern; - -import com.bluedelivery.common.RegexConstants; - -import lombok.Getter; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor -@Getter -public class EditCategoryParam { - private final Long id; - private final String name; - - @Getter - static class EditCategoryRequest { - @Pattern(regexp = RegexConstants.CATEGORY_NAME) - private String name; - - public EditCategoryRequest() { - } - - public EditCategoryRequest(String name) { - this.name = name; - } - - public EditCategoryParam toParam(Long id) { - return new EditCategoryParam(id, this.name); - } - } - -} diff --git a/src/main/java/com/bluedelivery/shop/search/ShopExposeController.java b/src/main/java/com/bluedelivery/shop/search/ShopExposeController.java index 21c34407..ec07845c 100644 --- a/src/main/java/com/bluedelivery/shop/search/ShopExposeController.java +++ b/src/main/java/com/bluedelivery/shop/search/ShopExposeController.java @@ -4,7 +4,7 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; -import com.bluedelivery.shop.category.GetShopsByCategoryResponse; +import com.bluedelivery.api.category.GetShopsByCategoryResponse; public interface ShopExposeController { diff --git a/src/main/java/com/bluedelivery/shop/search/ShopExposeHttpController.java b/src/main/java/com/bluedelivery/shop/search/ShopExposeHttpController.java index 3000f634..c1ecd78e 100644 --- a/src/main/java/com/bluedelivery/shop/search/ShopExposeHttpController.java +++ b/src/main/java/com/bluedelivery/shop/search/ShopExposeHttpController.java @@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RestController; -import com.bluedelivery.shop.category.GetShopsByCategoryResponse; +import com.bluedelivery.api.category.GetShopsByCategoryResponse; import com.bluedelivery.shop.shop.Shop; @RestController diff --git a/src/main/java/com/bluedelivery/shop/search/ShopExposeServiceImpl.java b/src/main/java/com/bluedelivery/shop/search/ShopExposeServiceImpl.java index 8d2fd58d..c6866492 100644 --- a/src/main/java/com/bluedelivery/shop/search/ShopExposeServiceImpl.java +++ b/src/main/java/com/bluedelivery/shop/search/ShopExposeServiceImpl.java @@ -8,7 +8,7 @@ import org.springframework.stereotype.Service; -import com.bluedelivery.shop.category.CategoryRepository; +import com.bluedelivery.domain.category.CategoryRepository; import com.bluedelivery.shop.shop.Shop; @Service diff --git a/src/main/java/com/bluedelivery/shop/shop/EditPhoneRequest.java b/src/main/java/com/bluedelivery/shop/shop/EditPhoneRequest.java index 8284f4d4..e2728cb3 100644 --- a/src/main/java/com/bluedelivery/shop/shop/EditPhoneRequest.java +++ b/src/main/java/com/bluedelivery/shop/shop/EditPhoneRequest.java @@ -5,18 +5,16 @@ import com.bluedelivery.common.RegexConstants; +import lombok.AllArgsConstructor; +import lombok.NoArgsConstructor; + +@NoArgsConstructor +@AllArgsConstructor public class EditPhoneRequest { @Pattern(regexp = RegexConstants.SHOP_PHONE, message = "잘못된 번호 형식") @NotBlank private String phone; - public EditPhoneRequest() { - } - - public EditPhoneRequest(String phone) { - this.phone = phone.replaceAll("-", ""); - } - public String getPhone() { return phone; } diff --git a/src/main/java/com/bluedelivery/shop/shop/Shop.java b/src/main/java/com/bluedelivery/shop/shop/Shop.java index 7a7a82e2..4f49e042 100644 --- a/src/main/java/com/bluedelivery/shop/shop/Shop.java +++ b/src/main/java/com/bluedelivery/shop/shop/Shop.java @@ -4,9 +4,9 @@ import java.time.LocalDateTime; import java.util.List; +import com.bluedelivery.domain.category.Categories; +import com.bluedelivery.domain.category.Category; import com.bluedelivery.shop.businesshour.BusinessHourPolicy; -import com.bluedelivery.shop.category.Categories; -import com.bluedelivery.shop.category.Category; import com.bluedelivery.shop.closingday.ClosingDayPolicies; import com.bluedelivery.shop.closingday.ClosingDayPolicy; import com.bluedelivery.shop.suspension.Suspension; diff --git a/src/main/java/com/bluedelivery/shop/shop/ShopUpdateControllerImpl.java b/src/main/java/com/bluedelivery/shop/shop/ShopUpdateControllerImpl.java index b29238bb..9b30616f 100644 --- a/src/main/java/com/bluedelivery/shop/shop/ShopUpdateControllerImpl.java +++ b/src/main/java/com/bluedelivery/shop/shop/ShopUpdateControllerImpl.java @@ -3,11 +3,11 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; +import com.bluedelivery.application.category.CategoryNotFoundException; import com.bluedelivery.common.response.ApiException; import com.bluedelivery.common.response.ErrorCode; import com.bluedelivery.common.response.HttpResponse; import com.bluedelivery.shop.businesshour.UpdateBusinessHoursDto; -import com.bluedelivery.shop.category.CategoryNotFoundException; import com.bluedelivery.shop.suspension.SuspensionRequest; @RestController diff --git a/src/main/java/com/bluedelivery/shop/shop/ShopUpdateService.java b/src/main/java/com/bluedelivery/shop/shop/ShopUpdateService.java index 2a7c277a..1ed7903b 100644 --- a/src/main/java/com/bluedelivery/shop/shop/ShopUpdateService.java +++ b/src/main/java/com/bluedelivery/shop/shop/ShopUpdateService.java @@ -7,11 +7,11 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import com.bluedelivery.application.category.CategoryManagerService; import com.bluedelivery.common.response.ApiException; import com.bluedelivery.shop.businesshour.BusinessHourConditions; import com.bluedelivery.shop.businesshour.BusinessHourPolicy; import com.bluedelivery.shop.businesshour.UpdateBusinessHoursDto; -import com.bluedelivery.shop.category.CategoryManagerService; import com.bluedelivery.shop.closingday.LegalHolidayClosing; import com.bluedelivery.shop.suspension.Suspension; diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 9fd72fa1..bb4f9997 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -20,7 +20,7 @@ mybatis: mapper-locations: mybatis/mapper/*.xml type-aliases-package: com.bluedelivery.shop.shop, - com.bluedelivery.shop.category, + com.bluedelivery.domain.category, com.bluedelivery.shop.businesshour, com.bluedelivery.shop.closingday, com.bluedelivery.shop.suspension, diff --git a/src/main/resources/mybatis/mapper/CategoryMapper.xml b/src/main/resources/mybatis/mapper/CategoryMapper.xml index 9e7591c9..d6c210b3 100644 --- a/src/main/resources/mybatis/mapper/CategoryMapper.xml +++ b/src/main/resources/mybatis/mapper/CategoryMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + diff --git a/src/main/resources/mybatis/mapper/ShopMapper.xml b/src/main/resources/mybatis/mapper/ShopMapper.xml index 64f36634..11737881 100644 --- a/src/main/resources/mybatis/mapper/ShopMapper.xml +++ b/src/main/resources/mybatis/mapper/ShopMapper.xml @@ -40,7 +40,7 @@ - SELECT ID AS CATEGORY_ID, NAME AS CATEGORY_NAME, CS.SHOP_ID AS SHOP_ID diff --git a/src/test/java/com/bluedelivery/shop/category/CategoryManagerControllerImplTest.java b/src/test/java/com/bluedelivery/api/category/CategoryManagerControllerImplTest.java similarity index 96% rename from src/test/java/com/bluedelivery/shop/category/CategoryManagerControllerImplTest.java rename to src/test/java/com/bluedelivery/api/category/CategoryManagerControllerImplTest.java index 52a22902..20da1dd1 100644 --- a/src/test/java/com/bluedelivery/shop/category/CategoryManagerControllerImplTest.java +++ b/src/test/java/com/bluedelivery/api/category/CategoryManagerControllerImplTest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.category; +package com.bluedelivery.api.category; import static org.hamcrest.Matchers.*; import static org.mockito.Mockito.when; @@ -21,9 +21,9 @@ import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import com.bluedelivery.application.category.CategoryManagerService; import com.bluedelivery.common.config.GlobalExceptionHandler; -import com.bluedelivery.shop.category.CreateCategoryParam.CreateCategoryRequest; -import com.bluedelivery.shop.category.EditCategoryParam.EditCategoryRequest; +import com.bluedelivery.domain.category.Category; import com.fasterxml.jackson.databind.ObjectMapper; @ExtendWith(MockitoExtension.class) diff --git a/src/test/java/com/bluedelivery/shop/category/CategoryManagerServiceTest.java b/src/test/java/com/bluedelivery/application/category/CategoryManagerServiceTest.java similarity index 83% rename from src/test/java/com/bluedelivery/shop/category/CategoryManagerServiceTest.java rename to src/test/java/com/bluedelivery/application/category/CategoryManagerServiceTest.java index 0911ad9e..1813a0c4 100644 --- a/src/test/java/com/bluedelivery/shop/category/CategoryManagerServiceTest.java +++ b/src/test/java/com/bluedelivery/application/category/CategoryManagerServiceTest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.category; +package com.bluedelivery.application.category; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.when; @@ -10,6 +10,10 @@ import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; +import com.bluedelivery.application.category.adapter.CategoryManagerServiceHttp; +import com.bluedelivery.domain.category.Category; +import com.bluedelivery.domain.category.CategoryRepository; + @ExtendWith(MockitoExtension.class) class CategoryManagerServiceTest { diff --git a/src/test/java/com/bluedelivery/shop/category/CategoriesTest.java b/src/test/java/com/bluedelivery/domain/category/CategoriesTest.java similarity index 93% rename from src/test/java/com/bluedelivery/shop/category/CategoriesTest.java rename to src/test/java/com/bluedelivery/domain/category/CategoriesTest.java index ed16f51d..270e1aca 100644 --- a/src/test/java/com/bluedelivery/shop/category/CategoriesTest.java +++ b/src/test/java/com/bluedelivery/domain/category/CategoriesTest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.category; +package com.bluedelivery.domain.category; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.*; @@ -9,6 +9,9 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import com.bluedelivery.domain.category.Categories; +import com.bluedelivery.domain.category.Category; + class CategoriesTest { private Categories categories = new Categories(); diff --git a/src/test/java/com/bluedelivery/shop/category/CategoryTest.java b/src/test/java/com/bluedelivery/domain/category/CategoryTest.java similarity index 84% rename from src/test/java/com/bluedelivery/shop/category/CategoryTest.java rename to src/test/java/com/bluedelivery/domain/category/CategoryTest.java index 634762c7..da7f22a9 100644 --- a/src/test/java/com/bluedelivery/shop/category/CategoryTest.java +++ b/src/test/java/com/bluedelivery/domain/category/CategoryTest.java @@ -1,10 +1,12 @@ -package com.bluedelivery.shop.category; +package com.bluedelivery.domain.category; import static org.assertj.core.api.Assertions.assertThat; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import com.bluedelivery.domain.category.Category; + public class CategoryTest { @Test @DisplayName("같은 이름을 갖는 카테고리는 동등한 카테고리다.") diff --git a/src/test/java/com/bluedelivery/shop/shop/ShopTest.java b/src/test/java/com/bluedelivery/shop/shop/ShopTest.java index 83c405b8..1454dbf8 100644 --- a/src/test/java/com/bluedelivery/shop/shop/ShopTest.java +++ b/src/test/java/com/bluedelivery/shop/shop/ShopTest.java @@ -7,8 +7,8 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import com.bluedelivery.shop.category.Categories; -import com.bluedelivery.shop.category.Category; +import com.bluedelivery.domain.category.Categories; +import com.bluedelivery.domain.category.Category; class ShopTest { diff --git a/src/test/java/com/bluedelivery/shop/shop/ShopUpdateServiceTest.java b/src/test/java/com/bluedelivery/shop/shop/ShopUpdateServiceTest.java index 8dfa7160..ab633a48 100644 --- a/src/test/java/com/bluedelivery/shop/shop/ShopUpdateServiceTest.java +++ b/src/test/java/com/bluedelivery/shop/shop/ShopUpdateServiceTest.java @@ -16,7 +16,7 @@ import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import com.bluedelivery.shop.category.CategoryManagerService; +import com.bluedelivery.application.category.CategoryManagerService; import com.bluedelivery.shop.closingday.CyclicRegularClosing; import com.bluedelivery.shop.closingday.LegalHolidayClosing; From 648717eba99f09f39cc1dadd0d06da08f265a5c8 Mon Sep 17 00:00:00 2001 From: soongjamm Date: Tue, 27 Jul 2021 17:36:30 +0900 Subject: [PATCH 10/18] shop package --- .githooks/pre-commit | 27 ++++++++++--------- .../category/GetShopsByCategoryResponse.java | 2 +- .../{shop => api}/shop/EditPhoneRequest.java | 2 +- .../search => api/shop}/SearchedShopData.java | 2 +- .../shop}/ShopExposeController.java | 2 +- .../shop/ShopUpdateController.java | 2 +- .../shop/UpdateCategoryRequest.java | 2 +- .../shop/UpdateClosingDaysRequest.java | 5 +++- .../adapter}/ShopExposeHttpController.java | 8 ++++-- .../adapter}/ShopUpdateControllerImpl.java | 7 ++++- .../shop/RegularClosingParam.java | 2 +- .../shop/SearchMenuService.java | 2 +- .../shop}/SearchShopByCategoryParam.java | 2 +- .../shop}/ShopExposeService.java | 4 +-- .../shop/ShopUpdateService.java | 6 ++++- .../shop/TemporaryClosingParam.java | 2 +- .../shop/adapter}/ShopExposeServiceImpl.java | 6 +++-- .../domain/category/CategoryRepository.java | 4 +-- .../{shop => domain}/shop/Shop.java | 2 +- .../{shop => domain}/shop/ShopRepository.java | 4 ++- .../{shop => infra}/shop/ShopMapper.java | 4 ++- src/main/resources/application.yml | 2 +- .../mybatis/mapper/CategoryMapper.xml | 2 +- .../resources/mybatis/mapper/ShopMapper.xml | 2 +- .../shop/ShopUpdateControllerTest.java | 5 +++- .../shop/ShopUpdateServiceTest.java | 5 +++- .../{shop => domain}/shop/ShopTest.java | 3 ++- 27 files changed, 73 insertions(+), 43 deletions(-) rename src/main/java/com/bluedelivery/{shop => api}/shop/EditPhoneRequest.java (93%) rename src/main/java/com/bluedelivery/{shop/search => api/shop}/SearchedShopData.java (94%) rename src/main/java/com/bluedelivery/{shop/search => api/shop}/ShopExposeController.java (95%) rename src/main/java/com/bluedelivery/{shop => api}/shop/ShopUpdateController.java (98%) rename src/main/java/com/bluedelivery/{shop => api}/shop/UpdateCategoryRequest.java (92%) rename src/main/java/com/bluedelivery/{shop => api}/shop/UpdateClosingDaysRequest.java (87%) rename src/main/java/com/bluedelivery/{shop/search => api/shop/adapter}/ShopExposeHttpController.java (82%) rename src/main/java/com/bluedelivery/{shop/shop => api/shop/adapter}/ShopUpdateControllerImpl.java (87%) rename src/main/java/com/bluedelivery/{shop => application}/shop/RegularClosingParam.java (96%) rename src/main/java/com/bluedelivery/{shop => application}/shop/SearchMenuService.java (94%) rename src/main/java/com/bluedelivery/{shop/search => application/shop}/SearchShopByCategoryParam.java (91%) rename src/main/java/com/bluedelivery/{shop/search => application/shop}/ShopExposeService.java (61%) rename src/main/java/com/bluedelivery/{shop => application}/shop/ShopUpdateService.java (93%) rename src/main/java/com/bluedelivery/{shop => application}/shop/TemporaryClosingParam.java (94%) rename src/main/java/com/bluedelivery/{shop/search => application/shop/adapter}/ShopExposeServiceImpl.java (85%) rename src/main/java/com/bluedelivery/{shop => domain}/shop/Shop.java (98%) rename src/main/java/com/bluedelivery/{shop => domain}/shop/ShopRepository.java (88%) rename src/main/java/com/bluedelivery/{shop => infra}/shop/ShopMapper.java (55%) rename src/test/java/com/bluedelivery/{shop => api}/shop/ShopUpdateControllerTest.java (89%) rename src/test/java/com/bluedelivery/{shop => application}/shop/ShopUpdateServiceTest.java (92%) rename src/test/java/com/bluedelivery/{shop => domain}/shop/ShopTest.java (91%) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 3dc2398a..3500a980 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -3,19 +3,20 @@ cd $(dirname ${BASH_SOURCE[0]}) && cd ../ # shell script의 주소로 이동후 프로젝트 루트로 이동 SCRIPT_DIR=`pwd` # shell script의 주소 저장 -# commit 전에 test 수행 -./gradlew clean test - -if [ $? -eq 0 ]; then - echo "================================" - echo "Test has successfully completed" - echo "================================" -else - echo "================================" - echo "Fail to test" - echo "================================" - exit 1 -fi +########################## ./gradlew check 만으로 테스트까지 수행해서 주석처리 했음 ## +## commit 전에 test 수행 +#./gradlew clean test +# +#if [ $? -eq 0 ]; then +# echo "================================" +# echo "Test has successfully completed" +# echo "================================" +#else +# echo "================================" +# echo "Fail to test" +# echo "================================" +# exit 1 +#fi ./gradlew check if [ $? -eq 0 ]; then diff --git a/src/main/java/com/bluedelivery/api/category/GetShopsByCategoryResponse.java b/src/main/java/com/bluedelivery/api/category/GetShopsByCategoryResponse.java index e7218571..dc8ef9af 100644 --- a/src/main/java/com/bluedelivery/api/category/GetShopsByCategoryResponse.java +++ b/src/main/java/com/bluedelivery/api/category/GetShopsByCategoryResponse.java @@ -2,7 +2,7 @@ import java.util.List; -import com.bluedelivery.shop.search.SearchedShopData; +import com.bluedelivery.api.shop.SearchedShopData; public class GetShopsByCategoryResponse { diff --git a/src/main/java/com/bluedelivery/shop/shop/EditPhoneRequest.java b/src/main/java/com/bluedelivery/api/shop/EditPhoneRequest.java similarity index 93% rename from src/main/java/com/bluedelivery/shop/shop/EditPhoneRequest.java rename to src/main/java/com/bluedelivery/api/shop/EditPhoneRequest.java index e2728cb3..71d173e2 100644 --- a/src/main/java/com/bluedelivery/shop/shop/EditPhoneRequest.java +++ b/src/main/java/com/bluedelivery/api/shop/EditPhoneRequest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.shop; +package com.bluedelivery.api.shop; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Pattern; diff --git a/src/main/java/com/bluedelivery/shop/search/SearchedShopData.java b/src/main/java/com/bluedelivery/api/shop/SearchedShopData.java similarity index 94% rename from src/main/java/com/bluedelivery/shop/search/SearchedShopData.java rename to src/main/java/com/bluedelivery/api/shop/SearchedShopData.java index a130627b..9099d2a0 100644 --- a/src/main/java/com/bluedelivery/shop/search/SearchedShopData.java +++ b/src/main/java/com/bluedelivery/api/shop/SearchedShopData.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.search; +package com.bluedelivery.api.shop; // TODO 나중에 대표메뉴 조회결과, 평점, 배달소요시간, 최소주문, 배달팁 정보 등등 추가되어야 함 public class SearchedShopData { diff --git a/src/main/java/com/bluedelivery/shop/search/ShopExposeController.java b/src/main/java/com/bluedelivery/api/shop/ShopExposeController.java similarity index 95% rename from src/main/java/com/bluedelivery/shop/search/ShopExposeController.java rename to src/main/java/com/bluedelivery/api/shop/ShopExposeController.java index ec07845c..f25d2446 100644 --- a/src/main/java/com/bluedelivery/shop/search/ShopExposeController.java +++ b/src/main/java/com/bluedelivery/api/shop/ShopExposeController.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.search; +package com.bluedelivery.api.shop; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; diff --git a/src/main/java/com/bluedelivery/shop/shop/ShopUpdateController.java b/src/main/java/com/bluedelivery/api/shop/ShopUpdateController.java similarity index 98% rename from src/main/java/com/bluedelivery/shop/shop/ShopUpdateController.java rename to src/main/java/com/bluedelivery/api/shop/ShopUpdateController.java index efb65060..2d54556d 100644 --- a/src/main/java/com/bluedelivery/shop/shop/ShopUpdateController.java +++ b/src/main/java/com/bluedelivery/api/shop/ShopUpdateController.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.shop; +package com.bluedelivery.api.shop; import javax.validation.Valid; diff --git a/src/main/java/com/bluedelivery/shop/shop/UpdateCategoryRequest.java b/src/main/java/com/bluedelivery/api/shop/UpdateCategoryRequest.java similarity index 92% rename from src/main/java/com/bluedelivery/shop/shop/UpdateCategoryRequest.java rename to src/main/java/com/bluedelivery/api/shop/UpdateCategoryRequest.java index adc4edcd..0523efc1 100644 --- a/src/main/java/com/bluedelivery/shop/shop/UpdateCategoryRequest.java +++ b/src/main/java/com/bluedelivery/api/shop/UpdateCategoryRequest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.shop; +package com.bluedelivery.api.shop; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/com/bluedelivery/shop/shop/UpdateClosingDaysRequest.java b/src/main/java/com/bluedelivery/api/shop/UpdateClosingDaysRequest.java similarity index 87% rename from src/main/java/com/bluedelivery/shop/shop/UpdateClosingDaysRequest.java rename to src/main/java/com/bluedelivery/api/shop/UpdateClosingDaysRequest.java index aff299d7..099ac323 100644 --- a/src/main/java/com/bluedelivery/shop/shop/UpdateClosingDaysRequest.java +++ b/src/main/java/com/bluedelivery/api/shop/UpdateClosingDaysRequest.java @@ -1,10 +1,13 @@ -package com.bluedelivery.shop.shop; +package com.bluedelivery.api.shop; import java.util.List; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; +import com.bluedelivery.application.shop.RegularClosingParam; +import com.bluedelivery.application.shop.TemporaryClosingParam; + import lombok.NoArgsConstructor; @NoArgsConstructor diff --git a/src/main/java/com/bluedelivery/shop/search/ShopExposeHttpController.java b/src/main/java/com/bluedelivery/api/shop/adapter/ShopExposeHttpController.java similarity index 82% rename from src/main/java/com/bluedelivery/shop/search/ShopExposeHttpController.java rename to src/main/java/com/bluedelivery/api/shop/adapter/ShopExposeHttpController.java index c1ecd78e..a8d9c10b 100644 --- a/src/main/java/com/bluedelivery/shop/search/ShopExposeHttpController.java +++ b/src/main/java/com/bluedelivery/api/shop/adapter/ShopExposeHttpController.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.search; +package com.bluedelivery.api.shop.adapter; import java.time.LocalDateTime; import java.util.List; @@ -11,7 +11,11 @@ import org.springframework.web.bind.annotation.RestController; import com.bluedelivery.api.category.GetShopsByCategoryResponse; -import com.bluedelivery.shop.shop.Shop; +import com.bluedelivery.api.shop.SearchedShopData; +import com.bluedelivery.api.shop.ShopExposeController; +import com.bluedelivery.application.shop.SearchShopByCategoryParam; +import com.bluedelivery.application.shop.ShopExposeService; +import com.bluedelivery.domain.shop.Shop; @RestController public class ShopExposeHttpController implements ShopExposeController { diff --git a/src/main/java/com/bluedelivery/shop/shop/ShopUpdateControllerImpl.java b/src/main/java/com/bluedelivery/api/shop/adapter/ShopUpdateControllerImpl.java similarity index 87% rename from src/main/java/com/bluedelivery/shop/shop/ShopUpdateControllerImpl.java rename to src/main/java/com/bluedelivery/api/shop/adapter/ShopUpdateControllerImpl.java index 9b30616f..3d3c2f8b 100644 --- a/src/main/java/com/bluedelivery/shop/shop/ShopUpdateControllerImpl.java +++ b/src/main/java/com/bluedelivery/api/shop/adapter/ShopUpdateControllerImpl.java @@ -1,9 +1,14 @@ -package com.bluedelivery.shop.shop; +package com.bluedelivery.api.shop.adapter; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; +import com.bluedelivery.api.shop.EditPhoneRequest; +import com.bluedelivery.api.shop.ShopUpdateController; +import com.bluedelivery.api.shop.UpdateCategoryRequest; +import com.bluedelivery.api.shop.UpdateClosingDaysRequest; import com.bluedelivery.application.category.CategoryNotFoundException; +import com.bluedelivery.application.shop.ShopUpdateService; import com.bluedelivery.common.response.ApiException; import com.bluedelivery.common.response.ErrorCode; import com.bluedelivery.common.response.HttpResponse; diff --git a/src/main/java/com/bluedelivery/shop/shop/RegularClosingParam.java b/src/main/java/com/bluedelivery/application/shop/RegularClosingParam.java similarity index 96% rename from src/main/java/com/bluedelivery/shop/shop/RegularClosingParam.java rename to src/main/java/com/bluedelivery/application/shop/RegularClosingParam.java index d513e9d3..1fba5912 100644 --- a/src/main/java/com/bluedelivery/shop/shop/RegularClosingParam.java +++ b/src/main/java/com/bluedelivery/application/shop/RegularClosingParam.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.shop; +package com.bluedelivery.application.shop; import java.time.DayOfWeek; diff --git a/src/main/java/com/bluedelivery/shop/shop/SearchMenuService.java b/src/main/java/com/bluedelivery/application/shop/SearchMenuService.java similarity index 94% rename from src/main/java/com/bluedelivery/shop/shop/SearchMenuService.java rename to src/main/java/com/bluedelivery/application/shop/SearchMenuService.java index 4de120c0..3325235c 100644 --- a/src/main/java/com/bluedelivery/shop/shop/SearchMenuService.java +++ b/src/main/java/com/bluedelivery/application/shop/SearchMenuService.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.shop; +package com.bluedelivery.application.shop; import java.util.List; diff --git a/src/main/java/com/bluedelivery/shop/search/SearchShopByCategoryParam.java b/src/main/java/com/bluedelivery/application/shop/SearchShopByCategoryParam.java similarity index 91% rename from src/main/java/com/bluedelivery/shop/search/SearchShopByCategoryParam.java rename to src/main/java/com/bluedelivery/application/shop/SearchShopByCategoryParam.java index 3da68b3f..c7cdd6fa 100644 --- a/src/main/java/com/bluedelivery/shop/search/SearchShopByCategoryParam.java +++ b/src/main/java/com/bluedelivery/application/shop/SearchShopByCategoryParam.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.search; +package com.bluedelivery.application.shop; import java.time.DayOfWeek; import java.time.LocalDateTime; diff --git a/src/main/java/com/bluedelivery/shop/search/ShopExposeService.java b/src/main/java/com/bluedelivery/application/shop/ShopExposeService.java similarity index 61% rename from src/main/java/com/bluedelivery/shop/search/ShopExposeService.java rename to src/main/java/com/bluedelivery/application/shop/ShopExposeService.java index 7ae985ec..a56f9e97 100644 --- a/src/main/java/com/bluedelivery/shop/search/ShopExposeService.java +++ b/src/main/java/com/bluedelivery/application/shop/ShopExposeService.java @@ -1,8 +1,8 @@ -package com.bluedelivery.shop.search; +package com.bluedelivery.application.shop; import java.util.List; -import com.bluedelivery.shop.shop.Shop; +import com.bluedelivery.domain.shop.Shop; public interface ShopExposeService { List getShopsByCategory(SearchShopByCategoryParam param); diff --git a/src/main/java/com/bluedelivery/shop/shop/ShopUpdateService.java b/src/main/java/com/bluedelivery/application/shop/ShopUpdateService.java similarity index 93% rename from src/main/java/com/bluedelivery/shop/shop/ShopUpdateService.java rename to src/main/java/com/bluedelivery/application/shop/ShopUpdateService.java index 1ed7903b..9512f51f 100644 --- a/src/main/java/com/bluedelivery/shop/shop/ShopUpdateService.java +++ b/src/main/java/com/bluedelivery/application/shop/ShopUpdateService.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.shop; +package com.bluedelivery.application.shop; import static com.bluedelivery.common.response.ErrorCode.*; @@ -7,8 +7,12 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import com.bluedelivery.api.shop.UpdateCategoryRequest; +import com.bluedelivery.api.shop.UpdateClosingDaysRequest; import com.bluedelivery.application.category.CategoryManagerService; import com.bluedelivery.common.response.ApiException; +import com.bluedelivery.domain.shop.Shop; +import com.bluedelivery.domain.shop.ShopRepository; import com.bluedelivery.shop.businesshour.BusinessHourConditions; import com.bluedelivery.shop.businesshour.BusinessHourPolicy; import com.bluedelivery.shop.businesshour.UpdateBusinessHoursDto; diff --git a/src/main/java/com/bluedelivery/shop/shop/TemporaryClosingParam.java b/src/main/java/com/bluedelivery/application/shop/TemporaryClosingParam.java similarity index 94% rename from src/main/java/com/bluedelivery/shop/shop/TemporaryClosingParam.java rename to src/main/java/com/bluedelivery/application/shop/TemporaryClosingParam.java index c4cc4901..64994f97 100644 --- a/src/main/java/com/bluedelivery/shop/shop/TemporaryClosingParam.java +++ b/src/main/java/com/bluedelivery/application/shop/TemporaryClosingParam.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.shop; +package com.bluedelivery.application.shop; import java.time.LocalDate; diff --git a/src/main/java/com/bluedelivery/shop/search/ShopExposeServiceImpl.java b/src/main/java/com/bluedelivery/application/shop/adapter/ShopExposeServiceImpl.java similarity index 85% rename from src/main/java/com/bluedelivery/shop/search/ShopExposeServiceImpl.java rename to src/main/java/com/bluedelivery/application/shop/adapter/ShopExposeServiceImpl.java index c6866492..18d00b5c 100644 --- a/src/main/java/com/bluedelivery/shop/search/ShopExposeServiceImpl.java +++ b/src/main/java/com/bluedelivery/application/shop/adapter/ShopExposeServiceImpl.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.search; +package com.bluedelivery.application.shop.adapter; import static java.lang.Boolean.compare; import static java.util.stream.Collectors.toList; @@ -8,8 +8,10 @@ import org.springframework.stereotype.Service; +import com.bluedelivery.application.shop.SearchShopByCategoryParam; +import com.bluedelivery.application.shop.ShopExposeService; import com.bluedelivery.domain.category.CategoryRepository; -import com.bluedelivery.shop.shop.Shop; +import com.bluedelivery.domain.shop.Shop; @Service public class ShopExposeServiceImpl implements ShopExposeService { diff --git a/src/main/java/com/bluedelivery/domain/category/CategoryRepository.java b/src/main/java/com/bluedelivery/domain/category/CategoryRepository.java index 0554d522..83123519 100644 --- a/src/main/java/com/bluedelivery/domain/category/CategoryRepository.java +++ b/src/main/java/com/bluedelivery/domain/category/CategoryRepository.java @@ -6,8 +6,8 @@ import org.springframework.stereotype.Repository; import com.bluedelivery.application.category.EditCategoryParam; -import com.bluedelivery.shop.search.SearchShopByCategoryParam; -import com.bluedelivery.shop.shop.Shop; +import com.bluedelivery.application.shop.SearchShopByCategoryParam; +import com.bluedelivery.domain.shop.Shop; @Repository public interface CategoryRepository { diff --git a/src/main/java/com/bluedelivery/shop/shop/Shop.java b/src/main/java/com/bluedelivery/domain/shop/Shop.java similarity index 98% rename from src/main/java/com/bluedelivery/shop/shop/Shop.java rename to src/main/java/com/bluedelivery/domain/shop/Shop.java index 4f49e042..548aa3ec 100644 --- a/src/main/java/com/bluedelivery/shop/shop/Shop.java +++ b/src/main/java/com/bluedelivery/domain/shop/Shop.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.shop; +package com.bluedelivery.domain.shop; import java.time.LocalDate; import java.time.LocalDateTime; diff --git a/src/main/java/com/bluedelivery/shop/shop/ShopRepository.java b/src/main/java/com/bluedelivery/domain/shop/ShopRepository.java similarity index 88% rename from src/main/java/com/bluedelivery/shop/shop/ShopRepository.java rename to src/main/java/com/bluedelivery/domain/shop/ShopRepository.java index fabfbb70..39696f98 100644 --- a/src/main/java/com/bluedelivery/shop/shop/ShopRepository.java +++ b/src/main/java/com/bluedelivery/domain/shop/ShopRepository.java @@ -1,7 +1,9 @@ -package com.bluedelivery.shop.shop; +package com.bluedelivery.domain.shop; import org.springframework.stereotype.Repository; +import com.bluedelivery.domain.shop.Shop; + @Repository public interface ShopRepository { Shop findShopById(Long id); diff --git a/src/main/java/com/bluedelivery/shop/shop/ShopMapper.java b/src/main/java/com/bluedelivery/infra/shop/ShopMapper.java similarity index 55% rename from src/main/java/com/bluedelivery/shop/shop/ShopMapper.java rename to src/main/java/com/bluedelivery/infra/shop/ShopMapper.java index ab6ea5c0..dfe5b820 100644 --- a/src/main/java/com/bluedelivery/shop/shop/ShopMapper.java +++ b/src/main/java/com/bluedelivery/infra/shop/ShopMapper.java @@ -1,7 +1,9 @@ -package com.bluedelivery.shop.shop; +package com.bluedelivery.infra.shop; import org.apache.ibatis.annotations.Mapper; +import com.bluedelivery.domain.shop.ShopRepository; + @Mapper public interface ShopMapper extends ShopRepository { } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index bb4f9997..4efff9e5 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -19,7 +19,7 @@ spring: mybatis: mapper-locations: mybatis/mapper/*.xml type-aliases-package: - com.bluedelivery.shop.shop, + com.bluedelivery.domain.shop, com.bluedelivery.domain.category, com.bluedelivery.shop.businesshour, com.bluedelivery.shop.closingday, diff --git a/src/main/resources/mybatis/mapper/CategoryMapper.xml b/src/main/resources/mybatis/mapper/CategoryMapper.xml index d6c210b3..2eecebcd 100644 --- a/src/main/resources/mybatis/mapper/CategoryMapper.xml +++ b/src/main/resources/mybatis/mapper/CategoryMapper.xml @@ -10,7 +10,7 @@ - SELECT S.ID SHOP_ID, NAME, INTRODUCE, diff --git a/src/main/resources/mybatis/mapper/ShopMapper.xml b/src/main/resources/mybatis/mapper/ShopMapper.xml index 11737881..d7d8902e 100644 --- a/src/main/resources/mybatis/mapper/ShopMapper.xml +++ b/src/main/resources/mybatis/mapper/ShopMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + diff --git a/src/test/java/com/bluedelivery/shop/shop/ShopUpdateControllerTest.java b/src/test/java/com/bluedelivery/api/shop/ShopUpdateControllerTest.java similarity index 89% rename from src/test/java/com/bluedelivery/shop/shop/ShopUpdateControllerTest.java rename to src/test/java/com/bluedelivery/api/shop/ShopUpdateControllerTest.java index 2ca4bb94..aa1c6a02 100644 --- a/src/test/java/com/bluedelivery/shop/shop/ShopUpdateControllerTest.java +++ b/src/test/java/com/bluedelivery/api/shop/ShopUpdateControllerTest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.shop; +package com.bluedelivery.api.shop; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @@ -17,6 +17,9 @@ import org.springframework.test.context.ActiveProfiles; import org.springframework.test.web.servlet.MockMvc; +import com.bluedelivery.api.shop.UpdateClosingDaysRequest; +import com.bluedelivery.application.shop.RegularClosingParam; +import com.bluedelivery.application.shop.TemporaryClosingParam; import com.bluedelivery.shop.closingday.CyclicRegularClosing; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/bluedelivery/shop/shop/ShopUpdateServiceTest.java b/src/test/java/com/bluedelivery/application/shop/ShopUpdateServiceTest.java similarity index 92% rename from src/test/java/com/bluedelivery/shop/shop/ShopUpdateServiceTest.java rename to src/test/java/com/bluedelivery/application/shop/ShopUpdateServiceTest.java index ab633a48..953defc6 100644 --- a/src/test/java/com/bluedelivery/shop/shop/ShopUpdateServiceTest.java +++ b/src/test/java/com/bluedelivery/application/shop/ShopUpdateServiceTest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.shop; +package com.bluedelivery.application.shop; import static org.assertj.core.api.Assertions.*; import static org.mockito.Mockito.when; @@ -16,7 +16,10 @@ import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; +import com.bluedelivery.api.shop.UpdateClosingDaysRequest; import com.bluedelivery.application.category.CategoryManagerService; +import com.bluedelivery.domain.shop.Shop; +import com.bluedelivery.domain.shop.ShopRepository; import com.bluedelivery.shop.closingday.CyclicRegularClosing; import com.bluedelivery.shop.closingday.LegalHolidayClosing; diff --git a/src/test/java/com/bluedelivery/shop/shop/ShopTest.java b/src/test/java/com/bluedelivery/domain/shop/ShopTest.java similarity index 91% rename from src/test/java/com/bluedelivery/shop/shop/ShopTest.java rename to src/test/java/com/bluedelivery/domain/shop/ShopTest.java index 1454dbf8..f04f7e2b 100644 --- a/src/test/java/com/bluedelivery/shop/shop/ShopTest.java +++ b/src/test/java/com/bluedelivery/domain/shop/ShopTest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.shop; +package com.bluedelivery.domain.shop; import static org.assertj.core.api.Assertions.assertThat; @@ -9,6 +9,7 @@ import com.bluedelivery.domain.category.Categories; import com.bluedelivery.domain.category.Category; +import com.bluedelivery.domain.shop.Shop; class ShopTest { From c50f27a2876d0d331756af8deb5bd236dd3e78de Mon Sep 17 00:00:00 2001 From: soongjamm Date: Tue, 27 Jul 2021 17:48:54 +0900 Subject: [PATCH 11/18] businesshour package --- .../com/bluedelivery/api/shop/ShopUpdateController.java | 1 - .../businesshour => api/shop}/UpdateBusinessHoursDto.java | 4 +++- .../api/shop/adapter/ShopUpdateControllerImpl.java | 2 +- .../bluedelivery/application/shop/ShopUpdateService.java | 6 +++--- .../{shop => domain}/businesshour/BusinessHour.java | 2 +- .../businesshour/BusinessHourCondition.java | 4 ++-- .../businesshour/BusinessHourConditions.java | 6 ++++-- .../{shop => domain}/businesshour/BusinessHourPolicy.java | 2 +- .../businesshour/BusinessHourRequestParam.java | 2 +- .../businesshour/BusinessHourRequestParams.java | 4 ++-- .../businesshour/EverydayBusinessHourCondition.java | 4 ++-- .../businesshour/WeekdayWeekendBusinessHourCondition.java | 4 ++-- src/main/java/com/bluedelivery/domain/shop/Shop.java | 2 +- .../{shop/businesshour => infra}/BusinessHourMapper.java | 4 +++- src/main/resources/application.yml | 2 +- .../businesshour/BusinessHourPolicyConditionsTest.java | 6 ++++-- 16 files changed, 31 insertions(+), 24 deletions(-) rename src/main/java/com/bluedelivery/{shop/businesshour => api/shop}/UpdateBusinessHoursDto.java (89%) rename src/main/java/com/bluedelivery/{shop => domain}/businesshour/BusinessHour.java (98%) rename src/main/java/com/bluedelivery/{shop => domain}/businesshour/BusinessHourCondition.java (64%) rename src/main/java/com/bluedelivery/{shop => domain}/businesshour/BusinessHourConditions.java (83%) rename src/main/java/com/bluedelivery/{shop => domain}/businesshour/BusinessHourPolicy.java (95%) rename src/main/java/com/bluedelivery/{shop => domain}/businesshour/BusinessHourRequestParam.java (94%) rename src/main/java/com/bluedelivery/{shop => domain}/businesshour/BusinessHourRequestParams.java (90%) rename src/main/java/com/bluedelivery/{shop => domain}/businesshour/EverydayBusinessHourCondition.java (86%) rename src/main/java/com/bluedelivery/{shop => domain}/businesshour/WeekdayWeekendBusinessHourCondition.java (90%) rename src/main/java/com/bluedelivery/{shop/businesshour => infra}/BusinessHourMapper.java (67%) rename src/test/java/com/bluedelivery/{shop => domain}/businesshour/BusinessHourPolicyConditionsTest.java (96%) diff --git a/src/main/java/com/bluedelivery/api/shop/ShopUpdateController.java b/src/main/java/com/bluedelivery/api/shop/ShopUpdateController.java index 2d54556d..457e6626 100644 --- a/src/main/java/com/bluedelivery/api/shop/ShopUpdateController.java +++ b/src/main/java/com/bluedelivery/api/shop/ShopUpdateController.java @@ -11,7 +11,6 @@ import org.springframework.web.bind.annotation.RequestMapping; import com.bluedelivery.common.response.HttpResponse; -import com.bluedelivery.shop.businesshour.UpdateBusinessHoursDto; import com.bluedelivery.shop.suspension.SuspensionRequest; @RequestMapping("/shops/{id}") diff --git a/src/main/java/com/bluedelivery/shop/businesshour/UpdateBusinessHoursDto.java b/src/main/java/com/bluedelivery/api/shop/UpdateBusinessHoursDto.java similarity index 89% rename from src/main/java/com/bluedelivery/shop/businesshour/UpdateBusinessHoursDto.java rename to src/main/java/com/bluedelivery/api/shop/UpdateBusinessHoursDto.java index 1e710535..05b4336d 100644 --- a/src/main/java/com/bluedelivery/shop/businesshour/UpdateBusinessHoursDto.java +++ b/src/main/java/com/bluedelivery/api/shop/UpdateBusinessHoursDto.java @@ -1,7 +1,9 @@ -package com.bluedelivery.shop.businesshour; +package com.bluedelivery.api.shop; import javax.validation.constraints.NotNull; +import com.bluedelivery.domain.businesshour.BusinessHourRequestParams; + public class UpdateBusinessHoursDto { public enum DayType { diff --git a/src/main/java/com/bluedelivery/api/shop/adapter/ShopUpdateControllerImpl.java b/src/main/java/com/bluedelivery/api/shop/adapter/ShopUpdateControllerImpl.java index 3d3c2f8b..dd0d8842 100644 --- a/src/main/java/com/bluedelivery/api/shop/adapter/ShopUpdateControllerImpl.java +++ b/src/main/java/com/bluedelivery/api/shop/adapter/ShopUpdateControllerImpl.java @@ -5,6 +5,7 @@ import com.bluedelivery.api.shop.EditPhoneRequest; import com.bluedelivery.api.shop.ShopUpdateController; +import com.bluedelivery.api.shop.UpdateBusinessHoursDto; import com.bluedelivery.api.shop.UpdateCategoryRequest; import com.bluedelivery.api.shop.UpdateClosingDaysRequest; import com.bluedelivery.application.category.CategoryNotFoundException; @@ -12,7 +13,6 @@ import com.bluedelivery.common.response.ApiException; import com.bluedelivery.common.response.ErrorCode; import com.bluedelivery.common.response.HttpResponse; -import com.bluedelivery.shop.businesshour.UpdateBusinessHoursDto; import com.bluedelivery.shop.suspension.SuspensionRequest; @RestController diff --git a/src/main/java/com/bluedelivery/application/shop/ShopUpdateService.java b/src/main/java/com/bluedelivery/application/shop/ShopUpdateService.java index 9512f51f..65bffb5b 100644 --- a/src/main/java/com/bluedelivery/application/shop/ShopUpdateService.java +++ b/src/main/java/com/bluedelivery/application/shop/ShopUpdateService.java @@ -7,15 +7,15 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import com.bluedelivery.api.shop.UpdateBusinessHoursDto; import com.bluedelivery.api.shop.UpdateCategoryRequest; import com.bluedelivery.api.shop.UpdateClosingDaysRequest; import com.bluedelivery.application.category.CategoryManagerService; import com.bluedelivery.common.response.ApiException; +import com.bluedelivery.domain.businesshour.BusinessHourConditions; +import com.bluedelivery.domain.businesshour.BusinessHourPolicy; import com.bluedelivery.domain.shop.Shop; import com.bluedelivery.domain.shop.ShopRepository; -import com.bluedelivery.shop.businesshour.BusinessHourConditions; -import com.bluedelivery.shop.businesshour.BusinessHourPolicy; -import com.bluedelivery.shop.businesshour.UpdateBusinessHoursDto; import com.bluedelivery.shop.closingday.LegalHolidayClosing; import com.bluedelivery.shop.suspension.Suspension; diff --git a/src/main/java/com/bluedelivery/shop/businesshour/BusinessHour.java b/src/main/java/com/bluedelivery/domain/businesshour/BusinessHour.java similarity index 98% rename from src/main/java/com/bluedelivery/shop/businesshour/BusinessHour.java rename to src/main/java/com/bluedelivery/domain/businesshour/BusinessHour.java index 0a69413f..46a384d2 100644 --- a/src/main/java/com/bluedelivery/shop/businesshour/BusinessHour.java +++ b/src/main/java/com/bluedelivery/domain/businesshour/BusinessHour.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.businesshour; +package com.bluedelivery.domain.businesshour; import java.time.DayOfWeek; diff --git a/src/main/java/com/bluedelivery/shop/businesshour/BusinessHourCondition.java b/src/main/java/com/bluedelivery/domain/businesshour/BusinessHourCondition.java similarity index 64% rename from src/main/java/com/bluedelivery/shop/businesshour/BusinessHourCondition.java rename to src/main/java/com/bluedelivery/domain/businesshour/BusinessHourCondition.java index 94b3dcd3..712060b9 100644 --- a/src/main/java/com/bluedelivery/shop/businesshour/BusinessHourCondition.java +++ b/src/main/java/com/bluedelivery/domain/businesshour/BusinessHourCondition.java @@ -1,6 +1,6 @@ -package com.bluedelivery.shop.businesshour; +package com.bluedelivery.domain.businesshour; -import com.bluedelivery.shop.businesshour.UpdateBusinessHoursDto.BusinessHourType; +import com.bluedelivery.api.shop.UpdateBusinessHoursDto.BusinessHourType; public interface BusinessHourCondition { diff --git a/src/main/java/com/bluedelivery/shop/businesshour/BusinessHourConditions.java b/src/main/java/com/bluedelivery/domain/businesshour/BusinessHourConditions.java similarity index 83% rename from src/main/java/com/bluedelivery/shop/businesshour/BusinessHourConditions.java rename to src/main/java/com/bluedelivery/domain/businesshour/BusinessHourConditions.java index b11c6b05..fdef453e 100644 --- a/src/main/java/com/bluedelivery/shop/businesshour/BusinessHourConditions.java +++ b/src/main/java/com/bluedelivery/domain/businesshour/BusinessHourConditions.java @@ -1,10 +1,12 @@ -package com.bluedelivery.shop.businesshour; +package com.bluedelivery.domain.businesshour; -import static com.bluedelivery.shop.businesshour.UpdateBusinessHoursDto.*; +import static com.bluedelivery.api.shop.UpdateBusinessHoursDto.*; import java.util.ArrayList; import java.util.List; +import com.bluedelivery.api.shop.UpdateBusinessHoursDto; + public class BusinessHourConditions { private static final List conditions; diff --git a/src/main/java/com/bluedelivery/shop/businesshour/BusinessHourPolicy.java b/src/main/java/com/bluedelivery/domain/businesshour/BusinessHourPolicy.java similarity index 95% rename from src/main/java/com/bluedelivery/shop/businesshour/BusinessHourPolicy.java rename to src/main/java/com/bluedelivery/domain/businesshour/BusinessHourPolicy.java index d0734e8a..b948dea5 100644 --- a/src/main/java/com/bluedelivery/shop/businesshour/BusinessHourPolicy.java +++ b/src/main/java/com/bluedelivery/domain/businesshour/BusinessHourPolicy.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.businesshour; +package com.bluedelivery.domain.businesshour; import java.time.DayOfWeek; import java.time.LocalDateTime; diff --git a/src/main/java/com/bluedelivery/shop/businesshour/BusinessHourRequestParam.java b/src/main/java/com/bluedelivery/domain/businesshour/BusinessHourRequestParam.java similarity index 94% rename from src/main/java/com/bluedelivery/shop/businesshour/BusinessHourRequestParam.java rename to src/main/java/com/bluedelivery/domain/businesshour/BusinessHourRequestParam.java index 0daa80f9..a72d25f3 100644 --- a/src/main/java/com/bluedelivery/shop/businesshour/BusinessHourRequestParam.java +++ b/src/main/java/com/bluedelivery/domain/businesshour/BusinessHourRequestParam.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.businesshour; +package com.bluedelivery.domain.businesshour; import java.time.DayOfWeek; import java.time.LocalTime; diff --git a/src/main/java/com/bluedelivery/shop/businesshour/BusinessHourRequestParams.java b/src/main/java/com/bluedelivery/domain/businesshour/BusinessHourRequestParams.java similarity index 90% rename from src/main/java/com/bluedelivery/shop/businesshour/BusinessHourRequestParams.java rename to src/main/java/com/bluedelivery/domain/businesshour/BusinessHourRequestParams.java index c0ec8b44..e32cf89a 100644 --- a/src/main/java/com/bluedelivery/shop/businesshour/BusinessHourRequestParams.java +++ b/src/main/java/com/bluedelivery/domain/businesshour/BusinessHourRequestParams.java @@ -1,6 +1,6 @@ -package com.bluedelivery.shop.businesshour; +package com.bluedelivery.domain.businesshour; -import static com.bluedelivery.shop.businesshour.UpdateBusinessHoursDto.*; +import static com.bluedelivery.api.shop.UpdateBusinessHoursDto.*; import java.util.Collections; import java.util.Map; diff --git a/src/main/java/com/bluedelivery/shop/businesshour/EverydayBusinessHourCondition.java b/src/main/java/com/bluedelivery/domain/businesshour/EverydayBusinessHourCondition.java similarity index 86% rename from src/main/java/com/bluedelivery/shop/businesshour/EverydayBusinessHourCondition.java rename to src/main/java/com/bluedelivery/domain/businesshour/EverydayBusinessHourCondition.java index 9ca5803b..3f7ac7ef 100644 --- a/src/main/java/com/bluedelivery/shop/businesshour/EverydayBusinessHourCondition.java +++ b/src/main/java/com/bluedelivery/domain/businesshour/EverydayBusinessHourCondition.java @@ -1,6 +1,6 @@ -package com.bluedelivery.shop.businesshour; +package com.bluedelivery.domain.businesshour; -import static com.bluedelivery.shop.businesshour.UpdateBusinessHoursDto.*; +import static com.bluedelivery.api.shop.UpdateBusinessHoursDto.*; import java.time.DayOfWeek; diff --git a/src/main/java/com/bluedelivery/shop/businesshour/WeekdayWeekendBusinessHourCondition.java b/src/main/java/com/bluedelivery/domain/businesshour/WeekdayWeekendBusinessHourCondition.java similarity index 90% rename from src/main/java/com/bluedelivery/shop/businesshour/WeekdayWeekendBusinessHourCondition.java rename to src/main/java/com/bluedelivery/domain/businesshour/WeekdayWeekendBusinessHourCondition.java index c2d34111..c1c529f2 100644 --- a/src/main/java/com/bluedelivery/shop/businesshour/WeekdayWeekendBusinessHourCondition.java +++ b/src/main/java/com/bluedelivery/domain/businesshour/WeekdayWeekendBusinessHourCondition.java @@ -1,6 +1,6 @@ -package com.bluedelivery.shop.businesshour; +package com.bluedelivery.domain.businesshour; -import static com.bluedelivery.shop.businesshour.UpdateBusinessHoursDto.*; +import static com.bluedelivery.api.shop.UpdateBusinessHoursDto.*; import static java.time.DayOfWeek.*; import java.time.DayOfWeek; diff --git a/src/main/java/com/bluedelivery/domain/shop/Shop.java b/src/main/java/com/bluedelivery/domain/shop/Shop.java index 548aa3ec..712e728a 100644 --- a/src/main/java/com/bluedelivery/domain/shop/Shop.java +++ b/src/main/java/com/bluedelivery/domain/shop/Shop.java @@ -4,9 +4,9 @@ import java.time.LocalDateTime; import java.util.List; +import com.bluedelivery.domain.businesshour.BusinessHourPolicy; import com.bluedelivery.domain.category.Categories; import com.bluedelivery.domain.category.Category; -import com.bluedelivery.shop.businesshour.BusinessHourPolicy; import com.bluedelivery.shop.closingday.ClosingDayPolicies; import com.bluedelivery.shop.closingday.ClosingDayPolicy; import com.bluedelivery.shop.suspension.Suspension; diff --git a/src/main/java/com/bluedelivery/shop/businesshour/BusinessHourMapper.java b/src/main/java/com/bluedelivery/infra/BusinessHourMapper.java similarity index 67% rename from src/main/java/com/bluedelivery/shop/businesshour/BusinessHourMapper.java rename to src/main/java/com/bluedelivery/infra/BusinessHourMapper.java index d45bc088..9680b996 100644 --- a/src/main/java/com/bluedelivery/shop/businesshour/BusinessHourMapper.java +++ b/src/main/java/com/bluedelivery/infra/BusinessHourMapper.java @@ -1,7 +1,9 @@ -package com.bluedelivery.shop.businesshour; +package com.bluedelivery.infra; import org.apache.ibatis.annotations.Mapper; +import com.bluedelivery.domain.businesshour.BusinessHour; + @Mapper public interface BusinessHourMapper { diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 4efff9e5..4f571d64 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -21,7 +21,7 @@ mybatis: type-aliases-package: com.bluedelivery.domain.shop, com.bluedelivery.domain.category, - com.bluedelivery.shop.businesshour, + com.bluedelivery.domain.businesshour, com.bluedelivery.shop.closingday, com.bluedelivery.shop.suspension, com.bluedelivery.user.domain, diff --git a/src/test/java/com/bluedelivery/shop/businesshour/BusinessHourPolicyConditionsTest.java b/src/test/java/com/bluedelivery/domain/businesshour/BusinessHourPolicyConditionsTest.java similarity index 96% rename from src/test/java/com/bluedelivery/shop/businesshour/BusinessHourPolicyConditionsTest.java rename to src/test/java/com/bluedelivery/domain/businesshour/BusinessHourPolicyConditionsTest.java index 4a0581e9..0d4717c8 100644 --- a/src/test/java/com/bluedelivery/shop/businesshour/BusinessHourPolicyConditionsTest.java +++ b/src/test/java/com/bluedelivery/domain/businesshour/BusinessHourPolicyConditionsTest.java @@ -1,6 +1,6 @@ -package com.bluedelivery.shop.businesshour; +package com.bluedelivery.domain.businesshour; -import static com.bluedelivery.shop.businesshour.UpdateBusinessHoursDto.*; +import static com.bluedelivery.api.shop.UpdateBusinessHoursDto.*; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.*; @@ -13,6 +13,8 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; +import com.bluedelivery.api.shop.UpdateBusinessHoursDto; + class BusinessHourPolicyConditionsTest { BusinessHourConditions policies = new BusinessHourConditions(); From de77eb08ac6b4a9fc6af74b56cd6c30fc60da688 Mon Sep 17 00:00:00 2001 From: soongjamm Date: Tue, 27 Jul 2021 17:52:42 +0900 Subject: [PATCH 12/18] closingday package --- .../com/bluedelivery/api/shop/ShopUpdateController.java | 1 - .../{shop/suspension => api/shop}/SuspensionRequest.java | 4 +++- .../api/shop/adapter/ShopUpdateControllerImpl.java | 2 +- .../application/shop/RegularClosingParam.java | 6 +++--- .../bluedelivery/application/shop/ShopUpdateService.java | 4 ++-- .../application/shop/TemporaryClosingParam.java | 2 +- .../{shop => domain}/closingday/ClosingDayPolicies.java | 2 +- .../{shop => domain}/closingday/ClosingDayPolicy.java | 2 +- .../{shop => domain}/closingday/CyclicRegularClosing.java | 2 +- .../{shop => domain}/closingday/LegalHoliday.java | 6 +++--- .../{shop => domain}/closingday/LegalHolidayClosing.java | 2 +- .../{shop => domain}/closingday/RegularClosingDay.java | 2 +- .../suspension => domain/closingday}/Suspension.java | 2 +- .../{shop => domain}/closingday/TemporaryClosing.java | 2 +- .../{shop => domain}/closingday/WeeklyRegularClosing.java | 2 +- .../{shop => domain}/closingday/YearlyLegalHolidays.java | 2 +- src/main/java/com/bluedelivery/domain/shop/Shop.java | 6 +++--- src/main/resources/application.yml | 4 ++-- src/main/resources/mybatis/mapper/ClosingMapper.xml | 4 ++-- src/main/resources/mybatis/mapper/ShopMapper.xml | 8 ++++---- .../bluedelivery/api/shop/ShopUpdateControllerTest.java | 3 +-- .../application/shop/ShopUpdateServiceTest.java | 4 ++-- .../closingday/LegalHolidayClosingTest.java | 2 +- .../{shop => domain}/closingday/LegalHolidayTest.java | 2 +- .../closingday/RegularClosingDayPolicyTest.java | 2 +- .../{shop => domain}/closingday/TemporaryClosingTest.java | 2 +- 26 files changed, 40 insertions(+), 40 deletions(-) rename src/main/java/com/bluedelivery/{shop/suspension => api/shop}/SuspensionRequest.java (91%) rename src/main/java/com/bluedelivery/{shop => domain}/closingday/ClosingDayPolicies.java (94%) rename src/main/java/com/bluedelivery/{shop => domain}/closingday/ClosingDayPolicy.java (90%) rename src/main/java/com/bluedelivery/{shop => domain}/closingday/CyclicRegularClosing.java (98%) rename src/main/java/com/bluedelivery/{shop => domain}/closingday/LegalHoliday.java (96%) rename src/main/java/com/bluedelivery/{shop => domain}/closingday/LegalHolidayClosing.java (96%) rename src/main/java/com/bluedelivery/{shop => domain}/closingday/RegularClosingDay.java (86%) rename src/main/java/com/bluedelivery/{shop/suspension => domain/closingday}/Suspension.java (95%) rename src/main/java/com/bluedelivery/{shop => domain}/closingday/TemporaryClosing.java (97%) rename src/main/java/com/bluedelivery/{shop => domain}/closingday/WeeklyRegularClosing.java (95%) rename src/main/java/com/bluedelivery/{shop => domain}/closingday/YearlyLegalHolidays.java (95%) rename src/test/java/com/bluedelivery/{shop => domain}/closingday/LegalHolidayClosingTest.java (97%) rename src/test/java/com/bluedelivery/{shop => domain}/closingday/LegalHolidayTest.java (97%) rename src/test/java/com/bluedelivery/{shop => domain}/closingday/RegularClosingDayPolicyTest.java (98%) rename src/test/java/com/bluedelivery/{shop => domain}/closingday/TemporaryClosingTest.java (96%) diff --git a/src/main/java/com/bluedelivery/api/shop/ShopUpdateController.java b/src/main/java/com/bluedelivery/api/shop/ShopUpdateController.java index 457e6626..e9e6724b 100644 --- a/src/main/java/com/bluedelivery/api/shop/ShopUpdateController.java +++ b/src/main/java/com/bluedelivery/api/shop/ShopUpdateController.java @@ -11,7 +11,6 @@ import org.springframework.web.bind.annotation.RequestMapping; import com.bluedelivery.common.response.HttpResponse; -import com.bluedelivery.shop.suspension.SuspensionRequest; @RequestMapping("/shops/{id}") public interface ShopUpdateController { diff --git a/src/main/java/com/bluedelivery/shop/suspension/SuspensionRequest.java b/src/main/java/com/bluedelivery/api/shop/SuspensionRequest.java similarity index 91% rename from src/main/java/com/bluedelivery/shop/suspension/SuspensionRequest.java rename to src/main/java/com/bluedelivery/api/shop/SuspensionRequest.java index cb767525..fb8ae643 100644 --- a/src/main/java/com/bluedelivery/shop/suspension/SuspensionRequest.java +++ b/src/main/java/com/bluedelivery/api/shop/SuspensionRequest.java @@ -1,7 +1,9 @@ -package com.bluedelivery.shop.suspension; +package com.bluedelivery.api.shop; import java.time.LocalDateTime; +import com.bluedelivery.domain.closingday.Suspension; + public class SuspensionRequest { private enum Period { NONE(0, 0), diff --git a/src/main/java/com/bluedelivery/api/shop/adapter/ShopUpdateControllerImpl.java b/src/main/java/com/bluedelivery/api/shop/adapter/ShopUpdateControllerImpl.java index dd0d8842..f3f25d63 100644 --- a/src/main/java/com/bluedelivery/api/shop/adapter/ShopUpdateControllerImpl.java +++ b/src/main/java/com/bluedelivery/api/shop/adapter/ShopUpdateControllerImpl.java @@ -5,6 +5,7 @@ import com.bluedelivery.api.shop.EditPhoneRequest; import com.bluedelivery.api.shop.ShopUpdateController; +import com.bluedelivery.api.shop.SuspensionRequest; import com.bluedelivery.api.shop.UpdateBusinessHoursDto; import com.bluedelivery.api.shop.UpdateCategoryRequest; import com.bluedelivery.api.shop.UpdateClosingDaysRequest; @@ -13,7 +14,6 @@ import com.bluedelivery.common.response.ApiException; import com.bluedelivery.common.response.ErrorCode; import com.bluedelivery.common.response.HttpResponse; -import com.bluedelivery.shop.suspension.SuspensionRequest; @RestController public class ShopUpdateControllerImpl implements ShopUpdateController { diff --git a/src/main/java/com/bluedelivery/application/shop/RegularClosingParam.java b/src/main/java/com/bluedelivery/application/shop/RegularClosingParam.java index 1fba5912..79b7c1ed 100644 --- a/src/main/java/com/bluedelivery/application/shop/RegularClosingParam.java +++ b/src/main/java/com/bluedelivery/application/shop/RegularClosingParam.java @@ -2,9 +2,9 @@ import java.time.DayOfWeek; -import com.bluedelivery.shop.closingday.CyclicRegularClosing; -import com.bluedelivery.shop.closingday.RegularClosingDay; -import com.bluedelivery.shop.closingday.WeeklyRegularClosing; +import com.bluedelivery.domain.closingday.CyclicRegularClosing; +import com.bluedelivery.domain.closingday.RegularClosingDay; +import com.bluedelivery.domain.closingday.WeeklyRegularClosing; import lombok.NoArgsConstructor; diff --git a/src/main/java/com/bluedelivery/application/shop/ShopUpdateService.java b/src/main/java/com/bluedelivery/application/shop/ShopUpdateService.java index 65bffb5b..1ffab2b4 100644 --- a/src/main/java/com/bluedelivery/application/shop/ShopUpdateService.java +++ b/src/main/java/com/bluedelivery/application/shop/ShopUpdateService.java @@ -14,10 +14,10 @@ import com.bluedelivery.common.response.ApiException; import com.bluedelivery.domain.businesshour.BusinessHourConditions; import com.bluedelivery.domain.businesshour.BusinessHourPolicy; +import com.bluedelivery.domain.closingday.LegalHolidayClosing; +import com.bluedelivery.domain.closingday.Suspension; import com.bluedelivery.domain.shop.Shop; import com.bluedelivery.domain.shop.ShopRepository; -import com.bluedelivery.shop.closingday.LegalHolidayClosing; -import com.bluedelivery.shop.suspension.Suspension; @Service @Transactional diff --git a/src/main/java/com/bluedelivery/application/shop/TemporaryClosingParam.java b/src/main/java/com/bluedelivery/application/shop/TemporaryClosingParam.java index 64994f97..95d911c2 100644 --- a/src/main/java/com/bluedelivery/application/shop/TemporaryClosingParam.java +++ b/src/main/java/com/bluedelivery/application/shop/TemporaryClosingParam.java @@ -2,7 +2,7 @@ import java.time.LocalDate; -import com.bluedelivery.shop.closingday.TemporaryClosing; +import com.bluedelivery.domain.closingday.TemporaryClosing; import lombok.NoArgsConstructor; diff --git a/src/main/java/com/bluedelivery/shop/closingday/ClosingDayPolicies.java b/src/main/java/com/bluedelivery/domain/closingday/ClosingDayPolicies.java similarity index 94% rename from src/main/java/com/bluedelivery/shop/closingday/ClosingDayPolicies.java rename to src/main/java/com/bluedelivery/domain/closingday/ClosingDayPolicies.java index 6a9c00ca..f26ada89 100644 --- a/src/main/java/com/bluedelivery/shop/closingday/ClosingDayPolicies.java +++ b/src/main/java/com/bluedelivery/domain/closingday/ClosingDayPolicies.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.closingday; +package com.bluedelivery.domain.closingday; import java.time.LocalDate; import java.util.ArrayList; diff --git a/src/main/java/com/bluedelivery/shop/closingday/ClosingDayPolicy.java b/src/main/java/com/bluedelivery/domain/closingday/ClosingDayPolicy.java similarity index 90% rename from src/main/java/com/bluedelivery/shop/closingday/ClosingDayPolicy.java rename to src/main/java/com/bluedelivery/domain/closingday/ClosingDayPolicy.java index ed789d7e..0f4c7b21 100644 --- a/src/main/java/com/bluedelivery/shop/closingday/ClosingDayPolicy.java +++ b/src/main/java/com/bluedelivery/domain/closingday/ClosingDayPolicy.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.closingday; +package com.bluedelivery.domain.closingday; import java.time.LocalDate; diff --git a/src/main/java/com/bluedelivery/shop/closingday/CyclicRegularClosing.java b/src/main/java/com/bluedelivery/domain/closingday/CyclicRegularClosing.java similarity index 98% rename from src/main/java/com/bluedelivery/shop/closingday/CyclicRegularClosing.java rename to src/main/java/com/bluedelivery/domain/closingday/CyclicRegularClosing.java index 872aa87b..8bca63ca 100644 --- a/src/main/java/com/bluedelivery/shop/closingday/CyclicRegularClosing.java +++ b/src/main/java/com/bluedelivery/domain/closingday/CyclicRegularClosing.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.closingday; +package com.bluedelivery.domain.closingday; import java.time.DayOfWeek; import java.time.LocalDate; diff --git a/src/main/java/com/bluedelivery/shop/closingday/LegalHoliday.java b/src/main/java/com/bluedelivery/domain/closingday/LegalHoliday.java similarity index 96% rename from src/main/java/com/bluedelivery/shop/closingday/LegalHoliday.java rename to src/main/java/com/bluedelivery/domain/closingday/LegalHoliday.java index 51b34d4a..31e7e0dd 100644 --- a/src/main/java/com/bluedelivery/shop/closingday/LegalHoliday.java +++ b/src/main/java/com/bluedelivery/domain/closingday/LegalHoliday.java @@ -1,7 +1,7 @@ -package com.bluedelivery.shop.closingday; +package com.bluedelivery.domain.closingday; -import static com.bluedelivery.shop.closingday.LegalHoliday.CalendarType.LUNAR; -import static com.bluedelivery.shop.closingday.LegalHoliday.CalendarType.SOLAR; +import static com.bluedelivery.domain.closingday.LegalHoliday.CalendarType.LUNAR; +import static com.bluedelivery.domain.closingday.LegalHoliday.CalendarType.SOLAR; import java.time.DayOfWeek; import java.time.LocalDate; diff --git a/src/main/java/com/bluedelivery/shop/closingday/LegalHolidayClosing.java b/src/main/java/com/bluedelivery/domain/closingday/LegalHolidayClosing.java similarity index 96% rename from src/main/java/com/bluedelivery/shop/closingday/LegalHolidayClosing.java rename to src/main/java/com/bluedelivery/domain/closingday/LegalHolidayClosing.java index 389cd0df..11f1d27d 100644 --- a/src/main/java/com/bluedelivery/shop/closingday/LegalHolidayClosing.java +++ b/src/main/java/com/bluedelivery/domain/closingday/LegalHolidayClosing.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.closingday; +package com.bluedelivery.domain.closingday; import java.time.LocalDate; import java.time.Year; diff --git a/src/main/java/com/bluedelivery/shop/closingday/RegularClosingDay.java b/src/main/java/com/bluedelivery/domain/closingday/RegularClosingDay.java similarity index 86% rename from src/main/java/com/bluedelivery/shop/closingday/RegularClosingDay.java rename to src/main/java/com/bluedelivery/domain/closingday/RegularClosingDay.java index 67928bcb..dda36aee 100644 --- a/src/main/java/com/bluedelivery/shop/closingday/RegularClosingDay.java +++ b/src/main/java/com/bluedelivery/domain/closingday/RegularClosingDay.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.closingday; +package com.bluedelivery.domain.closingday; /** * 매주 쉬는 휴무일 일정한 주기가 존재하는 휴무일을 자식클래스로 따로 관리하고 diff --git a/src/main/java/com/bluedelivery/shop/suspension/Suspension.java b/src/main/java/com/bluedelivery/domain/closingday/Suspension.java similarity index 95% rename from src/main/java/com/bluedelivery/shop/suspension/Suspension.java rename to src/main/java/com/bluedelivery/domain/closingday/Suspension.java index 2b61bcea..3f5783b6 100644 --- a/src/main/java/com/bluedelivery/shop/suspension/Suspension.java +++ b/src/main/java/com/bluedelivery/domain/closingday/Suspension.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.suspension; +package com.bluedelivery.domain.closingday; import java.time.LocalDateTime; diff --git a/src/main/java/com/bluedelivery/shop/closingday/TemporaryClosing.java b/src/main/java/com/bluedelivery/domain/closingday/TemporaryClosing.java similarity index 97% rename from src/main/java/com/bluedelivery/shop/closingday/TemporaryClosing.java rename to src/main/java/com/bluedelivery/domain/closingday/TemporaryClosing.java index 6896da6d..b819299d 100644 --- a/src/main/java/com/bluedelivery/shop/closingday/TemporaryClosing.java +++ b/src/main/java/com/bluedelivery/domain/closingday/TemporaryClosing.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.closingday; +package com.bluedelivery.domain.closingday; import java.time.LocalDate; diff --git a/src/main/java/com/bluedelivery/shop/closingday/WeeklyRegularClosing.java b/src/main/java/com/bluedelivery/domain/closingday/WeeklyRegularClosing.java similarity index 95% rename from src/main/java/com/bluedelivery/shop/closingday/WeeklyRegularClosing.java rename to src/main/java/com/bluedelivery/domain/closingday/WeeklyRegularClosing.java index 7aa6218f..a24255be 100644 --- a/src/main/java/com/bluedelivery/shop/closingday/WeeklyRegularClosing.java +++ b/src/main/java/com/bluedelivery/domain/closingday/WeeklyRegularClosing.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.closingday; +package com.bluedelivery.domain.closingday; import java.time.DayOfWeek; import java.time.LocalDate; diff --git a/src/main/java/com/bluedelivery/shop/closingday/YearlyLegalHolidays.java b/src/main/java/com/bluedelivery/domain/closingday/YearlyLegalHolidays.java similarity index 95% rename from src/main/java/com/bluedelivery/shop/closingday/YearlyLegalHolidays.java rename to src/main/java/com/bluedelivery/domain/closingday/YearlyLegalHolidays.java index 0df16920..5e216963 100644 --- a/src/main/java/com/bluedelivery/shop/closingday/YearlyLegalHolidays.java +++ b/src/main/java/com/bluedelivery/domain/closingday/YearlyLegalHolidays.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.closingday; +package com.bluedelivery.domain.closingday; import java.time.LocalDate; import java.time.Year; diff --git a/src/main/java/com/bluedelivery/domain/shop/Shop.java b/src/main/java/com/bluedelivery/domain/shop/Shop.java index 712e728a..e3fc6db2 100644 --- a/src/main/java/com/bluedelivery/domain/shop/Shop.java +++ b/src/main/java/com/bluedelivery/domain/shop/Shop.java @@ -7,9 +7,9 @@ import com.bluedelivery.domain.businesshour.BusinessHourPolicy; import com.bluedelivery.domain.category.Categories; import com.bluedelivery.domain.category.Category; -import com.bluedelivery.shop.closingday.ClosingDayPolicies; -import com.bluedelivery.shop.closingday.ClosingDayPolicy; -import com.bluedelivery.shop.suspension.Suspension; +import com.bluedelivery.domain.closingday.ClosingDayPolicies; +import com.bluedelivery.domain.closingday.ClosingDayPolicy; +import com.bluedelivery.domain.closingday.Suspension; public class Shop { private Long id; diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 4f571d64..10ea381f 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -22,8 +22,8 @@ mybatis: com.bluedelivery.domain.shop, com.bluedelivery.domain.category, com.bluedelivery.domain.businesshour, - com.bluedelivery.shop.closingday, - com.bluedelivery.shop.suspension, + com.bluedelivery.domain.closingday, + com.bluedelivery.domain.suspension, com.bluedelivery.user.domain, com.bluedelivery.utility, org.apache.ibatis.type diff --git a/src/main/resources/mybatis/mapper/ClosingMapper.xml b/src/main/resources/mybatis/mapper/ClosingMapper.xml index e1daae70..82a08977 100644 --- a/src/main/resources/mybatis/mapper/ClosingMapper.xml +++ b/src/main/resources/mybatis/mapper/ClosingMapper.xml @@ -5,7 +5,7 @@ - + @@ -16,7 +16,7 @@ - + diff --git a/src/main/resources/mybatis/mapper/ShopMapper.xml b/src/main/resources/mybatis/mapper/ShopMapper.xml index d7d8902e..93b11c18 100644 --- a/src/main/resources/mybatis/mapper/ShopMapper.xml +++ b/src/main/resources/mybatis/mapper/ShopMapper.xml @@ -138,16 +138,16 @@ INSERT INTO CLOSING_DAY (SHOP_ID, CLOSING_TYPE, CYCLE_TYPE, DAY_OF_WEEK, FROM_DATE, TO_DATE) VALUES - + (#{id}, #{closing.CLOSING_TYPE}, null, null, null, null) - + (#{id}, #{closing.CLOSING_TYPE}, null, #{closing.dayOfWeek}, null, null) - + (#{id}, #{closing.CLOSING_TYPE}, #{closing.cycle}, #{closing.dayOfWeek}, null, null) - + (#{id}, #{closing.CLOSING_TYPE}, null, null, #{closing.from}, #{closing.to}) diff --git a/src/test/java/com/bluedelivery/api/shop/ShopUpdateControllerTest.java b/src/test/java/com/bluedelivery/api/shop/ShopUpdateControllerTest.java index aa1c6a02..3be994c8 100644 --- a/src/test/java/com/bluedelivery/api/shop/ShopUpdateControllerTest.java +++ b/src/test/java/com/bluedelivery/api/shop/ShopUpdateControllerTest.java @@ -17,10 +17,9 @@ import org.springframework.test.context.ActiveProfiles; import org.springframework.test.web.servlet.MockMvc; -import com.bluedelivery.api.shop.UpdateClosingDaysRequest; import com.bluedelivery.application.shop.RegularClosingParam; import com.bluedelivery.application.shop.TemporaryClosingParam; -import com.bluedelivery.shop.closingday.CyclicRegularClosing; +import com.bluedelivery.domain.closingday.CyclicRegularClosing; import com.fasterxml.jackson.databind.ObjectMapper; @SpringBootTest diff --git a/src/test/java/com/bluedelivery/application/shop/ShopUpdateServiceTest.java b/src/test/java/com/bluedelivery/application/shop/ShopUpdateServiceTest.java index 953defc6..256efec7 100644 --- a/src/test/java/com/bluedelivery/application/shop/ShopUpdateServiceTest.java +++ b/src/test/java/com/bluedelivery/application/shop/ShopUpdateServiceTest.java @@ -18,10 +18,10 @@ import com.bluedelivery.api.shop.UpdateClosingDaysRequest; import com.bluedelivery.application.category.CategoryManagerService; +import com.bluedelivery.domain.closingday.CyclicRegularClosing; +import com.bluedelivery.domain.closingday.LegalHolidayClosing; import com.bluedelivery.domain.shop.Shop; import com.bluedelivery.domain.shop.ShopRepository; -import com.bluedelivery.shop.closingday.CyclicRegularClosing; -import com.bluedelivery.shop.closingday.LegalHolidayClosing; @ExtendWith(MockitoExtension.class) class ShopUpdateServiceTest { diff --git a/src/test/java/com/bluedelivery/shop/closingday/LegalHolidayClosingTest.java b/src/test/java/com/bluedelivery/domain/closingday/LegalHolidayClosingTest.java similarity index 97% rename from src/test/java/com/bluedelivery/shop/closingday/LegalHolidayClosingTest.java rename to src/test/java/com/bluedelivery/domain/closingday/LegalHolidayClosingTest.java index 93255daf..c1ee4525 100644 --- a/src/test/java/com/bluedelivery/shop/closingday/LegalHolidayClosingTest.java +++ b/src/test/java/com/bluedelivery/domain/closingday/LegalHolidayClosingTest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.closingday; +package com.bluedelivery.domain.closingday; import static org.assertj.core.api.Assertions.*; diff --git a/src/test/java/com/bluedelivery/shop/closingday/LegalHolidayTest.java b/src/test/java/com/bluedelivery/domain/closingday/LegalHolidayTest.java similarity index 97% rename from src/test/java/com/bluedelivery/shop/closingday/LegalHolidayTest.java rename to src/test/java/com/bluedelivery/domain/closingday/LegalHolidayTest.java index f7ae5a91..8b4b30b3 100644 --- a/src/test/java/com/bluedelivery/shop/closingday/LegalHolidayTest.java +++ b/src/test/java/com/bluedelivery/domain/closingday/LegalHolidayTest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.closingday; +package com.bluedelivery.domain.closingday; import static org.assertj.core.api.Assertions.assertThat; diff --git a/src/test/java/com/bluedelivery/shop/closingday/RegularClosingDayPolicyTest.java b/src/test/java/com/bluedelivery/domain/closingday/RegularClosingDayPolicyTest.java similarity index 98% rename from src/test/java/com/bluedelivery/shop/closingday/RegularClosingDayPolicyTest.java rename to src/test/java/com/bluedelivery/domain/closingday/RegularClosingDayPolicyTest.java index e6a9ea9c..f1e3f3b9 100644 --- a/src/test/java/com/bluedelivery/shop/closingday/RegularClosingDayPolicyTest.java +++ b/src/test/java/com/bluedelivery/domain/closingday/RegularClosingDayPolicyTest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.closingday; +package com.bluedelivery.domain.closingday; import static org.assertj.core.api.Assertions.assertThat; diff --git a/src/test/java/com/bluedelivery/shop/closingday/TemporaryClosingTest.java b/src/test/java/com/bluedelivery/domain/closingday/TemporaryClosingTest.java similarity index 96% rename from src/test/java/com/bluedelivery/shop/closingday/TemporaryClosingTest.java rename to src/test/java/com/bluedelivery/domain/closingday/TemporaryClosingTest.java index b002fc54..61075249 100644 --- a/src/test/java/com/bluedelivery/shop/closingday/TemporaryClosingTest.java +++ b/src/test/java/com/bluedelivery/domain/closingday/TemporaryClosingTest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.closingday; +package com.bluedelivery.domain.closingday; import static org.assertj.core.api.Assertions.*; From e51ed46efd1d77312800cda5fcf8e2b25f9ae984 Mon Sep 17 00:00:00 2001 From: lyh7712 Date: Tue, 27 Jul 2021 19:21:43 +0900 Subject: [PATCH 13/18] =?UTF-8?q?menu=20=ED=8C=A8=ED=82=A4=EC=A7=80=20?= =?UTF-8?q?=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{shop/menu => api/shop}/MenuGroupDto.java | 4 +++- .../{shop/menu => api/shop}/MenuOptionController.java | 2 +- .../{shop/menu => api/shop}/MenuOptionDto.java | 4 +++- .../{shop/menu => api/shop}/MenuOptionGroupDto.java | 5 ++++- .../{shop/menu => api/shop}/RegisterMenuDto.java | 8 +++++--- .../{shop/menu => api/shop}/UpdateMenuDto.java | 4 ++-- .../menu => api/shop/adapter}/MenuController.java | 6 +++++- .../shop/adapter}/MenuGroupController.java | 5 ++++- .../shop/adapter}/MenuOptionControllerImpl.java | 6 +++++- .../shop/adapter}/MenuOptionServiceImpl.java | 9 ++++++++- .../menu => application/shop}/MenuOptionService.java | 5 ++++- .../application/shop/SearchMenuService.java | 4 ++-- .../shop/adapter}/MenuGroupService.java | 10 +++++++--- .../shop/adapter}/MenuService.java | 7 +++++-- .../com/bluedelivery/{shop => domain}/menu/Menu.java | 2 +- .../bluedelivery/{shop => domain}/menu/MenuGroup.java | 2 +- .../{shop => domain}/menu/MenuOption.java | 2 +- .../{shop => domain}/menu/MenuOptionGroup.java | 2 +- .../menu/MenuOptionGroupRepository.java | 2 +- .../{shop => domain}/menu/MenuOptionRepository.java | 2 +- .../{shop/menu => infra/shop}/MenuGroupMapper.java | 6 +++++- .../{shop/menu => infra/shop}/MenuMapper.java | 6 ++++-- src/main/resources/mybatis/mapper/MenuGroupMapper.xml | 10 +++++----- src/main/resources/mybatis/mapper/MenuMapper.xml | 8 ++++---- .../menu => api/shop}/MenuOptionControllerTest.java | 5 ++++- .../shop}/MenuGroupServiceTest.java | 7 +++++-- .../shop}/MenuOptionServiceTest.java | 11 ++++++++++- .../menu => application/shop}/MenuServiceTest.java | 8 ++++++-- 28 files changed, 107 insertions(+), 45 deletions(-) rename src/main/java/com/bluedelivery/{shop/menu => api/shop}/MenuGroupDto.java (94%) rename src/main/java/com/bluedelivery/{shop/menu => api/shop}/MenuOptionController.java (90%) rename src/main/java/com/bluedelivery/{shop/menu => api/shop}/MenuOptionDto.java (92%) rename src/main/java/com/bluedelivery/{shop/menu => api/shop}/MenuOptionGroupDto.java (91%) rename src/main/java/com/bluedelivery/{shop/menu => api/shop}/RegisterMenuDto.java (91%) rename src/main/java/com/bluedelivery/{shop/menu => api/shop}/UpdateMenuDto.java (93%) rename src/main/java/com/bluedelivery/{shop/menu => api/shop/adapter}/MenuController.java (93%) rename src/main/java/com/bluedelivery/{shop/menu => api/shop/adapter}/MenuGroupController.java (93%) rename src/main/java/com/bluedelivery/{shop/menu => api/shop/adapter}/MenuOptionControllerImpl.java (87%) rename src/main/java/com/bluedelivery/{shop/menu => api/shop/adapter}/MenuOptionServiceImpl.java (75%) rename src/main/java/com/bluedelivery/{shop/menu => application/shop}/MenuOptionService.java (50%) rename src/main/java/com/bluedelivery/{shop/menu => application/shop/adapter}/MenuGroupService.java (77%) rename src/main/java/com/bluedelivery/{shop/menu => application/shop/adapter}/MenuService.java (81%) rename src/main/java/com/bluedelivery/{shop => domain}/menu/Menu.java (98%) rename src/main/java/com/bluedelivery/{shop => domain}/menu/MenuGroup.java (95%) rename src/main/java/com/bluedelivery/{shop => domain}/menu/MenuOption.java (97%) rename src/main/java/com/bluedelivery/{shop => domain}/menu/MenuOptionGroup.java (97%) rename src/main/java/com/bluedelivery/{shop => domain}/menu/MenuOptionGroupRepository.java (80%) rename src/main/java/com/bluedelivery/{shop => domain}/menu/MenuOptionRepository.java (79%) rename src/main/java/com/bluedelivery/{shop/menu => infra/shop}/MenuGroupMapper.java (76%) rename src/main/java/com/bluedelivery/{shop/menu => infra/shop}/MenuMapper.java (77%) rename src/test/java/com/bluedelivery/{shop/menu => api/shop}/MenuOptionControllerTest.java (91%) rename src/test/java/com/bluedelivery/{shop/menu => application/shop}/MenuGroupServiceTest.java (92%) rename src/test/java/com/bluedelivery/{shop/menu => application/shop}/MenuOptionServiceTest.java (82%) rename src/test/java/com/bluedelivery/{shop/menu => application/shop}/MenuServiceTest.java (90%) diff --git a/src/main/java/com/bluedelivery/shop/menu/MenuGroupDto.java b/src/main/java/com/bluedelivery/api/shop/MenuGroupDto.java similarity index 94% rename from src/main/java/com/bluedelivery/shop/menu/MenuGroupDto.java rename to src/main/java/com/bluedelivery/api/shop/MenuGroupDto.java index d3b85931..f4d2e1fe 100644 --- a/src/main/java/com/bluedelivery/shop/menu/MenuGroupDto.java +++ b/src/main/java/com/bluedelivery/api/shop/MenuGroupDto.java @@ -1,9 +1,11 @@ -package com.bluedelivery.shop.menu; +package com.bluedelivery.api.shop; import java.util.List; import javax.validation.constraints.NotNull; +import com.bluedelivery.domain.menu.Menu; + public class MenuGroupDto { private Long id; diff --git a/src/main/java/com/bluedelivery/shop/menu/MenuOptionController.java b/src/main/java/com/bluedelivery/api/shop/MenuOptionController.java similarity index 90% rename from src/main/java/com/bluedelivery/shop/menu/MenuOptionController.java rename to src/main/java/com/bluedelivery/api/shop/MenuOptionController.java index fe9dc176..c6f1a016 100644 --- a/src/main/java/com/bluedelivery/shop/menu/MenuOptionController.java +++ b/src/main/java/com/bluedelivery/api/shop/MenuOptionController.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.menu; +package com.bluedelivery.api.shop; import org.springframework.http.ResponseEntity; diff --git a/src/main/java/com/bluedelivery/shop/menu/MenuOptionDto.java b/src/main/java/com/bluedelivery/api/shop/MenuOptionDto.java similarity index 92% rename from src/main/java/com/bluedelivery/shop/menu/MenuOptionDto.java rename to src/main/java/com/bluedelivery/api/shop/MenuOptionDto.java index be492fa5..70d3db3c 100644 --- a/src/main/java/com/bluedelivery/shop/menu/MenuOptionDto.java +++ b/src/main/java/com/bluedelivery/api/shop/MenuOptionDto.java @@ -1,8 +1,10 @@ -package com.bluedelivery.shop.menu; +package com.bluedelivery.api.shop; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; +import com.bluedelivery.domain.menu.MenuOption; + public class MenuOptionDto { @NotNull @NotBlank diff --git a/src/main/java/com/bluedelivery/shop/menu/MenuOptionGroupDto.java b/src/main/java/com/bluedelivery/api/shop/MenuOptionGroupDto.java similarity index 91% rename from src/main/java/com/bluedelivery/shop/menu/MenuOptionGroupDto.java rename to src/main/java/com/bluedelivery/api/shop/MenuOptionGroupDto.java index 5320562e..424751c1 100644 --- a/src/main/java/com/bluedelivery/shop/menu/MenuOptionGroupDto.java +++ b/src/main/java/com/bluedelivery/api/shop/MenuOptionGroupDto.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.menu; +package com.bluedelivery.api.shop; import java.util.ArrayList; import java.util.List; @@ -6,6 +6,9 @@ import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; +import com.bluedelivery.domain.menu.MenuOption; +import com.bluedelivery.domain.menu.MenuOptionGroup; + import lombok.Getter; import lombok.Setter; diff --git a/src/main/java/com/bluedelivery/shop/menu/RegisterMenuDto.java b/src/main/java/com/bluedelivery/api/shop/RegisterMenuDto.java similarity index 91% rename from src/main/java/com/bluedelivery/shop/menu/RegisterMenuDto.java rename to src/main/java/com/bluedelivery/api/shop/RegisterMenuDto.java index 0f4df64d..8d41f043 100644 --- a/src/main/java/com/bluedelivery/shop/menu/RegisterMenuDto.java +++ b/src/main/java/com/bluedelivery/api/shop/RegisterMenuDto.java @@ -1,12 +1,14 @@ -package com.bluedelivery.shop.menu; +package com.bluedelivery.api.shop; -import static com.bluedelivery.shop.menu.Menu.*; +import static com.bluedelivery.domain.menu.Menu.*; import java.util.List; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; +import com.bluedelivery.domain.menu.Menu; +import com.bluedelivery.domain.menu.MenuOptionGroup; import com.fasterxml.jackson.annotation.JsonInclude; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -34,7 +36,7 @@ public class RegisterMenuDto { public RegisterMenuDto() { } - Menu toEntity() { + public Menu toEntity() { return Menu.builder() .menuGroupId(getMenuGroupId()) .name(getName()) diff --git a/src/main/java/com/bluedelivery/shop/menu/UpdateMenuDto.java b/src/main/java/com/bluedelivery/api/shop/UpdateMenuDto.java similarity index 93% rename from src/main/java/com/bluedelivery/shop/menu/UpdateMenuDto.java rename to src/main/java/com/bluedelivery/api/shop/UpdateMenuDto.java index 50caae36..4b80f930 100644 --- a/src/main/java/com/bluedelivery/shop/menu/UpdateMenuDto.java +++ b/src/main/java/com/bluedelivery/api/shop/UpdateMenuDto.java @@ -1,8 +1,8 @@ -package com.bluedelivery.shop.menu; +package com.bluedelivery.api.shop; import javax.validation.constraints.NotNull; -import com.bluedelivery.shop.menu.Menu.MenuStatus; +import com.bluedelivery.domain.menu.Menu.MenuStatus; import com.fasterxml.jackson.annotation.JsonInclude; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/src/main/java/com/bluedelivery/shop/menu/MenuController.java b/src/main/java/com/bluedelivery/api/shop/adapter/MenuController.java similarity index 93% rename from src/main/java/com/bluedelivery/shop/menu/MenuController.java rename to src/main/java/com/bluedelivery/api/shop/adapter/MenuController.java index 20f619f2..654d3a7e 100644 --- a/src/main/java/com/bluedelivery/shop/menu/MenuController.java +++ b/src/main/java/com/bluedelivery/api/shop/adapter/MenuController.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.menu; +package com.bluedelivery.api.shop.adapter; import static com.bluedelivery.common.response.HttpResponse.*; @@ -14,7 +14,11 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import com.bluedelivery.api.shop.RegisterMenuDto; +import com.bluedelivery.api.shop.UpdateMenuDto; +import com.bluedelivery.application.shop.adapter.MenuService; import com.bluedelivery.common.response.HttpResponse; +import com.bluedelivery.domain.menu.Menu; @RestController @RequestMapping("/menu-groups") diff --git a/src/main/java/com/bluedelivery/shop/menu/MenuGroupController.java b/src/main/java/com/bluedelivery/api/shop/adapter/MenuGroupController.java similarity index 93% rename from src/main/java/com/bluedelivery/shop/menu/MenuGroupController.java rename to src/main/java/com/bluedelivery/api/shop/adapter/MenuGroupController.java index d1dd1b26..37de14ea 100644 --- a/src/main/java/com/bluedelivery/shop/menu/MenuGroupController.java +++ b/src/main/java/com/bluedelivery/api/shop/adapter/MenuGroupController.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.menu; +package com.bluedelivery.api.shop.adapter; import java.util.List; @@ -14,8 +14,11 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import com.bluedelivery.api.shop.MenuGroupDto; +import com.bluedelivery.application.shop.adapter.MenuGroupService; import com.bluedelivery.common.response.ApiException; import com.bluedelivery.common.response.ErrorCode; +import com.bluedelivery.domain.menu.MenuGroup; @RestController @RequestMapping("/shops") diff --git a/src/main/java/com/bluedelivery/shop/menu/MenuOptionControllerImpl.java b/src/main/java/com/bluedelivery/api/shop/adapter/MenuOptionControllerImpl.java similarity index 87% rename from src/main/java/com/bluedelivery/shop/menu/MenuOptionControllerImpl.java rename to src/main/java/com/bluedelivery/api/shop/adapter/MenuOptionControllerImpl.java index 4264fbef..07383213 100644 --- a/src/main/java/com/bluedelivery/shop/menu/MenuOptionControllerImpl.java +++ b/src/main/java/com/bluedelivery/api/shop/adapter/MenuOptionControllerImpl.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.menu; +package com.bluedelivery.api.shop.adapter; import javax.validation.Valid; @@ -9,6 +9,10 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; +import com.bluedelivery.api.shop.MenuOptionController; +import com.bluedelivery.api.shop.MenuOptionDto; +import com.bluedelivery.api.shop.MenuOptionGroupDto; +import com.bluedelivery.application.shop.MenuOptionService; import com.bluedelivery.common.response.HttpResponse; @RestController diff --git a/src/main/java/com/bluedelivery/shop/menu/MenuOptionServiceImpl.java b/src/main/java/com/bluedelivery/api/shop/adapter/MenuOptionServiceImpl.java similarity index 75% rename from src/main/java/com/bluedelivery/shop/menu/MenuOptionServiceImpl.java rename to src/main/java/com/bluedelivery/api/shop/adapter/MenuOptionServiceImpl.java index 821bec0f..b71afc5b 100644 --- a/src/main/java/com/bluedelivery/shop/menu/MenuOptionServiceImpl.java +++ b/src/main/java/com/bluedelivery/api/shop/adapter/MenuOptionServiceImpl.java @@ -1,11 +1,18 @@ -package com.bluedelivery.shop.menu; +package com.bluedelivery.api.shop.adapter; import java.util.Optional; import org.springframework.stereotype.Service; +import com.bluedelivery.api.shop.MenuOptionDto; +import com.bluedelivery.api.shop.MenuOptionGroupDto; +import com.bluedelivery.application.shop.MenuOptionService; import com.bluedelivery.common.response.ApiException; import com.bluedelivery.common.response.ErrorCode; +import com.bluedelivery.domain.menu.MenuOption; +import com.bluedelivery.domain.menu.MenuOptionGroup; +import com.bluedelivery.domain.menu.MenuOptionGroupRepository; +import com.bluedelivery.domain.menu.MenuOptionRepository; @Service public class MenuOptionServiceImpl implements MenuOptionService { diff --git a/src/main/java/com/bluedelivery/shop/menu/MenuOptionService.java b/src/main/java/com/bluedelivery/application/shop/MenuOptionService.java similarity index 50% rename from src/main/java/com/bluedelivery/shop/menu/MenuOptionService.java rename to src/main/java/com/bluedelivery/application/shop/MenuOptionService.java index 9af379a8..755091a2 100644 --- a/src/main/java/com/bluedelivery/shop/menu/MenuOptionService.java +++ b/src/main/java/com/bluedelivery/application/shop/MenuOptionService.java @@ -1,6 +1,9 @@ -package com.bluedelivery.shop.menu; +package com.bluedelivery.application.shop; +import com.bluedelivery.api.shop.MenuOptionDto; +import com.bluedelivery.api.shop.MenuOptionGroupDto; + public interface MenuOptionService { void registerMenuOptionGroup(MenuOptionGroupDto dto); diff --git a/src/main/java/com/bluedelivery/application/shop/SearchMenuService.java b/src/main/java/com/bluedelivery/application/shop/SearchMenuService.java index 3325235c..522cf8a6 100644 --- a/src/main/java/com/bluedelivery/application/shop/SearchMenuService.java +++ b/src/main/java/com/bluedelivery/application/shop/SearchMenuService.java @@ -4,8 +4,8 @@ import org.springframework.stereotype.Service; -import com.bluedelivery.shop.menu.Menu; -import com.bluedelivery.shop.menu.MenuMapper; +import com.bluedelivery.domain.menu.Menu; +import com.bluedelivery.infra.shop.MenuMapper; @Service public class SearchMenuService { diff --git a/src/main/java/com/bluedelivery/shop/menu/MenuGroupService.java b/src/main/java/com/bluedelivery/application/shop/adapter/MenuGroupService.java similarity index 77% rename from src/main/java/com/bluedelivery/shop/menu/MenuGroupService.java rename to src/main/java/com/bluedelivery/application/shop/adapter/MenuGroupService.java index 78947e11..442478ad 100644 --- a/src/main/java/com/bluedelivery/shop/menu/MenuGroupService.java +++ b/src/main/java/com/bluedelivery/application/shop/adapter/MenuGroupService.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.menu; +package com.bluedelivery.application.shop.adapter; import java.util.List; @@ -6,6 +6,10 @@ import org.springframework.dao.DuplicateKeyException; import org.springframework.stereotype.Service; +import com.bluedelivery.api.shop.MenuGroupDto; +import com.bluedelivery.domain.menu.MenuGroup; +import com.bluedelivery.infra.shop.MenuGroupMapper; + @Service public class MenuGroupService { @@ -28,11 +32,11 @@ public List getMenuGroup(Long id) { return menuGroupMapper.findMenuGroup(id); } - int updateMenuGroup(MenuGroupDto dto) { + public int updateMenuGroup(MenuGroupDto dto) { return menuGroupMapper.updateMenuGroup(dto); } - int deleteMenuGroup(Long id) { + public int deleteMenuGroup(Long id) { return menuGroupMapper.deleteMenuGroup(id); } diff --git a/src/main/java/com/bluedelivery/shop/menu/MenuService.java b/src/main/java/com/bluedelivery/application/shop/adapter/MenuService.java similarity index 81% rename from src/main/java/com/bluedelivery/shop/menu/MenuService.java rename to src/main/java/com/bluedelivery/application/shop/adapter/MenuService.java index 548e5ec5..274e71c7 100644 --- a/src/main/java/com/bluedelivery/shop/menu/MenuService.java +++ b/src/main/java/com/bluedelivery/application/shop/adapter/MenuService.java @@ -1,11 +1,14 @@ -package com.bluedelivery.shop.menu; +package com.bluedelivery.application.shop.adapter; import static com.bluedelivery.common.response.ErrorCode.*; -import static com.bluedelivery.shop.menu.Menu.*; +import static com.bluedelivery.domain.menu.Menu.*; import org.springframework.stereotype.Service; +import com.bluedelivery.api.shop.RegisterMenuDto; import com.bluedelivery.common.response.ApiException; +import com.bluedelivery.domain.menu.Menu; +import com.bluedelivery.infra.shop.MenuMapper; @Service public class MenuService { diff --git a/src/main/java/com/bluedelivery/shop/menu/Menu.java b/src/main/java/com/bluedelivery/domain/menu/Menu.java similarity index 98% rename from src/main/java/com/bluedelivery/shop/menu/Menu.java rename to src/main/java/com/bluedelivery/domain/menu/Menu.java index c622973b..9a5cdae6 100644 --- a/src/main/java/com/bluedelivery/shop/menu/Menu.java +++ b/src/main/java/com/bluedelivery/domain/menu/Menu.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.menu; +package com.bluedelivery.domain.menu; import java.util.List; import java.util.Objects; diff --git a/src/main/java/com/bluedelivery/shop/menu/MenuGroup.java b/src/main/java/com/bluedelivery/domain/menu/MenuGroup.java similarity index 95% rename from src/main/java/com/bluedelivery/shop/menu/MenuGroup.java rename to src/main/java/com/bluedelivery/domain/menu/MenuGroup.java index a995d0fd..2dd56a2c 100644 --- a/src/main/java/com/bluedelivery/shop/menu/MenuGroup.java +++ b/src/main/java/com/bluedelivery/domain/menu/MenuGroup.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.menu; +package com.bluedelivery.domain.menu; import java.util.List; diff --git a/src/main/java/com/bluedelivery/shop/menu/MenuOption.java b/src/main/java/com/bluedelivery/domain/menu/MenuOption.java similarity index 97% rename from src/main/java/com/bluedelivery/shop/menu/MenuOption.java rename to src/main/java/com/bluedelivery/domain/menu/MenuOption.java index dd57c1e8..1b6477f9 100644 --- a/src/main/java/com/bluedelivery/shop/menu/MenuOption.java +++ b/src/main/java/com/bluedelivery/domain/menu/MenuOption.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.menu; +package com.bluedelivery.domain.menu; import java.util.Objects; diff --git a/src/main/java/com/bluedelivery/shop/menu/MenuOptionGroup.java b/src/main/java/com/bluedelivery/domain/menu/MenuOptionGroup.java similarity index 97% rename from src/main/java/com/bluedelivery/shop/menu/MenuOptionGroup.java rename to src/main/java/com/bluedelivery/domain/menu/MenuOptionGroup.java index afb9cef9..6c7bf914 100644 --- a/src/main/java/com/bluedelivery/shop/menu/MenuOptionGroup.java +++ b/src/main/java/com/bluedelivery/domain/menu/MenuOptionGroup.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.menu; +package com.bluedelivery.domain.menu; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/com/bluedelivery/shop/menu/MenuOptionGroupRepository.java b/src/main/java/com/bluedelivery/domain/menu/MenuOptionGroupRepository.java similarity index 80% rename from src/main/java/com/bluedelivery/shop/menu/MenuOptionGroupRepository.java rename to src/main/java/com/bluedelivery/domain/menu/MenuOptionGroupRepository.java index 81f6abb0..7a66fd75 100644 --- a/src/main/java/com/bluedelivery/shop/menu/MenuOptionGroupRepository.java +++ b/src/main/java/com/bluedelivery/domain/menu/MenuOptionGroupRepository.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.menu; +package com.bluedelivery.domain.menu; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/src/main/java/com/bluedelivery/shop/menu/MenuOptionRepository.java b/src/main/java/com/bluedelivery/domain/menu/MenuOptionRepository.java similarity index 79% rename from src/main/java/com/bluedelivery/shop/menu/MenuOptionRepository.java rename to src/main/java/com/bluedelivery/domain/menu/MenuOptionRepository.java index 5c823bb3..9c7775e6 100644 --- a/src/main/java/com/bluedelivery/shop/menu/MenuOptionRepository.java +++ b/src/main/java/com/bluedelivery/domain/menu/MenuOptionRepository.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.menu; +package com.bluedelivery.domain.menu; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/src/main/java/com/bluedelivery/shop/menu/MenuGroupMapper.java b/src/main/java/com/bluedelivery/infra/shop/MenuGroupMapper.java similarity index 76% rename from src/main/java/com/bluedelivery/shop/menu/MenuGroupMapper.java rename to src/main/java/com/bluedelivery/infra/shop/MenuGroupMapper.java index 154b9a0e..62a507ec 100644 --- a/src/main/java/com/bluedelivery/shop/menu/MenuGroupMapper.java +++ b/src/main/java/com/bluedelivery/infra/shop/MenuGroupMapper.java @@ -1,10 +1,14 @@ -package com.bluedelivery.shop.menu; +package com.bluedelivery.infra.shop; import java.util.List; import org.apache.ibatis.annotations.Mapper; import org.springframework.stereotype.Repository; +import com.bluedelivery.api.shop.MenuGroupDto; +import com.bluedelivery.domain.menu.MenuGroup; + + @Mapper @Repository public interface MenuGroupMapper { diff --git a/src/main/java/com/bluedelivery/shop/menu/MenuMapper.java b/src/main/java/com/bluedelivery/infra/shop/MenuMapper.java similarity index 77% rename from src/main/java/com/bluedelivery/shop/menu/MenuMapper.java rename to src/main/java/com/bluedelivery/infra/shop/MenuMapper.java index fe1209cb..cbe3cdc3 100644 --- a/src/main/java/com/bluedelivery/shop/menu/MenuMapper.java +++ b/src/main/java/com/bluedelivery/infra/shop/MenuMapper.java @@ -1,12 +1,14 @@ -package com.bluedelivery.shop.menu; +package com.bluedelivery.infra.shop; -import static com.bluedelivery.shop.menu.Menu.*; +import static com.bluedelivery.domain.menu.Menu.*; import java.util.List; import org.apache.ibatis.annotations.Mapper; import org.springframework.stereotype.Repository; +import com.bluedelivery.domain.menu.Menu; + @Mapper @Repository public interface MenuMapper { diff --git a/src/main/resources/mybatis/mapper/MenuGroupMapper.xml b/src/main/resources/mybatis/mapper/MenuGroupMapper.xml index ef94a486..21262bde 100644 --- a/src/main/resources/mybatis/mapper/MenuGroupMapper.xml +++ b/src/main/resources/mybatis/mapper/MenuGroupMapper.xml @@ -1,23 +1,23 @@ - + - + - + - + - + INSERT INTO MENU_GROUP(SHOP_ID, NAME, CONTENT) VALUES (#{shopId}, #{name}, #{content}) diff --git a/src/main/resources/mybatis/mapper/MenuMapper.xml b/src/main/resources/mybatis/mapper/MenuMapper.xml index c8ca597a..c2eeb5a4 100644 --- a/src/main/resources/mybatis/mapper/MenuMapper.xml +++ b/src/main/resources/mybatis/mapper/MenuMapper.xml @@ -1,19 +1,19 @@ - + - + - + - + INSERT INTO MENU(GROUP_ID, NAME, PRICE, COMPOSITION, CONTENT, STATUS, IS_MAIN) VALUES (#{menuGroupId}, #{name}, #{price}, #{composition}, #{content}, #{status}, #{isMain}); diff --git a/src/test/java/com/bluedelivery/shop/menu/MenuOptionControllerTest.java b/src/test/java/com/bluedelivery/api/shop/MenuOptionControllerTest.java similarity index 91% rename from src/test/java/com/bluedelivery/shop/menu/MenuOptionControllerTest.java rename to src/test/java/com/bluedelivery/api/shop/MenuOptionControllerTest.java index 67129b3f..3a2918a8 100644 --- a/src/test/java/com/bluedelivery/shop/menu/MenuOptionControllerTest.java +++ b/src/test/java/com/bluedelivery/api/shop/MenuOptionControllerTest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.menu; +package com.bluedelivery.api.shop; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; @@ -11,8 +11,11 @@ import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MockMvc; +import com.bluedelivery.api.shop.adapter.MenuOptionControllerImpl; +import com.bluedelivery.api.shop.adapter.MenuOptionServiceImpl; import com.bluedelivery.application.authentication.AuthenticationService; import com.bluedelivery.domain.authentication.AuthenticationRepository; +import com.bluedelivery.domain.menu.MenuOptionGroup; import com.fasterxml.jackson.databind.ObjectMapper; @WebMvcTest(MenuOptionControllerImpl.class) diff --git a/src/test/java/com/bluedelivery/shop/menu/MenuGroupServiceTest.java b/src/test/java/com/bluedelivery/application/shop/MenuGroupServiceTest.java similarity index 92% rename from src/test/java/com/bluedelivery/shop/menu/MenuGroupServiceTest.java rename to src/test/java/com/bluedelivery/application/shop/MenuGroupServiceTest.java index d5edce78..0dcdf94c 100644 --- a/src/test/java/com/bluedelivery/shop/menu/MenuGroupServiceTest.java +++ b/src/test/java/com/bluedelivery/application/shop/MenuGroupServiceTest.java @@ -1,5 +1,4 @@ -package com.bluedelivery.shop.menu; - +package com.bluedelivery.application.shop; import static org.assertj.core.api.Assertions.*; import static org.mockito.BDDMockito.*; @@ -12,6 +11,10 @@ import org.mockito.junit.jupiter.MockitoExtension; import org.springframework.test.context.ActiveProfiles; +import com.bluedelivery.api.shop.MenuGroupDto; +import com.bluedelivery.application.shop.adapter.MenuGroupService; +import com.bluedelivery.infra.shop.MenuGroupMapper; + @ExtendWith(MockitoExtension.class) @ActiveProfiles("test") class MenuGroupServiceTest { diff --git a/src/test/java/com/bluedelivery/shop/menu/MenuOptionServiceTest.java b/src/test/java/com/bluedelivery/application/shop/MenuOptionServiceTest.java similarity index 82% rename from src/test/java/com/bluedelivery/shop/menu/MenuOptionServiceTest.java rename to src/test/java/com/bluedelivery/application/shop/MenuOptionServiceTest.java index fd9fe185..6c041243 100644 --- a/src/test/java/com/bluedelivery/shop/menu/MenuOptionServiceTest.java +++ b/src/test/java/com/bluedelivery/application/shop/MenuOptionServiceTest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.shop.menu; +package com.bluedelivery.application.shop; import static java.util.Optional.*; import static org.mockito.BDDMockito.*; @@ -14,6 +14,15 @@ import org.mockito.junit.jupiter.MockitoExtension; import org.springframework.test.context.ActiveProfiles; +import com.bluedelivery.api.shop.MenuOptionDto; +import com.bluedelivery.api.shop.MenuOptionGroupDto; +import com.bluedelivery.api.shop.adapter.MenuOptionServiceImpl; +import com.bluedelivery.domain.menu.MenuOption; +import com.bluedelivery.domain.menu.MenuOptionGroup; +import com.bluedelivery.domain.menu.MenuOptionGroupRepository; +import com.bluedelivery.domain.menu.MenuOptionRepository; + + @ExtendWith(MockitoExtension.class) @ActiveProfiles("test") class MenuOptionServiceTest { diff --git a/src/test/java/com/bluedelivery/shop/menu/MenuServiceTest.java b/src/test/java/com/bluedelivery/application/shop/MenuServiceTest.java similarity index 90% rename from src/test/java/com/bluedelivery/shop/menu/MenuServiceTest.java rename to src/test/java/com/bluedelivery/application/shop/MenuServiceTest.java index 06d40d6e..0fe8f5b7 100644 --- a/src/test/java/com/bluedelivery/shop/menu/MenuServiceTest.java +++ b/src/test/java/com/bluedelivery/application/shop/MenuServiceTest.java @@ -1,7 +1,7 @@ -package com.bluedelivery.shop.menu; +package com.bluedelivery.application.shop; import static com.bluedelivery.common.response.ErrorCode.*; -import static com.bluedelivery.shop.menu.Menu.*; +import static com.bluedelivery.domain.menu.Menu.*; import static org.assertj.core.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.BDDMockito.*; @@ -14,8 +14,12 @@ import org.mockito.junit.jupiter.MockitoExtension; import org.springframework.test.context.ActiveProfiles; +import com.bluedelivery.api.shop.RegisterMenuDto; +import com.bluedelivery.application.shop.adapter.MenuService; import com.bluedelivery.common.response.ApiException; import com.bluedelivery.common.response.ErrorCode; +import com.bluedelivery.domain.menu.Menu; +import com.bluedelivery.infra.shop.MenuMapper; @ExtendWith(MockitoExtension.class) From 688bf3d0c1838e0a651e8539db3cd9580939cfcf Mon Sep 17 00:00:00 2001 From: lyh7712 Date: Tue, 27 Jul 2021 19:54:59 +0900 Subject: [PATCH 14/18] =?UTF-8?q?api(menu)=20=ED=8C=A8=ED=82=A4=EC=A7=80?= =?UTF-8?q?=20=EB=B6=84=ED=95=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bluedelivery/api/{shop => menu}/MenuGroupDto.java | 2 +- .../api/{shop => menu}/MenuOptionController.java | 2 +- .../bluedelivery/api/{shop => menu}/MenuOptionDto.java | 2 +- .../api/{shop => menu}/MenuOptionGroupDto.java | 2 +- .../bluedelivery/api/{shop => menu}/RegisterMenuDto.java | 2 +- .../api/{shop => menu}/adapter/MenuController.java | 4 ++-- .../api/{shop => menu}/adapter/MenuGroupController.java | 4 ++-- .../{shop => menu}/adapter/MenuOptionControllerImpl.java | 9 +++++---- .../bluedelivery/application/shop/MenuOptionService.java | 4 ++-- .../shop}/MenuOptionServiceImpl.java | 7 +++---- .../application/shop/adapter/MenuGroupService.java | 2 +- .../application/shop/adapter/MenuService.java | 2 +- .../com/bluedelivery/infra/shop/MenuGroupMapper.java | 2 +- src/main/resources/mybatis/mapper/MenuGroupMapper.xml | 8 ++++---- .../api/{shop => menu}/MenuOptionControllerTest.java | 6 +++--- .../application/shop/MenuGroupServiceTest.java | 2 +- .../application/shop/MenuOptionServiceTest.java | 5 ++--- .../bluedelivery/application/shop/MenuServiceTest.java | 2 +- 18 files changed, 33 insertions(+), 34 deletions(-) rename src/main/java/com/bluedelivery/api/{shop => menu}/MenuGroupDto.java (97%) rename src/main/java/com/bluedelivery/api/{shop => menu}/MenuOptionController.java (90%) rename src/main/java/com/bluedelivery/api/{shop => menu}/MenuOptionDto.java (97%) rename src/main/java/com/bluedelivery/api/{shop => menu}/MenuOptionGroupDto.java (97%) rename src/main/java/com/bluedelivery/api/{shop => menu}/RegisterMenuDto.java (98%) rename src/main/java/com/bluedelivery/api/{shop => menu}/adapter/MenuController.java (97%) rename src/main/java/com/bluedelivery/api/{shop => menu}/adapter/MenuGroupController.java (97%) rename src/main/java/com/bluedelivery/api/{shop => menu}/adapter/MenuOptionControllerImpl.java (88%) rename src/main/java/com/bluedelivery/{api/shop/adapter => application/shop}/MenuOptionServiceImpl.java (88%) rename src/test/java/com/bluedelivery/api/{shop => menu}/MenuOptionControllerTest.java (93%) diff --git a/src/main/java/com/bluedelivery/api/shop/MenuGroupDto.java b/src/main/java/com/bluedelivery/api/menu/MenuGroupDto.java similarity index 97% rename from src/main/java/com/bluedelivery/api/shop/MenuGroupDto.java rename to src/main/java/com/bluedelivery/api/menu/MenuGroupDto.java index f4d2e1fe..e385e7d3 100644 --- a/src/main/java/com/bluedelivery/api/shop/MenuGroupDto.java +++ b/src/main/java/com/bluedelivery/api/menu/MenuGroupDto.java @@ -1,4 +1,4 @@ -package com.bluedelivery.api.shop; +package com.bluedelivery.api.menu; import java.util.List; diff --git a/src/main/java/com/bluedelivery/api/shop/MenuOptionController.java b/src/main/java/com/bluedelivery/api/menu/MenuOptionController.java similarity index 90% rename from src/main/java/com/bluedelivery/api/shop/MenuOptionController.java rename to src/main/java/com/bluedelivery/api/menu/MenuOptionController.java index c6f1a016..8a55ce55 100644 --- a/src/main/java/com/bluedelivery/api/shop/MenuOptionController.java +++ b/src/main/java/com/bluedelivery/api/menu/MenuOptionController.java @@ -1,4 +1,4 @@ -package com.bluedelivery.api.shop; +package com.bluedelivery.api.menu; import org.springframework.http.ResponseEntity; diff --git a/src/main/java/com/bluedelivery/api/shop/MenuOptionDto.java b/src/main/java/com/bluedelivery/api/menu/MenuOptionDto.java similarity index 97% rename from src/main/java/com/bluedelivery/api/shop/MenuOptionDto.java rename to src/main/java/com/bluedelivery/api/menu/MenuOptionDto.java index 70d3db3c..074d1d5c 100644 --- a/src/main/java/com/bluedelivery/api/shop/MenuOptionDto.java +++ b/src/main/java/com/bluedelivery/api/menu/MenuOptionDto.java @@ -1,4 +1,4 @@ -package com.bluedelivery.api.shop; +package com.bluedelivery.api.menu; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; diff --git a/src/main/java/com/bluedelivery/api/shop/MenuOptionGroupDto.java b/src/main/java/com/bluedelivery/api/menu/MenuOptionGroupDto.java similarity index 97% rename from src/main/java/com/bluedelivery/api/shop/MenuOptionGroupDto.java rename to src/main/java/com/bluedelivery/api/menu/MenuOptionGroupDto.java index 424751c1..52e98c60 100644 --- a/src/main/java/com/bluedelivery/api/shop/MenuOptionGroupDto.java +++ b/src/main/java/com/bluedelivery/api/menu/MenuOptionGroupDto.java @@ -1,4 +1,4 @@ -package com.bluedelivery.api.shop; +package com.bluedelivery.api.menu; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/com/bluedelivery/api/shop/RegisterMenuDto.java b/src/main/java/com/bluedelivery/api/menu/RegisterMenuDto.java similarity index 98% rename from src/main/java/com/bluedelivery/api/shop/RegisterMenuDto.java rename to src/main/java/com/bluedelivery/api/menu/RegisterMenuDto.java index 8d41f043..c03f96cc 100644 --- a/src/main/java/com/bluedelivery/api/shop/RegisterMenuDto.java +++ b/src/main/java/com/bluedelivery/api/menu/RegisterMenuDto.java @@ -1,4 +1,4 @@ -package com.bluedelivery.api.shop; +package com.bluedelivery.api.menu; import static com.bluedelivery.domain.menu.Menu.*; diff --git a/src/main/java/com/bluedelivery/api/shop/adapter/MenuController.java b/src/main/java/com/bluedelivery/api/menu/adapter/MenuController.java similarity index 97% rename from src/main/java/com/bluedelivery/api/shop/adapter/MenuController.java rename to src/main/java/com/bluedelivery/api/menu/adapter/MenuController.java index 654d3a7e..be42a7c1 100644 --- a/src/main/java/com/bluedelivery/api/shop/adapter/MenuController.java +++ b/src/main/java/com/bluedelivery/api/menu/adapter/MenuController.java @@ -1,4 +1,4 @@ -package com.bluedelivery.api.shop.adapter; +package com.bluedelivery.api.menu.adapter; import static com.bluedelivery.common.response.HttpResponse.*; @@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import com.bluedelivery.api.shop.RegisterMenuDto; +import com.bluedelivery.api.menu.RegisterMenuDto; import com.bluedelivery.api.shop.UpdateMenuDto; import com.bluedelivery.application.shop.adapter.MenuService; import com.bluedelivery.common.response.HttpResponse; diff --git a/src/main/java/com/bluedelivery/api/shop/adapter/MenuGroupController.java b/src/main/java/com/bluedelivery/api/menu/adapter/MenuGroupController.java similarity index 97% rename from src/main/java/com/bluedelivery/api/shop/adapter/MenuGroupController.java rename to src/main/java/com/bluedelivery/api/menu/adapter/MenuGroupController.java index 37de14ea..cac64f02 100644 --- a/src/main/java/com/bluedelivery/api/shop/adapter/MenuGroupController.java +++ b/src/main/java/com/bluedelivery/api/menu/adapter/MenuGroupController.java @@ -1,4 +1,4 @@ -package com.bluedelivery.api.shop.adapter; +package com.bluedelivery.api.menu.adapter; import java.util.List; @@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import com.bluedelivery.api.shop.MenuGroupDto; +import com.bluedelivery.api.menu.MenuGroupDto; import com.bluedelivery.application.shop.adapter.MenuGroupService; import com.bluedelivery.common.response.ApiException; import com.bluedelivery.common.response.ErrorCode; diff --git a/src/main/java/com/bluedelivery/api/shop/adapter/MenuOptionControllerImpl.java b/src/main/java/com/bluedelivery/api/menu/adapter/MenuOptionControllerImpl.java similarity index 88% rename from src/main/java/com/bluedelivery/api/shop/adapter/MenuOptionControllerImpl.java rename to src/main/java/com/bluedelivery/api/menu/adapter/MenuOptionControllerImpl.java index 07383213..e41adf5a 100644 --- a/src/main/java/com/bluedelivery/api/shop/adapter/MenuOptionControllerImpl.java +++ b/src/main/java/com/bluedelivery/api/menu/adapter/MenuOptionControllerImpl.java @@ -1,4 +1,4 @@ -package com.bluedelivery.api.shop.adapter; +package com.bluedelivery.api.menu.adapter; import javax.validation.Valid; @@ -9,10 +9,11 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; -import com.bluedelivery.api.shop.MenuOptionController; -import com.bluedelivery.api.shop.MenuOptionDto; -import com.bluedelivery.api.shop.MenuOptionGroupDto; +import com.bluedelivery.api.menu.MenuOptionController; +import com.bluedelivery.api.menu.MenuOptionDto; +import com.bluedelivery.api.menu.MenuOptionGroupDto; import com.bluedelivery.application.shop.MenuOptionService; +import com.bluedelivery.application.shop.MenuOptionServiceImpl; import com.bluedelivery.common.response.HttpResponse; @RestController diff --git a/src/main/java/com/bluedelivery/application/shop/MenuOptionService.java b/src/main/java/com/bluedelivery/application/shop/MenuOptionService.java index 755091a2..e2119ff7 100644 --- a/src/main/java/com/bluedelivery/application/shop/MenuOptionService.java +++ b/src/main/java/com/bluedelivery/application/shop/MenuOptionService.java @@ -1,8 +1,8 @@ package com.bluedelivery.application.shop; -import com.bluedelivery.api.shop.MenuOptionDto; -import com.bluedelivery.api.shop.MenuOptionGroupDto; +import com.bluedelivery.api.menu.MenuOptionDto; +import com.bluedelivery.api.menu.MenuOptionGroupDto; public interface MenuOptionService { diff --git a/src/main/java/com/bluedelivery/api/shop/adapter/MenuOptionServiceImpl.java b/src/main/java/com/bluedelivery/application/shop/MenuOptionServiceImpl.java similarity index 88% rename from src/main/java/com/bluedelivery/api/shop/adapter/MenuOptionServiceImpl.java rename to src/main/java/com/bluedelivery/application/shop/MenuOptionServiceImpl.java index b71afc5b..b127210b 100644 --- a/src/main/java/com/bluedelivery/api/shop/adapter/MenuOptionServiceImpl.java +++ b/src/main/java/com/bluedelivery/application/shop/MenuOptionServiceImpl.java @@ -1,12 +1,11 @@ -package com.bluedelivery.api.shop.adapter; +package com.bluedelivery.application.shop; import java.util.Optional; import org.springframework.stereotype.Service; -import com.bluedelivery.api.shop.MenuOptionDto; -import com.bluedelivery.api.shop.MenuOptionGroupDto; -import com.bluedelivery.application.shop.MenuOptionService; +import com.bluedelivery.api.menu.MenuOptionDto; +import com.bluedelivery.api.menu.MenuOptionGroupDto; import com.bluedelivery.common.response.ApiException; import com.bluedelivery.common.response.ErrorCode; import com.bluedelivery.domain.menu.MenuOption; diff --git a/src/main/java/com/bluedelivery/application/shop/adapter/MenuGroupService.java b/src/main/java/com/bluedelivery/application/shop/adapter/MenuGroupService.java index 442478ad..ca514ee7 100644 --- a/src/main/java/com/bluedelivery/application/shop/adapter/MenuGroupService.java +++ b/src/main/java/com/bluedelivery/application/shop/adapter/MenuGroupService.java @@ -6,7 +6,7 @@ import org.springframework.dao.DuplicateKeyException; import org.springframework.stereotype.Service; -import com.bluedelivery.api.shop.MenuGroupDto; +import com.bluedelivery.api.menu.MenuGroupDto; import com.bluedelivery.domain.menu.MenuGroup; import com.bluedelivery.infra.shop.MenuGroupMapper; diff --git a/src/main/java/com/bluedelivery/application/shop/adapter/MenuService.java b/src/main/java/com/bluedelivery/application/shop/adapter/MenuService.java index 274e71c7..319c340e 100644 --- a/src/main/java/com/bluedelivery/application/shop/adapter/MenuService.java +++ b/src/main/java/com/bluedelivery/application/shop/adapter/MenuService.java @@ -5,7 +5,7 @@ import org.springframework.stereotype.Service; -import com.bluedelivery.api.shop.RegisterMenuDto; +import com.bluedelivery.api.menu.RegisterMenuDto; import com.bluedelivery.common.response.ApiException; import com.bluedelivery.domain.menu.Menu; import com.bluedelivery.infra.shop.MenuMapper; diff --git a/src/main/java/com/bluedelivery/infra/shop/MenuGroupMapper.java b/src/main/java/com/bluedelivery/infra/shop/MenuGroupMapper.java index 62a507ec..c9980adc 100644 --- a/src/main/java/com/bluedelivery/infra/shop/MenuGroupMapper.java +++ b/src/main/java/com/bluedelivery/infra/shop/MenuGroupMapper.java @@ -5,7 +5,7 @@ import org.apache.ibatis.annotations.Mapper; import org.springframework.stereotype.Repository; -import com.bluedelivery.api.shop.MenuGroupDto; +import com.bluedelivery.api.menu.MenuGroupDto; import com.bluedelivery.domain.menu.MenuGroup; diff --git a/src/main/resources/mybatis/mapper/MenuGroupMapper.xml b/src/main/resources/mybatis/mapper/MenuGroupMapper.xml index 21262bde..0ae5117a 100644 --- a/src/main/resources/mybatis/mapper/MenuGroupMapper.xml +++ b/src/main/resources/mybatis/mapper/MenuGroupMapper.xml @@ -2,22 +2,22 @@ - + - + - + - + INSERT INTO MENU_GROUP(SHOP_ID, NAME, CONTENT) VALUES (#{shopId}, #{name}, #{content}) diff --git a/src/test/java/com/bluedelivery/api/shop/MenuOptionControllerTest.java b/src/test/java/com/bluedelivery/api/menu/MenuOptionControllerTest.java similarity index 93% rename from src/test/java/com/bluedelivery/api/shop/MenuOptionControllerTest.java rename to src/test/java/com/bluedelivery/api/menu/MenuOptionControllerTest.java index 3a2918a8..09b3a7b0 100644 --- a/src/test/java/com/bluedelivery/api/shop/MenuOptionControllerTest.java +++ b/src/test/java/com/bluedelivery/api/menu/MenuOptionControllerTest.java @@ -1,4 +1,4 @@ -package com.bluedelivery.api.shop; +package com.bluedelivery.api.menu; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; @@ -11,9 +11,9 @@ import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MockMvc; -import com.bluedelivery.api.shop.adapter.MenuOptionControllerImpl; -import com.bluedelivery.api.shop.adapter.MenuOptionServiceImpl; +import com.bluedelivery.api.menu.adapter.MenuOptionControllerImpl; import com.bluedelivery.application.authentication.AuthenticationService; +import com.bluedelivery.application.shop.MenuOptionServiceImpl; import com.bluedelivery.domain.authentication.AuthenticationRepository; import com.bluedelivery.domain.menu.MenuOptionGroup; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/bluedelivery/application/shop/MenuGroupServiceTest.java b/src/test/java/com/bluedelivery/application/shop/MenuGroupServiceTest.java index 0dcdf94c..c168bc12 100644 --- a/src/test/java/com/bluedelivery/application/shop/MenuGroupServiceTest.java +++ b/src/test/java/com/bluedelivery/application/shop/MenuGroupServiceTest.java @@ -11,7 +11,7 @@ import org.mockito.junit.jupiter.MockitoExtension; import org.springframework.test.context.ActiveProfiles; -import com.bluedelivery.api.shop.MenuGroupDto; +import com.bluedelivery.api.menu.MenuGroupDto; import com.bluedelivery.application.shop.adapter.MenuGroupService; import com.bluedelivery.infra.shop.MenuGroupMapper; diff --git a/src/test/java/com/bluedelivery/application/shop/MenuOptionServiceTest.java b/src/test/java/com/bluedelivery/application/shop/MenuOptionServiceTest.java index 6c041243..06ffa175 100644 --- a/src/test/java/com/bluedelivery/application/shop/MenuOptionServiceTest.java +++ b/src/test/java/com/bluedelivery/application/shop/MenuOptionServiceTest.java @@ -14,9 +14,8 @@ import org.mockito.junit.jupiter.MockitoExtension; import org.springframework.test.context.ActiveProfiles; -import com.bluedelivery.api.shop.MenuOptionDto; -import com.bluedelivery.api.shop.MenuOptionGroupDto; -import com.bluedelivery.api.shop.adapter.MenuOptionServiceImpl; +import com.bluedelivery.api.menu.MenuOptionDto; +import com.bluedelivery.api.menu.MenuOptionGroupDto; import com.bluedelivery.domain.menu.MenuOption; import com.bluedelivery.domain.menu.MenuOptionGroup; import com.bluedelivery.domain.menu.MenuOptionGroupRepository; diff --git a/src/test/java/com/bluedelivery/application/shop/MenuServiceTest.java b/src/test/java/com/bluedelivery/application/shop/MenuServiceTest.java index 0fe8f5b7..bb4f6e45 100644 --- a/src/test/java/com/bluedelivery/application/shop/MenuServiceTest.java +++ b/src/test/java/com/bluedelivery/application/shop/MenuServiceTest.java @@ -14,7 +14,7 @@ import org.mockito.junit.jupiter.MockitoExtension; import org.springframework.test.context.ActiveProfiles; -import com.bluedelivery.api.shop.RegisterMenuDto; +import com.bluedelivery.api.menu.RegisterMenuDto; import com.bluedelivery.application.shop.adapter.MenuService; import com.bluedelivery.common.response.ApiException; import com.bluedelivery.common.response.ErrorCode; From ffdc818f2cd4d82d90c1c82cf666e3a331524be7 Mon Sep 17 00:00:00 2001 From: soongjamm Date: Tue, 27 Jul 2021 20:01:50 +0900 Subject: [PATCH 15/18] category adapter package --- .../{ => adapter}/CategoryManagerControllerImpl.java | 5 ++++- .../api/category/CategoryManagerControllerImplTest.java | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) rename src/main/java/com/bluedelivery/api/category/{ => adapter}/CategoryManagerControllerImpl.java (91%) diff --git a/src/main/java/com/bluedelivery/api/category/CategoryManagerControllerImpl.java b/src/main/java/com/bluedelivery/api/category/adapter/CategoryManagerControllerImpl.java similarity index 91% rename from src/main/java/com/bluedelivery/api/category/CategoryManagerControllerImpl.java rename to src/main/java/com/bluedelivery/api/category/adapter/CategoryManagerControllerImpl.java index e09652fd..b12d97dc 100644 --- a/src/main/java/com/bluedelivery/api/category/CategoryManagerControllerImpl.java +++ b/src/main/java/com/bluedelivery/api/category/adapter/CategoryManagerControllerImpl.java @@ -1,4 +1,4 @@ -package com.bluedelivery.api.category; +package com.bluedelivery.api.category.adapter; import static com.bluedelivery.common.response.HttpResponse.response; @@ -9,6 +9,9 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; +import com.bluedelivery.api.category.CategoryManagerController; +import com.bluedelivery.api.category.CreateCategoryRequest; +import com.bluedelivery.api.category.EditCategoryRequest; import com.bluedelivery.application.category.CategoryManagerService; import com.bluedelivery.application.category.CategoryNotFoundException; import com.bluedelivery.common.response.ApiException; diff --git a/src/test/java/com/bluedelivery/api/category/CategoryManagerControllerImplTest.java b/src/test/java/com/bluedelivery/api/category/CategoryManagerControllerImplTest.java index 20da1dd1..be8a0158 100644 --- a/src/test/java/com/bluedelivery/api/category/CategoryManagerControllerImplTest.java +++ b/src/test/java/com/bluedelivery/api/category/CategoryManagerControllerImplTest.java @@ -21,6 +21,7 @@ import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import com.bluedelivery.api.category.adapter.CategoryManagerControllerImpl; import com.bluedelivery.application.category.CategoryManagerService; import com.bluedelivery.common.config.GlobalExceptionHandler; import com.bluedelivery.domain.category.Category; From 15cdaecb01ab0b1374b4ccf5ebe7dcce71c39234 Mon Sep 17 00:00:00 2001 From: soongjamm Date: Wed, 28 Jul 2021 16:29:59 +0900 Subject: [PATCH 16/18] =?UTF-8?q?#101=20@AuthenticationRequired=20+=20Argu?= =?UTF-8?q?mentResolver=20=EC=9D=B4=EB=A9=B4=20redis=EB=A5=BC=202=EB=B2=88?= =?UTF-8?q?=20=EC=A1=B0=ED=9A=8C=ED=95=98=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20?= =?UTF-8?q?(#102)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 한 요청내에서 @AuthenticationRequired로 인증객체를 한번 조회하면 ThreadLocal에 저장하여 재사용 * ThreadLocal을 검사하도록 수정 --- .../AuthenticatedUserArgumentResolver.java | 3 +++ .../authentication/AuthenticationHolder.java | 19 +++++++++++++++++++ .../authentication/UserAuthInterceptor.java | 12 ++---------- .../domain/authentication/Authentication.java | 13 +++++++++++++ 4 files changed, 37 insertions(+), 10 deletions(-) create mode 100644 src/main/java/com/bluedelivery/api/authentication/AuthenticationHolder.java diff --git a/src/main/java/com/bluedelivery/api/authentication/AuthenticatedUserArgumentResolver.java b/src/main/java/com/bluedelivery/api/authentication/AuthenticatedUserArgumentResolver.java index 9cdabbc3..a80e174e 100644 --- a/src/main/java/com/bluedelivery/api/authentication/AuthenticatedUserArgumentResolver.java +++ b/src/main/java/com/bluedelivery/api/authentication/AuthenticatedUserArgumentResolver.java @@ -35,6 +35,9 @@ public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) { + if (AuthenticationHolder.hasAuthentication()) { + return AuthenticationHolder.getAuthentication(); + } HttpServletRequest req = (HttpServletRequest) webRequest.getNativeRequest(); Optional optional = authenticationService.getAuthentication(req.getHeader(AUTHORIZATION)); if (optional.isPresent()) { diff --git a/src/main/java/com/bluedelivery/api/authentication/AuthenticationHolder.java b/src/main/java/com/bluedelivery/api/authentication/AuthenticationHolder.java new file mode 100644 index 00000000..5e5cb2ab --- /dev/null +++ b/src/main/java/com/bluedelivery/api/authentication/AuthenticationHolder.java @@ -0,0 +1,19 @@ +package com.bluedelivery.api.authentication; + +import com.bluedelivery.domain.authentication.Authentication; + +public class AuthenticationHolder { + private static ThreadLocal authentication = new ThreadLocal<>(); + + public static boolean hasAuthentication() { + return authentication.get() != null; + } + + public static Authentication getAuthentication() { + return authentication.get(); + } + + public static void setAuthentication(Authentication auth) { + authentication.set(auth); + } +} diff --git a/src/main/java/com/bluedelivery/api/authentication/UserAuthInterceptor.java b/src/main/java/com/bluedelivery/api/authentication/UserAuthInterceptor.java index 2eb516ce..bdebcaf9 100644 --- a/src/main/java/com/bluedelivery/api/authentication/UserAuthInterceptor.java +++ b/src/main/java/com/bluedelivery/api/authentication/UserAuthInterceptor.java @@ -9,7 +9,6 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.springframework.core.annotation.AnnotationUtils; import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.HandlerMapping; @@ -27,20 +26,13 @@ public class UserAuthInterceptor implements HandlerInterceptor { @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) { - if (needToBeAuthenticated((HandlerMethod) handler)) { + if (Authentication.isAnnotated(((HandlerMethod) handler).getMethod())) { Authentication auth = authenticationService.getAuthentication(request.getHeader(AUTHORIZATION)) .orElseThrow(() -> new ApiException(INVALID_AUTHENTICATION)); if (!isSameUser(request, auth) || auth.isInvalidated()) { throw new ApiException(NOT_AUTHORIZED_ACCESS); } - } - return true; - } - - private boolean needToBeAuthenticated(HandlerMethod handler) { - if (AnnotationUtils.findAnnotation(handler.getMethod(), AuthenticationRequired.class) == null - && AnnotationUtils.findAnnotation(handler.getBeanType(), AuthenticationRequired.class) == null) { - return false; + AuthenticationHolder.setAuthentication(auth); } return true; } diff --git a/src/main/java/com/bluedelivery/domain/authentication/Authentication.java b/src/main/java/com/bluedelivery/domain/authentication/Authentication.java index 5e3a9f89..acf52b07 100644 --- a/src/main/java/com/bluedelivery/domain/authentication/Authentication.java +++ b/src/main/java/com/bluedelivery/domain/authentication/Authentication.java @@ -1,10 +1,15 @@ package com.bluedelivery.domain.authentication; import java.io.Serializable; +import java.lang.reflect.Method; import java.time.Duration; import java.time.Instant; import java.util.Objects; +import org.springframework.core.annotation.AnnotationUtils; + +import com.bluedelivery.api.authentication.AuthenticationRequired; + public class Authentication implements Serializable { public static String AUTH_STR = "auth"; private String token; @@ -21,6 +26,14 @@ public Authentication(String token, Long userId) { this.userId = userId; } + public static boolean isAnnotated(Method method) { + if (AnnotationUtils.findAnnotation(method, AuthenticationRequired.class) == null + && AnnotationUtils.findAnnotation(method.getDeclaringClass(), AuthenticationRequired.class) == null) { + return false; + } + return true; + } + public void invalidate() { this.invalidated = true; } From 5af193a21531abd6e8861775e1a43cd8458bd527 Mon Sep 17 00:00:00 2001 From: soongjamm Date: Wed, 28 Jul 2021 19:54:16 +0900 Subject: [PATCH 17/18] =?UTF-8?q?swagger=20=EC=9D=98=EC=A1=B4=EC=84=B1,=20?= =?UTF-8?q?=EA=B8=B0=EB=B3=B8=20=EC=84=A4=EC=A0=95=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 4 ++ .../authentication/UserAuthInterceptor.java | 4 ++ .../api/user/UserManagementController.java | 10 ++++- .../common/config/Swagger2Config.java | 43 +++++++++++++++++++ 4 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/bluedelivery/common/config/Swagger2Config.java diff --git a/build.gradle b/build.gradle index 018ff463..7a459d62 100644 --- a/build.gradle +++ b/build.gradle @@ -42,6 +42,10 @@ dependencies { implementation 'com.github.ben-manes.caffeine:caffeine:3.0.2' // caffeine cache implementation 'net.time4j:time4j-base:5.7' // time4j 음력->양력 변환을 위해 사용 + // swagger + implementation group: 'io.springfox', name: 'springfox-swagger2', version: '2.9.2' + implementation group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.9.2' + // lombok compileOnly 'org.projectlombok:lombok:1.18.20' annotationProcessor 'org.projectlombok:lombok:1.18.20' diff --git a/src/main/java/com/bluedelivery/api/authentication/UserAuthInterceptor.java b/src/main/java/com/bluedelivery/api/authentication/UserAuthInterceptor.java index bdebcaf9..0affb25e 100644 --- a/src/main/java/com/bluedelivery/api/authentication/UserAuthInterceptor.java +++ b/src/main/java/com/bluedelivery/api/authentication/UserAuthInterceptor.java @@ -26,6 +26,10 @@ public class UserAuthInterceptor implements HandlerInterceptor { @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) { + if (!(handler instanceof HandlerMethod)) { + return true; + } + if (Authentication.isAnnotated(((HandlerMethod) handler).getMethod())) { Authentication auth = authenticationService.getAuthentication(request.getHeader(AUTHORIZATION)) .orElseThrow(() -> new ApiException(INVALID_AUTHENTICATION)); diff --git a/src/main/java/com/bluedelivery/api/user/UserManagementController.java b/src/main/java/com/bluedelivery/api/user/UserManagementController.java index 43e722a6..5f6c569d 100644 --- a/src/main/java/com/bluedelivery/api/user/UserManagementController.java +++ b/src/main/java/com/bluedelivery/api/user/UserManagementController.java @@ -19,8 +19,9 @@ @RequestMapping("/users") -@AuthenticationRequired public interface UserManagementController { + + @AuthenticationRequired @GetMapping("/") ResponseEntity> getLoggedInUser(Authentication user); @@ -32,12 +33,14 @@ public interface UserManagementController { * @param request * @return 요청 성공시 204 NO_CONTENT */ + @AuthenticationRequired @DeleteMapping("/{id}") ResponseEntity deleteAccount(@PathVariable("id") Long id, @Valid @RequestBody DeleteAccountRequest deleteRequest, HttpServletRequest request); - + + @AuthenticationRequired @PatchMapping("/{id}") ResponseEntity> updateAccount(@PathVariable Long id, @Valid @RequestBody UpdateAccountRequest updateRequest, @@ -50,6 +53,7 @@ ResponseEntity> updateAccount(@PathVariable Long id, * @param addressParam 주소 정보 * @return */ + @AuthenticationRequired @PostMapping("/{id}/addresses") ResponseEntity> addAddress(@PathVariable("id") Long id, @Valid @RequestBody AddAddressRequest addressParam); @@ -61,6 +65,7 @@ ResponseEntity> addAddress(@PathVariable("id") Long id, * @param addressId 주소 정보 * @return */ + @AuthenticationRequired @PostMapping("/{id}/addresses/main/{addrId}") ResponseEntity> setMainAddress(@PathVariable("id") Long id, @PathVariable("addrId") Long addressId); @@ -71,6 +76,7 @@ ResponseEntity> addAddress(@PathVariable("id") Long id, * @param addressId 주소 정보 * @return */ + @AuthenticationRequired @DeleteMapping("/{id}/addresses/{addrId}") ResponseEntity removeAddress(@PathVariable("id") Long id, @PathVariable("addrId") Long addressId); diff --git a/src/main/java/com/bluedelivery/common/config/Swagger2Config.java b/src/main/java/com/bluedelivery/common/config/Swagger2Config.java new file mode 100644 index 00000000..5029574e --- /dev/null +++ b/src/main/java/com/bluedelivery/common/config/Swagger2Config.java @@ -0,0 +1,43 @@ +package com.bluedelivery.common.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import com.google.common.net.HttpHeaders; + +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.ParameterBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.Parameter; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +@EnableSwagger2 +@Configuration +public class Swagger2Config { + private static final String API_NAME = "Blue-Delivery API"; + private static final String API_VERSION = "0.0.1"; + private static final String API_DESCRIPTION = "API 명세서"; + + @Bean + public Docket api() { + return new Docket(DocumentationType.SWAGGER_2) + .apiInfo(apiInfo()) + .select() + .apis(RequestHandlerSelectors.any()) + .paths(PathSelectors.any()) + .build(); + } + + public ApiInfo apiInfo() { + return new ApiInfoBuilder() + .title(API_NAME) + .version(API_VERSION) + .description(API_DESCRIPTION) + .build(); + } + +} From f38fc43af5be1622fa0985088dddf0727cb34c19 Mon Sep 17 00:00:00 2001 From: soongjamm Date: Wed, 28 Jul 2021 20:09:28 +0900 Subject: [PATCH 18/18] =?UTF-8?q?Swagger=20-=20Profile=EC=9D=B4=20'prod'?= =?UTF-8?q?=EA=B0=80=20=EC=95=84=EB=8B=8C=20=EA=B2=BD=EC=9A=B0=EC=97=90?= =?UTF-8?q?=EB=A7=8C=20=EB=8F=99=EC=9E=91=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/bluedelivery/common/config/Swagger2Config.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/bluedelivery/common/config/Swagger2Config.java b/src/main/java/com/bluedelivery/common/config/Swagger2Config.java index 5029574e..7a64095a 100644 --- a/src/main/java/com/bluedelivery/common/config/Swagger2Config.java +++ b/src/main/java/com/bluedelivery/common/config/Swagger2Config.java @@ -2,6 +2,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; import com.google.common.net.HttpHeaders; @@ -17,6 +18,7 @@ @EnableSwagger2 @Configuration +@Profile("!prod") public class Swagger2Config { private static final String API_NAME = "Blue-Delivery API"; private static final String API_VERSION = "0.0.1";