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

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.time.LocalDate;
import java.util.List;

@ApiModel("下发菜谱")
public class IssueRecipeDateCompressVO implements Serializable {
   @ApiModelProperty("启用日期")
   @JsonFormat(
      pattern = "yyyy-MM-dd"
   )
   @JsonSerialize(
      using = LocalDateSerializer.class
   )
   @JsonDeserialize(
      using = LocalDateDeserializer.class
   )
   private LocalDate applyDate;
   @ApiModelProperty("餐次列表")
   private List<IssueRecipeIntervalCompressVO> intervalList;

   public LocalDate getApplyDate() {
      return this.applyDate;
   }

   public List<IssueRecipeIntervalCompressVO> getIntervalList() {
      return this.intervalList;
   }

   @JsonFormat(
      pattern = "yyyy-MM-dd"
   )
   @JsonDeserialize(
      using = LocalDateDeserializer.class
   )
   public void setApplyDate(final LocalDate applyDate) {
      this.applyDate = applyDate;
   }

   public void setIntervalList(final List<IssueRecipeIntervalCompressVO> intervalList) {
      this.intervalList = intervalList;
   }
}
