package com.sptg.device.biz.service;

import com.baomidou.mybatisplus.service.IService;
import com.sptg.common.core.entity.PublishTaskResult;
import com.sptg.device.api.entity.TimeStrategyTaskDeviceDetails;

/**
 * title: TimeStrategyTaskDeviceDetailsServiceInterface
 * package: com.sptg.device.biz.security
 * description:时间策略任务设备详细-服务层接口
 *
 *                
 *                
 */
public interface TimeStrategyTaskDeviceDetailsServiceInterface extends IService<TimeStrategyTaskDeviceDetails> {

    /**
     * 保存
     * @param taskResult 任务运行结果
     */
    default void insert(PublishTaskResult taskResult){
        TimeStrategyTaskDeviceDetails details = new TimeStrategyTaskDeviceDetails();
        details.setTaskId(taskResult.getTaskId());
        details.setDeviceId(taskResult.getDeviceId());
        details.setDeviceName(taskResult.getDeviceName());
        details.setSerialNumber(taskResult.getSerialNumber());
        details.setInstallPath(taskResult.getInstallPath());
        details.setXqName(taskResult.getXqName());
        details.setDyName(taskResult.getDyName());
        details.setPushStatus(taskResult.getPushStatus());
        details.setRemark(taskResult.getRemark());
        this.insert(details);
    }
}
