package cn.reghao.devops.web.ws.event;

import cn.reghao.jutil.jdk.event.message.Event;
import cn.reghao.jutil.jdk.event.handler.Handler;
import cn.reghao.devops.common.msg.event.EvtAgentStart;
import org.springframework.stereotype.Service;

/**
 * @author reghao
 * @date 2022-05-05 17:26:47
 */
@Service
public class EvtAgentStartHandler extends Handler {
    private final MachineEventService machineEventService;

    public EvtAgentStartHandler(MachineEventService machineEventService) {
        this.machineEventService = machineEventService;
    }

    @Override
    public void handle(Event evt) {
        EvtAgentStart machineDetail = (EvtAgentStart) evt;
        machineEventService.start(machineDetail);
    }
}
