package com.zbkj.common.request;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zbkj.common.vo.HomeItemVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Transient;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="HomeRequest对象", description="HomeRequest对象")
public class HomeRequest implements Serializable {

    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "id")
    private Integer id;

    @ApiModelProperty(value = "名称")
    private String name;

    @ApiModelProperty(value = "标题")
    private String title;

    @ApiModelProperty(value = "图片")
    private String imgUrl;

    @ApiModelProperty(value = "跳转类型 0默认值，1商品详情，2分类列表，3商品列表，4活动栏目")
    private Integer jumpType;

    @ApiModelProperty(value = "跳转路径")
    private String jumpUrl;

    @ApiModelProperty(value = "跳转参数（pId，cIds，pIds，hId）")
    private String jumpIds;

    @ApiModelProperty(value = "展示渠道:【1首页楼层，2随心配套餐层，3首页精品推荐】")
    private String channel;

    @ApiModelProperty(value = "业务：channel=2分类id")
    private Integer business;

    @ApiModelProperty(value = "排序")
    private Integer orderNo;

    @ApiModelProperty(value = "开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date beginTime;

    @ApiModelProperty(value = "结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;

    @Transient
    @TableField(exist = false)
    private List<HomeItemVo> items;

}
