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;
import com.baomidou.mybatisplus.annotation.TableField;

/**
 * 动态实体
 */
@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;
    
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("created_at")
    private LocalDateTime createTime;
    
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("updated_at")
    private LocalDateTime updateTime;

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

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

