package cn.meowrain.aioj.backend.blogservice.dto.req;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.util.List;

/**
 * 文章更新请求DTO
 *
 * @author AIOJ
 */
@Data
@Schema(description = "文章更新请求")
public class ArticleUpdateRequestDTO {

    @NotNull(message = "文章ID不能为空")
    @Schema(description = "文章ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    private Long id;

    @NotBlank(message = "文章标题不能为空")
    @Schema(description = "文章标题", requiredMode = Schema.RequiredMode.REQUIRED, example = "Spring Boot 3.5.7 新特性详解（更新版）")
    private String title;

    @Schema(description = "文章别名（URL友好标识）", example = "spring-boot-3-5-7-features")
    private String slug;

    @Schema(description = "文章摘要", example = "本文详细介绍Spring Boot 3.5.7版本的新特性...")
    private String summary;

    @NotBlank(message = "文章内容不能为空")
    @Schema(description = "文章内容（Markdown格式）", requiredMode = Schema.RequiredMode.REQUIRED)
    private String content;

    @Schema(description = "封面图片URL", example = "https://example.com/images/cover.jpg")
    private String coverImage;

    @NotNull(message = "分类ID不能为空")
    @Schema(description = "分类ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    private Long categoryId;

    @Schema(description = "标签ID列表", example = "[1, 2, 3]")
    private List<Long> tagIds;

    @Schema(description = "是否置顶", example = "0")
    private Integer isTop;

    @Schema(description = "是否精华", example = "0")
    private Integer isEssence;

    @Schema(description = "是否发布（1=发布，0=草稿）", example = "1")
    private Integer isPublished;
}
