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

import cn.hutool.core.util.ObjectUtil;
import com.bonus.canteen.core.allocation.canteen.enums.AllocCanteenTreeTypeEnum;
import io.swagger.annotations.ApiModelProperty;

import java.time.Instant;

public class MQIntervalConfigVO {
   @ApiModelProperty("-1商户  2食堂  3档口")
   private Integer level;
   @ApiModelProperty("食堂ID")
   private Long canteenId;
   @ApiModelProperty("店铺档口id")
   private Long shopstallId;
   @ApiModelProperty("消息生成时间")
   private Long time;

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

   public Integer getLevel() {
      return ObjectUtil.isEmpty(this.canteenId) ? AllocCanteenTreeTypeEnum.MERCHANT.getKey() : (ObjectUtil.isEmpty(this.shopstallId) ? AllocCanteenTreeTypeEnum.CANTEEN.getKey() : AllocCanteenTreeTypeEnum.STALL.getKey());
   }

   public Long getCanteenId() {
      return this.canteenId;
   }

   public Long getShopstallId() {
      return this.shopstallId;
   }

   public MQIntervalConfigVO setLevel(final Integer level) {
      this.level = level;
      return this;
   }

   public MQIntervalConfigVO setCanteenId(final Long canteenId) {
      this.canteenId = canteenId;
      return this;
   }

   public MQIntervalConfigVO setShopstallId(final Long shopstallId) {
      this.shopstallId = shopstallId;
      return this;
   }

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

}
