package com.imdroid.sec_exapi.entity;

import com.imdroid.secapi.dto.GnssStatus;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class DeviceQueryResponse extends BasicResponse{
    static class Device{
        String deviceId;//设备编号
        String pointName;//测点名称
        String updateTime;
        Short state = 1;//0离线，1在线

        public Device(String deviceId, String pointName, String updateTime, Short state){
            this.deviceId = deviceId;
            this.pointName = pointName;
            this.updateTime = updateTime;
            if(state==GnssStatus.STATE_OFFLINE) this.state = GnssStatus.STATE_OFFLINE;
            else this.state = GnssStatus.STATE_ACTIVE;
        }
    }

    List<Device> data=new ArrayList<>();
    public void addDevice(String deviceId, String pointName, String updateTime, Short state){
        data.add(new Device(deviceId, pointName, updateTime,state));
    }
}
