feat(ai): 支持通过请求参数指定无人机SN
- 在 CallAiModel 请求对象中新增 UavSn 属性 - 修改 ManageApp 中构建 pushUrl 的逻辑,优先使用请求中的 UavSn - 当 UavSn 为空时,继续从数据库查询无人机 SN 并拼接默认值 - 确保兼容旧有逻辑的同时支持外部传入无人机 SN 参数main
parent
f656552a52
commit
bb220cf920
|
|
@ -25,4 +25,6 @@ public class CallAiModel
|
||||||
/// 告警内容
|
/// 告警内容
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string WarningContent { get; set; }
|
public string WarningContent { get; set; }
|
||||||
|
|
||||||
|
public string UavSn { get; set; }
|
||||||
}
|
}
|
||||||
|
|
@ -2563,16 +2563,24 @@ namespace OpenAuth.App.ServiceApp
|
||||||
var config = ConfigHelper.GetConfigRoot();
|
var config = ConfigHelper.GetConfigRoot();
|
||||||
var pushUrl = config["AIModelApi:PushUrl"];
|
var pushUrl = config["AIModelApi:PushUrl"];
|
||||||
// 取得无人机sn + 1
|
// 取得无人机sn + 1
|
||||||
var lasaDronePort = await Repository.AsSugarClient().Queryable<LasaDronePort>()
|
if (string.IsNullOrEmpty(req.UavSn))
|
||||||
.LeftJoin<LasaUav>((a, b) => a.Id == b.PId)
|
{
|
||||||
.Where((a, b) => a.Id == task.TaskDronePort).Select<dynamic>(
|
var lasaDronePort = await Repository.AsSugarClient().Queryable<LasaDronePort>()
|
||||||
(a, b) => new
|
.LeftJoin<LasaUav>((a, b) => a.Id == b.PId)
|
||||||
{
|
.Where((a, b) => a.Id == task.TaskDronePort).Select<dynamic>(
|
||||||
UavSn = b.Sn,
|
(a, b) => new
|
||||||
b.TypeId
|
{
|
||||||
}
|
UavSn = b.Sn,
|
||||||
).FirstAsync();
|
b.TypeId
|
||||||
pushUrl += lasaDronePort.UavSn + "1";
|
}
|
||||||
|
).FirstAsync();
|
||||||
|
pushUrl += lasaDronePort.UavSn + "1";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pushUrl += req.UavSn + 1;
|
||||||
|
}
|
||||||
|
|
||||||
json.rtmp_url = req.RtmpUrl; // 无人机直播流
|
json.rtmp_url = req.RtmpUrl; // 无人机直播流
|
||||||
json.push_url = pushUrl; // 识别结果推流
|
json.push_url = pushUrl; // 识别结果推流
|
||||||
json.imgsz = 640;
|
json.imgsz = 640;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue