From d93356927d8a0a5a91963c28d461d9107562d759 Mon Sep 17 00:00:00 2001 From: xin <1099200748@qq.com> Date: Fri, 30 May 2025 17:38:26 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/xin' --- oying-system/src/main/java/com/oying/modules/pc/store/service/StoreCreationCoordinator.java | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/oying-system/src/main/java/com/oying/modules/pc/store/service/StoreCreationCoordinator.java b/oying-system/src/main/java/com/oying/modules/pc/store/service/StoreCreationCoordinator.java new file mode 100644 index 0000000..df486f6 --- /dev/null +++ b/oying-system/src/main/java/com/oying/modules/pc/store/service/StoreCreationCoordinator.java @@ -0,0 +1,31 @@ +package com.oying.modules.pc.store.service; + +import com.oying.modules.pc.store.domain.dto.StoreCreateRequest; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +@Service +@RequiredArgsConstructor +public class StoreCreationCoordinator { + + private final StoreService storeService; + private final StoreQualificationService qualificationService; + + // 核心方法:支持可选 qualification + /*@Transactional + public StoreFullDTO createFullStore(StoreCreateRequest request) { + // 1. 必选操作:store + location + staff + Store store = storeService.create(request.getStore()); + StoreLocation location = locationService.create(store.getId(), request.getLocation()); + StoreStaff staff = staffService.create(store.getId(), request.getStaff()); + + // 2. 可选操作:qualification(根据请求决定) + StoreQualification qualification = null; + if (request.hasQualification()) { + qualification = qualificationService.create(store.getId(), request.getQualification()); + } + + // 3. 返回聚合结果 + return new StoreFullDTO(store, location, staff, qualification); + }*/ +} -- Gitblit v1.9.3