From bb220cf92036c5e6a5422c3c559afbe0f1c8be5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=BC=9F?= <421281095@qq.com> Date: Tue, 18 Nov 2025 11:04:27 +0800 Subject: [PATCH] =?UTF-8?q?feat(ai):=20=E6=94=AF=E6=8C=81=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E8=AF=B7=E6=B1=82=E5=8F=82=E6=95=B0=E6=8C=87=E5=AE=9A?= =?UTF-8?q?=E6=97=A0=E4=BA=BA=E6=9C=BASN?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 CallAiModel 请求对象中新增 UavSn 属性 - 修改 ManageApp 中构建 pushUrl 的逻辑,优先使用请求中的 UavSn - 当 UavSn 为空时,继续从数据库查询无人机 SN 并拼接默认值 - 确保兼容旧有逻辑的同时支持外部传入无人机 SN 参数 --- .../ServiceApp/FlyTask/Request/CallAiModel.cs | 2 ++ OpenAuth.App/ServiceApp/ManageApp.cs | 28 ++++++++++++------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/OpenAuth.App/ServiceApp/FlyTask/Request/CallAiModel.cs b/OpenAuth.App/ServiceApp/FlyTask/Request/CallAiModel.cs index 47ca6f8..f63c7c2 100644 --- a/OpenAuth.App/ServiceApp/FlyTask/Request/CallAiModel.cs +++ b/OpenAuth.App/ServiceApp/FlyTask/Request/CallAiModel.cs @@ -25,4 +25,6 @@ public class CallAiModel /// 告警内容 /// public string WarningContent { get; set; } + + public string UavSn { get; set; } } \ No newline at end of file diff --git a/OpenAuth.App/ServiceApp/ManageApp.cs b/OpenAuth.App/ServiceApp/ManageApp.cs index a987528..a003c5f 100644 --- a/OpenAuth.App/ServiceApp/ManageApp.cs +++ b/OpenAuth.App/ServiceApp/ManageApp.cs @@ -2563,16 +2563,24 @@ namespace OpenAuth.App.ServiceApp var config = ConfigHelper.GetConfigRoot(); var pushUrl = config["AIModelApi:PushUrl"]; // 取得无人机sn + 1 - var lasaDronePort = await Repository.AsSugarClient().Queryable() - .LeftJoin((a, b) => a.Id == b.PId) - .Where((a, b) => a.Id == task.TaskDronePort).Select( - (a, b) => new - { - UavSn = b.Sn, - b.TypeId - } - ).FirstAsync(); - pushUrl += lasaDronePort.UavSn + "1"; + if (string.IsNullOrEmpty(req.UavSn)) + { + var lasaDronePort = await Repository.AsSugarClient().Queryable() + .LeftJoin((a, b) => a.Id == b.PId) + .Where((a, b) => a.Id == task.TaskDronePort).Select( + (a, b) => new + { + UavSn = b.Sn, + b.TypeId + } + ).FirstAsync(); + pushUrl += lasaDronePort.UavSn + "1"; + } + else + { + pushUrl += req.UavSn + 1; + } + json.rtmp_url = req.RtmpUrl; // 无人机直播流 json.push_url = pushUrl; // 识别结果推流 json.imgsz = 640;