diff --git a/VideoAnalysis/AntDeploy.json b/VideoAnalysis/AntDeploy.json new file mode 100644 index 0000000..738458a --- /dev/null +++ b/VideoAnalysis/AntDeploy.json @@ -0,0 +1,116 @@ +{ + "Env": [ + { + "Name": "10楼刀片机", + "ServerList": [], + "LinuxServerList": [ + { + "UserName": "hy", + "Pwd": "E9D1AC136FDD59740A9595ABD0EB953A", + "Host": "192.168.2.21:10107", + "NickName": "", + "IIsFireUrl": null, + "DockerFireUrl": "", + "WindowsServiceFireUrl": null, + "LinuxServiceFireUrl": null + } + ], + "IgnoreList": [], + "WindowsBackUpIgnoreList": [] + } + ], + "IIsConfig": { + "SdkType": null, + "WebSiteName": "", + "LastEnvName": null, + "EnvPairList": [ + { + "EnvName": "10楼刀片机", + "ConfigName": "", + "LinuxEnvParam": null, + "DockerPort": null, + "DockerEnvName": null, + "DockerVolume": null, + "DockerOther": null + } + ] + }, + "WindowsServiveConfig": { + "ServiceName": "", + "SdkType": null, + "LastEnvName": null, + "EnvPairList": [ + { + "EnvName": "10楼刀片机", + "ConfigName": "", + "LinuxEnvParam": null, + "DockerPort": null, + "DockerEnvName": null, + "DockerVolume": null, + "DockerOther": null + } + ] + }, + "LinuxServiveConfig": { + "ServiceName": "", + "EnvParam": "", + "LastEnvName": null, + "EnvPairList": [ + { + "EnvName": "10楼刀片机", + "ConfigName": "", + "LinuxEnvParam": null, + "DockerPort": null, + "DockerEnvName": null, + "DockerVolume": null, + "DockerOther": null + } + ] + }, + "DockerConfig": { + "Prot": "9040", + "AspNetCoreEnv": "", + "LastEnvName": "10楼刀片机", + "RemoveDaysFromPublished": "10", + "WorkDir": "", + "Volume": "/home/hy/VideoAnalysis/AICore:/app/AICore/_Static;/home/hy//VideoAnalysis/TaskCachedFile:/app/TaskCachedFile", + "Other": "", + "EnvPairList": [ + { + "EnvName": "10楼刀片机", + "ConfigName": null, + "LinuxEnvParam": null, + "DockerPort": "9040", + "DockerEnvName": "", + "DockerVolume": "/home/hy/VideoAnalysis/AICore:/app/AICore/_Static;/home/hy//VideoAnalysis/TaskCachedFile:/app/TaskCachedFile", + "DockerOther": "" + } + ] + }, + "DockerImageConfig": { + "BaseHttpProxy": "", + "BaseImage": "", + "BaseImageCredential": { + "UserName": "", + "Password": "" + }, + "TargetImage": "", + "TargetHttpProxy": "", + "TargetTags": [ + "" + ], + "TargetImageCredential": { + "UserName": "", + "Password": "" + }, + "ImageFormat": "Docker", + "Entrypoint": [ + "" + ], + "Cmd": [ + "" + ], + "IgnoreList": [], + "SkipExistingImages": false + } +} \ No newline at end of file diff --git a/VideoAnalysis/Controllers/ApiController.cs b/VideoAnalysis/Controllers/ApiController.cs index 8aee9ad..3efa37b 100644 --- a/VideoAnalysis/Controllers/ApiController.cs +++ b/VideoAnalysis/Controllers/ApiController.cs @@ -89,19 +89,18 @@ namespace Learn.VideoAnalysis.Controllers var mergedList = new List(); // ʼϲ var current = timeBases.First(); + current.Content = string.Empty; foreach (var next in timeBases) { // ͬչʱ if (current.TimeBaseType == next.TimeBaseType) - { current.End = Math.Max(current.End, next.End); - } else { // Ͳͬǰʱμбʼʱ - current.Content = string.Empty; mergedList.Add(current); current = next; + current.Content = string.Empty; } } // ʱ @@ -114,10 +113,9 @@ namespace Learn.VideoAnalysis.Controllers /// /// /// Զid - /// Ƿ񸽼Ļ /// [HttpGet(Name = "TaskInfo")] - public async Task TaskInfo(long taskId,string? tagId,bool needSubtitle=false) + public async Task TaskInfo(long taskId,string? tagId) { var task = await videoTaskDB.AsQueryable() .WhereIF(taskId!=0, s => s.Id == taskId) @@ -131,7 +129,7 @@ namespace Learn.VideoAnalysis.Controllers taskData.Status = task.LastEnum; if (task.LastEnum != RedisChannelEnum.EndTask) return BadRequest(taskData); - if (!needSubtitle && taskData != null && taskData.TimeBase != null) + if (taskData != null && taskData.TimeBase != null) taskData.TimeBase = MergeTimeBases(taskData.TimeBase); return Ok(taskData); } diff --git a/VideoAnalysis/Dockerfile b/VideoAnalysis/Dockerfile new file mode 100644 index 0000000..07dacb1 --- /dev/null +++ b/VideoAnalysis/Dockerfile @@ -0,0 +1,16 @@ +#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. + +FROM dotnet/aspnet:8.0 +WORKDIR /app +EXPOSE 80 + +COPY . . +#设置时间为中国上海 环境为开发环境 +ENV TZ=Asia/Shanghai + + +#RUN echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ sid main contrib non-free" > /etc/apt/sources.list +#RUN apt-get update && apt-get install -y apt-transport-https ca-certificates apt-utils libgdiplus libc6-dev && apt-get install -y libfreetype6 && apt-get install -y libfontconfig1 && apt-get install -y fontconfig +# + +ENTRYPOINT ["dotnet", "Learn.VideoAnalysis.dll"] diff --git a/VideoAnalysis/Learn.VideoAnalysis.csproj b/VideoAnalysis/Learn.VideoAnalysis.csproj index aa80bf3..0de88a6 100644 --- a/VideoAnalysis/Learn.VideoAnalysis.csproj +++ b/VideoAnalysis/Learn.VideoAnalysis.csproj @@ -15,6 +15,16 @@ + + + + + + + Always + + + diff --git a/VideoAnalysis/appsettings.Development.json b/VideoAnalysis/appsettings.Development.json deleted file mode 100644 index 0c208ae..0000000 --- a/VideoAnalysis/appsettings.Development.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - } -} diff --git a/VideoAnalysis/appsettings.Production.json b/VideoAnalysis/appsettings.Production.json new file mode 100644 index 0000000..496ecf4 --- /dev/null +++ b/VideoAnalysis/appsettings.Production.json @@ -0,0 +1,21 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Error", + "Microsoft.AspNetCore": "Error" + } + }, + "AppConfig": { + "Redis": { + "ConnectionString": "10.255.255.3,password=qwe123!@#,defaultDatabase=10" + }, + "FFmpeg": { + " TimeSlice": 600 + }, + "DB": { + "ConnectionString": "AllowLoadLocalInfile=true;Server=10.255.255.3;Port=3306;Database=learn.videoanalysis;User ID=marking;Password=qwe123!@#;CharSet=utf8mb4;pooling=true;SslMode=None", + "SqlType": "MySql", + "UpdateTable": true + } + } +} diff --git a/VideoAnalysisCore/AICore/ChatGPT/Dto/CallGPTRes.cs b/VideoAnalysisCore/AICore/ChatGPT/Dto/CallGPTRes.cs index 04ceff7..6f35b64 100644 --- a/VideoAnalysisCore/AICore/ChatGPT/Dto/CallGPTRes.cs +++ b/VideoAnalysisCore/AICore/ChatGPT/Dto/CallGPTRes.cs @@ -63,8 +63,8 @@ namespace VideoAnalysisCore.AICore.ChatGPT.Dto /// 满分100 /// public float AssessmentScore => - (float)(Assessment?.Bad?.Select(x => x.Score) + (float)Math.Round((Assessment?.Bad?.Select(x => x.Score) .Concat(Assessment?.Merit?.Select(s => s.Score) ?? []) - .Average() ?? 0) * 100; + .Average() ?? 0) * 10,2); } } diff --git a/VideoAnalysisCore/VideoAnalysisCore.csproj b/VideoAnalysisCore/VideoAnalysisCore.csproj index 6aaf56a..d4d557f 100644 --- a/VideoAnalysisCore/VideoAnalysisCore.csproj +++ b/VideoAnalysisCore/VideoAnalysisCore.csproj @@ -8,10 +8,6 @@ - - - - @@ -21,26 +17,14 @@ PreserveNewest - - PreserveNewest - - + Never - - PreserveNewest - - - Always - - - PreserveNewest - - Always + Never - Always + Never