package com.gyee.frame.service.websocket.task;

import com.gyee.frame.common.websocket.WebsocketMessageService;
import com.gyee.frame.service.websocket.AgcService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@Component
public class AgcPushTask {
    @Resource
    private AgcService agcService;
    @Resource
    private WebsocketMessageService websocketMessageService;

    public void agcPush(String destination) throws Exception {

        Map<String, Object> map=new HashMap<>();

        Map<String, Object> jcsjmap=agcService.getAgcVals();
        Map<String, Object> tbmap=agcService.getAgcLine();

        map.put("jcsj",jcsjmap);
        map.put("tb",tbmap);
        websocketMessageService.SendAlertToAll(destination,map);
    }
}
