package com.ruoyi.ccdi.project.service.impl;

import com.ruoyi.ccdi.project.domain.event.CcdiProjectHistoryImportSubmittedEvent;
import com.ruoyi.ccdi.project.service.ICcdiProjectHistoryImportService;
import jakarta.annotation.Resource;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

/**
 * 历史项目导入事件监听器
 */
@Component
public class CcdiProjectHistoryImportEventListener {

    @Resource
    private ICcdiProjectHistoryImportService historyImportService;

    @EventListener
    public void onSubmitted(CcdiProjectHistoryImportSubmittedEvent event) {
        historyImportService.submitImport(
            event.getTargetProjectId(),
            event.getTargetLsfxProjectId(),
            event.getDto(),
            event.getOperator()
        );
    }
}
