package com.zksy.pole.factory.impl;

import com.zksy.pole.domain.po.DgLampControlledHeartbeat;
import com.zksy.pole.domain.po.DgRelayControl;
import com.zksy.pole.factory.IHandleCmd;
import com.zksy.pole.mapper.DgLampControlledHeartbeatMapper;
import com.zksy.pole.mapper.DgRelayControlMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class HandleDgRelayControlCmd implements IHandleCmd {
    @Autowired
    private DgRelayControlMapper dgRelayControlMapper;
    @Override
    public <T> String HandleCmdMethod(T data) {
        try {
            DgRelayControl d = (DgRelayControl) data;
            dgRelayControlMapper.insert(d);
            return null;
        } catch (Exception e) {
            log.error("DgRelayControl数据插入失败");
            return null;
        }
    }
}