package com.ruoyi.generator.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.generator.domain.Community.CommunityArticleImages;
import com.ruoyi.generator.domain.Community.CommunityTag;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
* 
* @TableName community_article
*/
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "ArticleEntity", description = "文章实体")
public class CommunityArticleVo extends BaseEntity implements Serializable {

    /**
    * 文章id
    */
    @NotNull(message="[文章id]不能为空")
    @ApiModelProperty("文章id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;
    /**
    * 创建人id
    */
    @NotNull(message="[创建人id]不能为空")
    @ApiModelProperty("创建人id")
    private Long userId;
    /**
    * 文章标题
    */
    @NotBlank(message="[文章标题]不能为空")
    @Size(max= 255,message="编码长度不能超过255")
    @Length(max= 255,message="编码长度不能超过255")
    @ApiModelProperty("文章标题")
    private String title;
    /**
    * 文章内容
    */
    @ApiModelProperty("文章内容")
    private String content;

    @ApiModelProperty("是否已点赞")
    private boolean isLike;

    @ApiModelProperty("点赞个数")
    private int likeCount;

    @ApiModelProperty("是否已推荐")
    private boolean isRecommend;

    @ApiModelProperty("推荐个数")
    private int recommendCount;

    @ApiModelProperty("收藏个数")
    private int collectCount;

    @ApiModelProperty("是否允许评论")
    private boolean isComment;

    @ApiModelProperty("是否已收藏")
    private boolean isCollect;

    @ApiModelProperty("用户名")
    private String userName;

    @ApiModelProperty("昵称")
    private String nickName;

    @ApiModelProperty("邮箱地址")
    private String email;

    @ApiModelProperty("头像地址")
    private String avatar;

    @ApiModelProperty("浏览量")
    private String pageViews;

//    @ApiModelProperty("用户信息")
//    private List<SysUser> sysUsers;

    @ApiModelProperty("文章图片集合")
    @TableField("imageList")
    private List<Map<String, Object>> imageList;

    /**
     * 圈子id
     */
    @ApiModelProperty("圈子信息")
    @JsonSerialize(using = ToStringSerializer.class)
    private List<Long> circleIds;

    @ApiModelProperty("文章视频集合")
    @TableField(exist = false)
    private List<CommunityArticleImages> videoList;

    @ApiModelProperty("文章评论信息")
    @TableField("comments")
    private List<Map<String, Object>> comments;

    @ApiModelProperty("评论数量")
    @TableField("comments")
    private Integer commentCount;

    @ApiModelProperty("文章标签")
    private List<CommunityTag> tags;
}
