package com.competition.modules.ugc.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.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@TableName(value = "t_ugc_work", autoResultMap = true)
@Schema(description = "UGC作品实体")
public class UgcWork implements Serializable {

    @Schema(description = "主键ID")
    @TableId(type = IdType.AUTO)
    private Long id;

    @Schema(description = "用户ID")
    @TableField("user_id")
    private Long userId;

    @Schema(description = "乐读派远程作品ID")
    @TableField("remote_work_id")
    private String remoteWorkId;

    @Schema(description = "作品标题")
    private String title;

    @Schema(description = "封面图URL")
    @TableField("cover_url")
    private String coverUrl;

    @Schema(description = "作品描述")
    private String description;

    @Schema(description = "可见范围")
    private String visibility;

    @Schema(description = "作品状态：-1=FAILED, 0=DRAFT, 1=PENDING, 2=PROCESSING, 3=COMPLETED, 4=CATALOGED, 5=DUBBED")
    private Integer status;

    @Schema(description = "审核备注")
    @TableField("review_note")
    private String reviewNote;

    @Schema(description = "审核时间")
    @TableField("review_time")
    private LocalDateTime reviewTime;

    @Schema(description = "审核人ID")
    @TableField("reviewer_id")
    private Long reviewerId;

    @Schema(description = "机审结果")
    @TableField("machine_review_result")
    private String machineReviewResult;

    @Schema(description = "机审备注")
    @TableField("machine_review_note")
    private String machineReviewNote;

    @Schema(description = "是否推荐")
    @TableField("is_recommended")
    private Boolean isRecommended;

    @Schema(description = "浏览数")
    @TableField("view_count")
    private Integer viewCount;

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

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

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

    @Schema(description = "分享数")
    @TableField("share_count")
    private Integer shareCount;

    @Schema(description = "原图URL")
    @TableField("original_image_url")
    private String originalImageUrl;

    @Schema(description = "语音输入URL")
    @TableField("voice_input_url")
    private String voiceInputUrl;

    @Schema(description = "文本输入")
    @TableField("text_input")
    private String textInput;

    @Schema(description = "AI元数据（JSON）")
    @TableField(value = "ai_meta", typeHandler = JacksonTypeHandler.class)
    private Object aiMeta;

    @Schema(description = "AI创作进度百分比")
    private Integer progress;

    @Schema(description = "进度描述")
    @TableField("progress_message")
    private String progressMessage;

    @Schema(description = "创作风格")
    private String style;

    @Schema(description = "作者")
    @TableField("author_name")
    private String authorName;

    @Schema(description = "失败原因")
    @TableField("fail_reason")
    private String failReason;

    @Schema(description = "发布时间")
    @TableField("publish_time")
    private LocalDateTime publishTime;

    @Schema(description = "是否删除：0-未删除，1-已删除")
    @TableField("is_deleted")
    private Integer isDeleted;

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

    @Schema(description = "修改时间")
    @TableField("modify_time")
    private LocalDateTime modifyTime;
}
