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.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

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

@ApiModel("下发菜谱")
public class IssueRecipeCompressVO implements Serializable {
   @ApiModelProperty("菜谱id")
   private Long recipeId;
   @ApiModelProperty("菜谱类型")
   private Integer recipeType;
   @JsonFormat(
      pattern = "yyyy-MM-dd HH:mm:ss",
      timezone = "GMT+8"
   )
   @JsonSerialize(
      using = LocalDateTimeSerializer.class
   )
   @JsonDeserialize(
      using = LocalDateTimeDeserializer.class
   )
   @ApiModelProperty("菜谱更新时间")
   private LocalDateTime uptime;
   @ApiModelProperty("每日菜谱详情")
   private List<IssueRecipeDateCompressVO> dateList;
   @ApiModelProperty("所有菜品列表")
   private List<IssueRecipeMealCompressVO> mealList;

   public Long getRecipeId() {
      return this.recipeId;
   }

   public Integer getRecipeType() {
      return this.recipeType;
   }

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

   public List<IssueRecipeDateCompressVO> getDateList() {
      return this.dateList;
   }

   public List<IssueRecipeMealCompressVO> getMealList() {
      return this.mealList;
   }

   public void setRecipeId(final Long recipeId) {
      this.recipeId = recipeId;
   }

   public void setRecipeType(final Integer recipeType) {
      this.recipeType = recipeType;
   }

   @JsonFormat(
      pattern = "yyyy-MM-dd HH:mm:ss",
      timezone = "GMT+8"
   )
   @JsonDeserialize(
      using = LocalDateTimeDeserializer.class
   )
   public void setUptime(final LocalDateTime uptime) {
      this.uptime = uptime;
   }

   public void setDateList(final List<IssueRecipeDateCompressVO> dateList) {
      this.dateList = dateList;
   }

   public void setMealList(final List<IssueRecipeMealCompressVO> mealList) {
      this.mealList = mealList;
   }

}
