using SqlSugar;
using System.ComponentModel.DataAnnotations;
using System.Net;
using System.Text.Json;
using UserCenter.Model.Enum;
using VideoAnalysisCore.AICore.GPT.Dto;
using VideoAnalysisCore.AICore.SherpaOnnx;
using VideoAnalysisCore.Model.Enum;
using VideoAnalysisCore.Model.Interface;
using Whisper.net;
namespace VideoAnalysisCore.Model
{
///
/// 视频任务模型
///
[SugarTable("videotask")]
public class VideoTask: IDB
{
///
/// 任务id
/// 视频音频文件地址都使用taskID能获取
///
[SugarColumn(IsPrimaryKey = true)]
public long Id { get; set; }
///
/// 媒体路径
///
public string MediaUrl { get; set; } = string.Empty;
///
/// 媒体文件名称
///
public string MediaName { get; set; } = string.Empty;
///
/// 下载后本地媒体目录
///
public string LocalMediaPath { get; set; } = string.Empty;
///
/// 上一次执行的枚举
///
public RedisChannelEnum LastEnum { get; set; }
///
/// ApiKey
///
public string ApiToken { get; set; } = string.Empty;
///
/// 请求来自哪个ip地址
///
public string ComeFrom { get; set; } = string.Empty;
///
/// 视频学科, null视为无学科
///
[SugarColumn( IsNullable = true)]
public SubjectEnum? Subject { get; set; }
///
/// 任务类型
///
[SugarColumn(IsNullable = true)]
public TaskTypeEnum? Type { get; set; }
///
/// 自定义值 任务完成后附带通知
///
[SugarColumn(Length = 500, IsNullable = true)]
public string? Tag { get; set; }
///
/// 自定义值Id
///
[SugarColumn(Length = 50, ColumnDataType = "varchar", IsNullable =true)]
public string? TagId { get; set; }
///
/// 授课视频对应PPT视频ID
///
[SugarColumn(Length = 255, ColumnDataType = "varchar", IsNullable = true)]
public string? PPTVideoCode { get; set; }
///
/// 授课视频对应PPT视频关键帧
///
[SugarColumn(ColumnDataType = "longtext",IsNullable = true)]
public string? PPTKeyFrame { get; set; }
///
/// 字幕缓存
///
[SugarColumn(ColumnName = "Captions", ColumnDataType = "longtext", IsNullable = true)]
public string Captions { get; set; } = "[]";
///
/// 说话人日志解析缓存
///
[SugarColumn(ColumnName = "Speaker", ColumnDataType = "longtext", IsNullable = true)]
public string Speaker { get; set; } = "[]";
///
/// Chat模型分析缓存
///
[SugarColumn(ColumnName = "ChatAnalysis", ColumnDataType = "longtext", IsNullable = true)]
public string ChatAnalysis { get; set; } = "{}";
///
/// AI模型评分
///
[SugarColumn(IsNullable =true)]
public decimal? ChatAnalysisScore { get; set; }
///
/// 消耗token
///
public int TotalTokens { get; set; }
///
/// 错误信息
///
[SugarColumn(ColumnDataType = "text", IsNullable = true)]
public string? ErrorMessage { get; set; }
///
/// 创建时间
///
public DateTime CreateTime { get; set; } = DateTime.Now;
///
/// 任务结束时间
///
[SugarColumn( IsNullable = true)]
public DateTime? EndTime { get; set; }
///
/// 授课章节
///
[SugarColumn(IsNullable = true)]
public string? Sections { get; set; }
}
}