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);
|
}*/
|
}
|