package com.bonus.canteen.core.device.android.common.vo;

import io.swagger.annotations.ApiModelProperty;

import java.time.Instant;

public class DeviceMQOnlineConfigDto {
   @ApiModelProperty("设备Sn")
   public String deviceSn;
   @ApiModelProperty("设备在线状态")
   public Integer onlineState;
   @ApiModelProperty("消息生成时间只在mqtt推送时使用，其余场景忽略")
   private Long time;

   public Long getTime() {
      return Instant.now().toEpochMilli();
   }

   public String getDeviceSn() {
      return this.deviceSn;
   }

   public Integer getOnlineState() {
      return this.onlineState;
   }

   public DeviceMQOnlineConfigDto setDeviceSn(final String deviceSn) {
      this.deviceSn = deviceSn;
      return this;
   }

   public DeviceMQOnlineConfigDto setOnlineState(final Integer onlineState) {
      this.onlineState = onlineState;
      return this;
   }

   public DeviceMQOnlineConfigDto setTime(final Long time) {
      this.time = time;
      return this;
   }

}
