package com.test.bijihoudaun.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 io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.Date;

@Data
@Schema(name = "图片实体")
@TableName("`image`")
public class Image {
    @Schema(description = "图片id",implementation = Long.class)
    @TableId(type = IdType.AUTO)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long id;
    
    @Schema(description = " 外键，关联Markdown文件ID，标识图片所属文档",implementation = Long.class  )
    @TableField("markdown_id")
    private Long markdownId;

    @Schema(description = "原始文件名（用户上传时的文件名）",implementation = String.class  )
    @TableField("original_name")
    private String originalName;

    @Schema(description = "存储文件名（系统生成的唯一文件名）",implementation = String.class  )
    @TableField("stored_name")
    private String storedName;

    @Schema(description = " 图片访问URL",implementation = String.class  )
    @TableField("`url`")
    private String url;
    
    @Schema(description = "图片大小（字节）",implementation = Long.class  )
    @TableField("`size`")
    private Long size;

    @Schema(description = "图片MIME类型（如image/jpeg）",implementation = String.class  )
    @TableField("content_type")
    private String contentType;

    @Schema(description = "图片上传时间",implementation = Date.class  )
    @TableField("created_at")
    private Date createdAt;
}