package com.backendsys.modules.ai.media.entity;

import cn.hutool.json.JSONObject;
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 jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;

import java.util.List;

@Data
@TableName("ai_media_ttv")
public class MediaTtv {

    public static interface Query{}
    public static interface Generate{}

    @TableId(type = IdType.AUTO)
    private Long id;
    private Long user_id;
    @NotEmpty(message = "标题不能为空", groups = { Generate.class })
    @Size(max = 50, message = "标题长度不超过 {max} 字符", groups = { Generate.class })
    private String title;
    @NotEmpty(message = "job_id 不能为空", groups = { Query.class })
    private String job_id;
    private Integer job_status;     // 任务状态 (0任务排队中，1任务完成，3任务执行中)
    @TableField(exist = false)
    private String job_status_label;
    @TableField(exist = false)
    private Float job_progress = 0f;     // 任务进度 (1=100%)

    private String video_origin_url;
    private String video_url;
    private String object_key;

    @TableField(exist = false)
    @NotEmpty(message = "source 不能为空", groups = { Generate.class })
    private List<MediaTtvSource> source;
    @TableField(exist = false)
    @NotNull(message = "config 不能为空", groups = { Generate.class })
    private MediaTtvConfig config;

    private String request_params;
    @TableField(exist = false)
    private JSONObject request_params_json;
    private String response_params;
    @TableField(exist = false)
    private JSONObject response_params_json;
    private String create_time;
    private String update_time;

}
