public DeviceHisListViewModel GetDeviceHisData(string token, string deviceSn, string account) { DeviceHisListViewModel dolvm = new DeviceHisListViewModel(); List <DeviceHisDataModel> dom = new DeviceHisRepository().FindDeviceHis(token, deviceSn);//.FindAllDeviceHis(token); foreach (var item in dom) { DeviceHisViewModel dovm = new DeviceHisViewModel() { DeviceSn = item.Device.DeviceSn, Dt = item.Dt, DataContent = item.DataContent, DataTitle = item.DataTitle, Token = item.Token, Id = item.Id }; dolvm.list.Add(dovm); } dolvm.Success = true; dolvm.Message = "获取设备历史数据成功"; return(dolvm); }
public DeviceHisService() { _dhr = new DeviceHisRepository(); }