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

import com.backendsys.config.Mybatis.handler.timezone.LocalDateTimeAdapter;
import com.backendsys.entity.validator.RangeArray;
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.google.gson.annotations.JsonAdapter;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.time.LocalDateTime;

@TableName("ai_volcengine_video_collect")
@Data
public class VolcengineVideoCollect {

    public static interface Collect{}

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

    private Long user_id;

    private Long task_id;

    @NotNull(message = "任务明细id不能为空", groups = { Collect.class })
    private Long task_detail_id;

    @JsonAdapter(LocalDateTimeAdapter.class)
    private LocalDateTime create_time;

    @TableField(exist = false)
    @NotNull(message = "收藏状态不能为空", groups = { Collect.class })
    @RangeArray(message="收藏状态取值有误，范围应是(-1取消收藏, 1加入收藏)", value = {"-1", "1"}, groups = { Collect.class })
    private Integer is_collect;

}
