package com.luojia_channel.modules.post.dto.resp;

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

import java.time.LocalDateTime;

@Data
@Schema(description = "帖子基本信息")
public class PostBasicInfoDTO {
    @Schema(
            description = "帖子ID"
    )
    private Long id;

    @Schema(
            description = "帖子封面图"
    )
    private String image;

    @Schema(
            description = "帖子标题",
            required = true,
            minLength = 3,
            maxLength = 16,
            example = "帖子标题三个字"
    )
    private String title;

    @Schema(
            description = "帖子摘要，显示帖子内容的前20个字"
    )
    private String summary;

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

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

    @Schema(
            description = "收藏数"
    )
    private Integer favoriteCount;

    @Schema(
            description = "帖子浏览数"
    )
    private Integer viewCount;

    @Schema(
            description = "是否点赞,1-已点赞，0-未点赞",
            allowableValues = {"0", "1"},
            example = "1",
            implementation = Boolean.class
    )
    private Boolean isLike;

    @Schema(
            description = "对应的用户ID"
    )
    private Long userId;

    // 对于匿名的帖子，下述字段进行了处理，如匿名默认名称，头像
    @Schema(
            description = "匿名情况下用户名"
    )
    private String userName;
    @Schema(
            description = "匿名情况下用户头像"
    )
    private String userAvatar;
    @Schema(
            description = "帖子创建时间"
    )

    private Long categoryId;

    private LocalDateTime createTime;
}
