package com.sooka.sponest.data.housingconstruction.handler; import com.sooka.sponest.data.housingconstruction.domain.eventEntity.SensorEventVo; import com.sooka.sponest.data.housingconstruction.feignClient.service.RemoteHousingconstructionEventService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class SendEvent { @Autowired private RemoteHousingconstructionEventService eventService; public void sendEvent(String template, String eventName, String threshold, String current, SensorEventVo eventVo, String eventCode){ String format = String.format(template, eventName, threshold, current); System.out.println("format ====> " + format); eventVo.setEventTypeXl(eventCode); eventVo.setEventDescription(format); //发送事件 eventService.sendEvent(eventVo); } }