package com.zbkj.common.request;

import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zbkj.common.model.game.GameTreeItem;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

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

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

    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "分类id", required = true)
    @NotBlank(message = "请选择分类")
    private String cid;

    @ApiModelProperty(value = "标题", required = true)
    @NotBlank(message = "请填写标题")
    @Length(max = 200, message = "标题最多200个字符")
    private String name;

    @ApiModelProperty(value = "封面图片", required = true)
    @NotBlank(message = "请上传封面图片")
    @Length(max = 255, message = "图片最多255个字符")
    private String image;

    @ApiModelProperty(value = "简介")
    @Length(max = 200, message = "简介最多200个字符")
    private String description;

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

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

    /**
     * 如果是 抽奖游戏，参照 eb_game_prize_draw_rule 字段提交生成json对象数据
     * 如果是 种树游戏，参照 eb_game_tree_rule 字段提交生成json对象数据
     */
    @ApiModelProperty(value = "规则表单", required = true)
    @NotBlank(message = "请填写规则表单内容")
    private String rule;

    /**
     * 如果是 抽奖游戏，参照 eb_game_prize_draw_item 字段提交生成json对象数组数据
     * 如果是 种树游戏，参照 eb_game_user_item 字段提交生成json对象数组数据
     */
    @ApiModelProperty(value = "游戏商品表单")
    @NotBlank(message = "请填写游戏商品表单内容")
    private String items;

}
