package com.bonus.canteen.core.android.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 lombok.Data;
import lombok.Getter;
import lombok.ToString;

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

/**
 * @author 19814
 */
@Data
@ApiModel("下发菜谱")
@ToString
public class CookRecipeCompressVO 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<CookRecipeDateCompressVO> dateList;
   @ApiModelProperty("所有菜品列表")
   private List<CookRecipeMealCompressVO> mealList;

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

}
