*/ protected array $storageServices = [ CategoryImageService::class, ProductImageService::class, ProductReviewService::class, ProductReviewImageService::class, ]; /** * Repository 인터페이스와 구현체 매핑 * * @var array */ protected array $repositories = [ BrandRepositoryInterface::class => BrandRepository::class, CartRepositoryInterface::class => CartRepository::class, CategoryRepositoryInterface::class => CategoryRepository::class, CategoryImageRepositoryInterface::class => CategoryImageRepository::class, CouponIssueRepositoryInterface::class => CouponIssueRepository::class, CouponRepositoryInterface::class => CouponRepository::class, EcommerceStatRepositoryInterface::class => EcommerceStatRepository::class, ExtraFeeTemplateRepositoryInterface::class => ExtraFeeTemplateRepository::class, OrderCancelRepositoryInterface::class => OrderCancelRepository::class, OrderCancelOptionRepositoryInterface::class => OrderCancelOptionRepository::class, OrderOptionRepositoryInterface::class => OrderOptionRepository::class, OrderRefundRepositoryInterface::class => OrderRefundRepository::class, OrderRefundOptionRepositoryInterface::class => OrderRefundOptionRepository::class, OrderRepositoryInterface::class => OrderRepository::class, OrderShippingRepositoryInterface::class => OrderShippingRepository::class, ProductInquiryRepositoryInterface::class => ProductInquiryRepository::class, ProductLogRepositoryInterface::class => ProductLogRepository::class, ProductRepositoryInterface::class => ProductRepository::class, ProductImageRepositoryInterface::class => ProductImageRepository::class, ProductCommonInfoRepositoryInterface::class => ProductCommonInfoRepository::class, ProductLabelRepositoryInterface::class => ProductLabelRepository::class, ProductNoticeTemplateRepositoryInterface::class => ProductNoticeTemplateRepository::class, ProductOptionRepositoryInterface::class => ProductOptionRepository::class, ProductAdditionalOptionValueRepositoryInterface::class => ProductAdditionalOptionValueRepository::class, ProductReviewRepositoryInterface::class => ProductReviewRepository::class, ProductReviewImageRepositoryInterface::class => ProductReviewImageRepository::class, ClaimReasonRepositoryInterface::class => ClaimReasonRepository::class, SearchPresetRepositoryInterface::class => SearchPresetRepository::class, SequenceRepositoryInterface::class => SequenceRepository::class, ShippingCarrierRepositoryInterface::class => ShippingCarrierRepository::class, ShippingPolicyRepositoryInterface::class => ShippingPolicyRepository::class, ShippingTypeRepositoryInterface::class => ShippingTypeRepository::class, TempOrderRepositoryInterface::class => TempOrderRepository::class, ProductWishlistRepositoryInterface::class => ProductWishlistRepository::class, UserAddressRepositoryInterface::class => UserAddressRepository::class, EcommerceUserProfileRepositoryInterface::class => EcommerceUserProfileRepository::class, MileageTransactionRepositoryInterface::class => MileageTransactionRepository::class, MileageBalanceRepositoryInterface::class => MileageBalanceRepository::class, ]; /** * 등록할 Artisan 커맨드 목록 * * @var array */ protected array $commands = [ AggregateEcommerceStatsCommand::class, CancelPendingPaymentOrdersCommand::class, EarnMileageCommand::class, ExpireMileageCommand::class, NotifyExpiringMileageCommand::class, PruneExpiredCartsCommand::class, ReconcileMileageBalanceCommand::class, ]; /** * 서비스 등록 */ public function register(): void { parent::register(); // CurrencyConversionService를 싱글톤으로 등록 (요청 내 통화 설정 캐시 유지) $this->app->singleton(CurrencyConversionService::class); // ShippingPolicyResolver를 싱글톤으로 등록 (요청 내 기본 배송정책 조회 1회 캐시) $this->app->singleton(ShippingPolicyResolver::class); // PaymentMethodResolver를 싱글톤으로 등록 (요청 내 결제수단 카탈로그 조회 1회 캐시) $this->app->singleton(PaymentMethodResolver::class); } /** * 서비스 부트스트랩 */ public function boot(): void { parent::boot(); // Artisan 커맨드 등록 if ($this->app->runningInConsole()) { $this->commands($this->commands); } // 요청 기기 유형(iOS) 감지 미들웨어(DetectDevice)는 코어 self-gate 방식으로 이관됨. // Module::getMiddleware() 가 targets=['/'](무명 User SSR 셸 URI 패턴)로 선언하고, // 코어 ExtensionMiddlewareGate 가 요청 시점에 실행한다. (SP Kernel 직접 조작 제거) // Sitemap 기여자 등록 $this->app->booted(function () { if ($this->app->bound(SitemapGenerator::class)) { // Repository 주입을 위해 컨테이너로 해석합니다. $this->app->make(SitemapGenerator::class)->registerContributor( $this->app->make(EcommerceSitemapContributor::class) ); } }); } }