package com.bonus.canteen.core.menu.vo;

import com.bonus.canteen.core.common.enums.AllocMealtimeTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Optional;

@ApiModel("安卓菜谱详情")
public class AndroidRecipeDetailVO {
   @ApiModelProperty("菜谱详情id")
   private Long detailId;
   @ApiModelProperty("餐次id")
   private Long intervalId;
   @ApiModelProperty("更新时间")
   private LocalDateTime uptime;
   @ApiModelProperty("餐次名称")
   private String intervalName;
   @ApiModelProperty("餐次类型")
   private Integer intervalType;
   @ApiModelProperty("优先级")
   private Integer priorityLevel;
   @ApiModelProperty("分类列表")
   private List<AndroidRecipeTypeVO> typeList;

   public Integer getPriorityLevel() {
      return (Integer)Optional.ofNullable(this.priorityLevel).orElse(999);
   }

   public String getIntervalName() {
      return AllocMealtimeTypeEnum.getDescByKey(this.intervalType);
   }

   public Long getDetailId() {
      return this.detailId;
   }

   public Long getIntervalId() {
      return this.intervalId;
   }

   public LocalDateTime getUptime() {
      return this.uptime;
   }

   public Integer getIntervalType() {
      return this.intervalType;
   }

   public List<AndroidRecipeTypeVO> getTypeList() {
      return this.typeList;
   }

   public void setDetailId(final Long detailId) {
      this.detailId = detailId;
   }

   public void setIntervalId(final Long intervalId) {
      this.intervalId = intervalId;
   }

   public void setUptime(final LocalDateTime uptime) {
      this.uptime = uptime;
   }

   public void setIntervalName(final String intervalName) {
      this.intervalName = intervalName;
   }

   public void setIntervalType(final Integer intervalType) {
      this.intervalType = intervalType;
   }

   public void setPriorityLevel(final Integer priorityLevel) {
      this.priorityLevel = priorityLevel;
   }

   public void setTypeList(final List<AndroidRecipeTypeVO> typeList) {
      this.typeList = typeList;
   }

}
