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

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

@Schema(description = "移动端 - 帖子 Response VO")
@Data
public class PostRespVO {

    @Schema(description = "帖子ID", example = "1")
    private Long id;

    @Schema(description = "用户ID", example = "1")
    private Long userId;

    @Schema(description = "用户昵称", example = "张三")
    private String userNickname;

    @Schema(description = "用户头像", example = "https://example.com/avatar.jpg")
    private String userAvatar;

    @Schema(description = "标题", example = "标题")
    private String title;

    @Schema(description = "内容", example = "内容")
    private String content;

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

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

    @Schema(description = "浏览数", example = "100")
    private Integer viewCount;

    @Schema(description = "点赞数", example = "10")
    private Integer likeCount;

    @Schema(description = "评论数", example = "5")
    private Integer commentCount;

    @Schema(description = "收藏数", example = "3")
    private Integer collectCount;

    @Schema(description = "状态：1-正常，2-删除，3-审核中", example = "1")
    private Integer status;

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

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

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

    @Schema(description = "是否已点赞", example = "false")
    private Boolean isLiked;

    @Schema(description = "是否已收藏", example = "false")
    private Boolean isCollected;

    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    @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;
    }

}

