package vip.xiaonuo.coldchain.modular.app.service;

/**
 * @author jackzhou
 * @version 1.0
 * @project jfcloud-coldchain
 * @description
 * @date 2024/11/17 22:30:41
 */

import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import vip.xiaonuo.coldchain.core.bean.influxdb.SensorData;
import vip.xiaonuo.coldchain.modular.app.param.AppDeviceQueryParams;
import vip.xiaonuo.coldchain.modular.app.param.SensorEchartDataResult;
import vip.xiaonuo.coldchain.modular.monitordevice.service.MonitorDeviceService;

@Service
@RequiredArgsConstructor
public class SimsService {
    private final MonitorDeviceService monitorDeviceService;
    private final AppDeviceService appDeviceService;

    public SensorData status(String deviceCode, Integer roads) {
        return monitorDeviceService.queryLatestDataByDeviceIdAndRoads(deviceCode, roads);
    }

    public SensorEchartDataResult queryDataByDeviceIdAndRoads(AppDeviceQueryParams appDeviceQueryParams) {
        return appDeviceService.queryDataByDeviceIdAndRoads(appDeviceQueryParams);
    }
}
