更新 蓝鲸字库接口 批量视频文件入参模型

This commit is contained in:
小肥羊 2025-06-24 16:18:23 +08:00
parent d12839be20
commit d36fb2fc9f
10 changed files with 85 additions and 43 deletions

View File

@ -118,7 +118,7 @@ namespace VideoAnalysisCore.AICore.GPT.DeepSeek
/// 获取内容对应的章节
/// </summary>
/// <returns></returns>
private async Task<string?> GetSections(VideoTask taskInfo, int course_Id)
private async Task<string?> GetSections(VideoTask taskInfo, long course_Id)
{
if (!string.IsNullOrEmpty(taskInfo.Sections))
return taskInfo.Sections;
@ -160,7 +160,7 @@ namespace VideoAnalysisCore.AICore.GPT.DeepSeek
/// 检查AI切片结果质量
/// </summary>
/// <returns></returns>
private async Task<CheckMessageDto> VerifySpanQuality(VideoKnowRes[] questionRes, VideoTask taskInfo, TotalCaptionsDto captions, string sections, int course_Id)
private async Task<CheckMessageDto> VerifySpanQuality(VideoKnowRes[] questionRes, VideoTask taskInfo, TotalCaptionsDto captions, string sections, long course_Id)
{
//校验结果质量
var thems = questionRes.Adapt<VideoKnowQueryDto[]>().ToJson();
@ -527,17 +527,7 @@ namespace VideoAnalysisCore.AICore.GPT.DeepSeek
.Where(s => s.Id == taskId)
.FirstAsync();
var subject = taskInfo.Subject.ToString();
var Course_Id = 27;
switch (taskInfo.Type)//处理不同任务类型的知识点树
{
case TaskTypeEnum._中职视频分段:
Course_Id = 51;
break;
case TaskTypeEnum._视频分段:
default:
Course_Id = 27;
break;
}
var Course_Id = taskInfo.CourseId;
switch (taskInfo?.VideoType)
{
case AttachmentsInfoType.:
@ -624,17 +614,7 @@ namespace VideoAnalysisCore.AICore.GPT.DeepSeek
if (taskInfo.VideoType != AttachmentsInfoType.)
return;
var subject = taskInfo.Subject.ToString();
var Course_Id = 27;
switch (taskInfo.Type)//处理不同任务类型的知识点树
{
case TaskTypeEnum._中职视频分段:
Course_Id = 51;
break;
case TaskTypeEnum._视频分段:
default:
Course_Id = 27;
break;
}
var Course_Id = taskInfo.CourseId;
var captionsArr = JsonSerializer.Deserialize<SenseVoiceRes[]>(taskInfo.Captions);
//处理视频授课章节

View File

@ -132,11 +132,10 @@ namespace VideoAnalysisCore.Common
var fileUrl = taskInfo.MediaUrl;
if (string.IsNullOrEmpty(fileUrl))
{
switch (taskInfo.Type)
switch (taskInfo.VideoType)
{
case TaskTypeEnum._视频分段:
case TaskTypeEnum._中职视频分段:
case AttachmentsInfoType.:
case AttachmentsInfoType.:
var videoInfo = await vodClient.GetPlayInfoAsync(new AlibabaCloud.SDK.Vod20170321.Models.GetPlayInfoRequest()
{
VideoId = taskInfo.TagId,
@ -148,8 +147,6 @@ namespace VideoAnalysisCore.Common
throw new Exception($"{DateTime.Now} 视频订阅=>获取阿里云视频信息失败 VideoCode {taskInfo.TagId} StatusCode {videoInfo?.StatusCode}");
fileUrl = videoInfo.Body.PlayInfoList.PlayInfo.First().PlayURL;
break;
case TaskTypeEnum._视频分析:
break;
default:
break;
}

View File

@ -172,7 +172,7 @@ namespace VideoAnalysisCore.Controllers
ComeFrom = GetClientIpAddress(),
MediaUrl = req.MediaUrl,
ApiToken = req.ApiToken,
Type = req.Type,
CourseId = req.CourseId,
Subject = req.Subject,
Tag = req.Tag,
TagId = req.TagId,

View File

@ -57,7 +57,8 @@ namespace VideoAnalysisCore.Controllers.Dto
public long AttachmentId { get; set; }
/// <summary>
/// 需要返回给我的参数
/// 视频阿里云id
/// <para>需要返回给我的参数</para>
/// </summary>
public string VideoCode { get; set; }
/// <summary>
@ -68,8 +69,8 @@ namespace VideoAnalysisCore.Controllers.Dto
/// <summary>
/// 任务类型
/// </summary>
[Required(ErrorMessage = "任务类型是必填项")]
public TaskTypeEnum TaskType { get; set; }
//[Required(ErrorMessage = "任务类型是必填项")]
//public TaskTypeEnum TaskType { get; set; }
/// <summary>
/// 课程类型 0=新课 3=复习 4= 活动 5=班会 7=其他资料
@ -105,7 +106,20 @@ namespace VideoAnalysisCore.Controllers.Dto
/// <para>用于查找视频下对应的PPT资源</para>
/// </summary>
public long ContentId { get; set; }
/// <summary>
/// 学科网的课程id
/// </summary>
public long CourseId { get; set; }
/// <summary>
/// 学科网的教材版本Id
/// </summary>
public long TextBookVersionId { get; set; }
/// <summary>
/// 教育阶段
/// </summary>
public EducationStageEnum StageId { get; set; }
}
/// <summary>
/// 视频处理 请求
@ -149,7 +163,7 @@ namespace VideoAnalysisCore.Controllers.Dto
/// <summary>
/// 任务类型
/// </summary>
public TaskTypeEnum? Type { get; set; }
public long CourseId { get; set; }
/// <summary>
/// 视频类型
/// </summary>

View File

@ -69,7 +69,8 @@ namespace VideoAnalysisCore.Controllers
VideoCode = s.VideoCode,
MaterialId = s.MaterialId,
AttachmentId = s.AttachmentId,
TaskType = s.TaskType,
Stage = s.StageId,
CourseId = s.CourseId,
SubjectType = s.SubjectId,
VideoUrl =s.VideoUrl,
CourseType = s.CourseType,
@ -86,7 +87,8 @@ namespace VideoAnalysisCore.Controllers
Id = YitIdHelper.NextId(),
ComeFrom = GetClientIpAddress(),
ApiToken = "",
Type = s.TaskType,
EducationStage = s.StageId,
CourseId = s.CourseId,
Subject = s.SubjectId,
TagId = s.VideoCode,
MediaUrl =s.VideoUrl,

View File

@ -87,7 +87,7 @@ namespace VideoAnalysisCore.Job
Id = YitIdHelper.NextId(),
ComeFrom = "127.0.0.1",
ApiToken = "",
Type = item.TaskType,
//Type = item.TaskType,
Subject = item.Subject,
Tag = item.NodeId.ToString(),
TagId = s.VideoCode,

View File

@ -7,6 +7,9 @@ using System.Threading.Tasks;
namespace VideoAnalysisCore.Model.Enum
{
/// <summary>
/// 蓝鲸智库 视频类型枚举
/// </summary>
public enum VideoType
{
PPT课件 = 1,

View File

@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VideoAnalysisCore.Model.Enum
{
/// <summary>
/// 教育阶段枚举
/// </summary>
public enum EducationStageEnum
{
/// <summary>
/// 学前
/// </summary>
= 1,
/// <summary>
/// 小学
/// </summary>
= 2,
/// <summary>
/// 初中
/// </summary>
= 3,
/// <summary>
/// 高中
/// </summary>
= 4,
/// <summary>
/// 大学
/// </summary>
= 5,
/// <summary>
/// 中职
/// </summary>
= 6
}
}

View File

@ -48,9 +48,13 @@ namespace VideoAnalysisCore.Model
public SubjectEnum SubjectType { get; set; }
/// <summary>
/// 任务类型
/// 教育阶段
/// </summary>
public TaskTypeEnum TaskType { get; set; }
public EducationStageEnum Stage { get; set; }
/// <summary>
/// 学科网的课程id
/// </summary>
public long CourseId { get; set; }
/// <summary>
/// 完成时间
/// </summary>

View File

@ -50,10 +50,13 @@ namespace VideoAnalysisCore.Model
[SugarColumn( IsNullable = true)]
public SubjectEnum? Subject { get; set; }
/// <summary>
/// 任务类型
/// 学科网的课程id
/// </summary>
[SugarColumn(IsNullable = true)]
public TaskTypeEnum? Type { get; set; }
public long CourseId { get; set; }
/// <summary>
/// 教育阶段
/// </summary>
public EducationStageEnum EducationStage { get; set; }
/// <summary>
/// 视频类型
/// <para>常规,教研,PPT...</para>