zepengdev
2025-06-04 e8109eee3549d43fc4de2fe4286e29a4152f824d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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);
    }*/
}