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