package com.zhentao.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

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

/**
 * 动态实体
 */
@Data
@TableName("user_dynamics")
public class Dynamic implements Serializable {
    
    private static final long serialVersionUID = 1L;
    
    @TableId(value = "dynamic_id", type = IdType.AUTO)
    private Integer dynamicId;
    
    private Integer userId;
    @TableField(exist = false)
    private String userNickname;
    private String content;
    private String mediaUrls;
    private Integer likeCount;
    private Integer commentCount;
    private Integer auditStatus;
    
    @TableField("created_at")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    
    @TableField("updated_at")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    /**
     * 是否被举报（非表字段，用于列表标记）
     */
    @TableField(exist = false)
    private Boolean isReported;

    /**
     * 封面图（非表字段，取 mediaUrls 的第一张）
     */
    @TableField(exist = false)
    private String coverUrl;

    /**
     * 举报截图（非表字段，从举报表获取）
     */
    @TableField(exist = false)
    private String screenshots;
}

