package com.xindazhou.business.controller.app.community.post.vo;

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;

@Schema(description = "移动端 - 创建帖子 Request VO")
@Data
public class PostCreateReqVO {

    @Schema(description = "标题", requiredMode = Schema.RequiredMode.REQUIRED, example = "标题")
    @NotBlank(message = "标题不能为空")
    private String title;

    @Schema(description = "内容（纯文本和图文混合类型必填）", example = "内容")
    private String content;

    @Schema(description = "内容类型：1-纯文本，2-图片，3-视频，4-图文混合", example = "1")
    @NotNull(message = "内容类型不能为空")
    private Integer contentType;

    @Schema(description = "媒体列表（图片/视频）")
    private List<PostMediaVO> mediaList;

    @Schema(description = "标签，逗号分隔", example = "Java,Spring")
    private String tags;

    @Schema(description = "媒体VO")
    @Data
    public static class PostMediaVO {
        @Schema(description = "媒体类型：1-图片，2-视频", example = "1")
        private Integer mediaType;

        @Schema(description = "媒体URL", example = "https://example.com/image.jpg")
        private String mediaUrl;

        @Schema(description = "视频封面URL（仅视频类型）", example = "https://example.com/cover.jpg")
        private String coverUrl;

        @Schema(description = "视频时长（秒，仅视频类型）", example = "60")
        private Integer duration;

        @Schema(description = "文件大小（字节）", example = "1024000")
        private Long fileSize;

        @Schema(description = "排序", example = "0")
        private Integer sort;
    }

}

