package com.sz.admin.monitor.pojo.po;

import com.fasterxml.jackson.databind.JsonNode;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import com.mybatisflex.core.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mybatisflex.core.handler.JacksonTypeHandler;
import com.sz.mysql.EntityChangeListener;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 算法任务实体类
 */
@Data
@Table(value = "ry_algorithm_task",onInsert = EntityChangeListener.class, onUpdate = EntityChangeListener.class)
@Schema(description = "算法任务实体类")
public class AlgorithmTask implements Serializable {


    @Serial
    private static final long serialVersionUID = 1L;
    /**
     * 主键
     */
    @Id(keyType = KeyType.Auto)
    private Long id;

    /**
     * 摄像机id
     */
    private Long cameraId;

    /**
     *  访问第三方服务器的url
     */
    private String url;

    /**
     * 任务编号
     */
    private String algTaskSession;

    /**
     * 摄像头名称
     */
    private String mediaName;

    /**
     * 任务描述
     */
    private String taskDesc;

    /**
     * 算法列表
     */
    @Column(typeHandler = JacksonTypeHandler.class)
    private List<Integer> algInfo;

    /**
     * 算法参数(json格式)
     */
    @Column(typeHandler = JacksonTypeHandler.class)
    private JsonNode userData;

    /**
     * 逻辑删除标识：0-正常，1-已删除
     */
    @Column(isLogicDelete = true)
    @Schema(description = "是否删除")
    private String isDeleted;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
}