package com.yaoai.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@TableName("ai_tasks")
public class AiTask {

    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    private Long tenantId;
    private Long projectId;
    private Long episodeId;
    private Long storyboardId;

    /** image_to_video / text_to_video / ref_image_to_video / structured_video */
    private String taskType;

    private String externalTaskId;

    /** pending / submitted / running / succeeded / failed */
    private String status;

    /** 旧版单图任务的输入；新结构化任务为 null */
    private String inputImageKey;

    /** 最终提交给 Seedance 的完整 Prompt（含 @图N），新旧任务通用 */
    private String prompt;

    private String resultVideoUrl;
    private String resultTosKey;
    private String errorMessage;

    /** 结构化视频生成字段（V14 起，task_type=structured_video 时使用） */
    private String characterImageKey;
    /** V16 起：多角色出镜，JSON 数组字符串，优先于旧 characterImageKey */
    private String characterImageKeys;
    private String sceneImageKey;
    /** JSON 数组字符串，运行时用 ObjectMapper 序列化/反序列化 */
    private String propImageKeys;
    private String styleImageKey;
    /** 用户原始结构化输入（JSON 字符串），与 prompt 字段配对存证 */
    private String userPrompt;
    private Integer videoDuration;
    private String videoRatio;
    private Boolean generateAudio;

    private LocalDateTime createdAt;
    private LocalDateTime updatedAt;
}
