diff --git a/OpenAuth.WebApi/Controllers/ServiceControllers/AirportMaintenanceController.cs b/OpenAuth.WebApi/Controllers/ServiceControllers/AirportMaintenanceController.cs
index 06bd4fc..58005e0 100644
--- a/OpenAuth.WebApi/Controllers/ServiceControllers/AirportMaintenanceController.cs
+++ b/OpenAuth.WebApi/Controllers/ServiceControllers/AirportMaintenanceController.cs
@@ -71,5 +71,274 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
return result;
}
+
+ ///
+ /// 切换相机
+ ///
+ ///
+ [HttpPost]
+ public async Task> ExchangeCamera(string camera,int position,string videoId)
+ {
+ Response response = new Response();
+ try
+ {
+
+ var topicRequest = $"thing/product/8UUXN5400A079H/services";
+ var requestData = new
+ {
+ bid = Guid.NewGuid().ToString(),
+ method = "live_camera_change",
+ tid = Guid.NewGuid().ToString(),
+ timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+ data = new
+ {
+ camera_position = position,
+ video_id = "8UUXN5400A079H/165-0-7/normal-0"
+ }
+ };
+ string payload = JsonSerializer.Serialize(requestData);
+ await _mqttClientManager.PublishAsync(topicRequest, payload);
+
+ var topicRequest1 = $"thing/product/8UUXN5400A079H/services_reply";
+ var requestData1 = new
+ {
+ bid = Guid.NewGuid().ToString(),
+ method = "live_camera_change",
+ tid = Guid.NewGuid().ToString(),
+ timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+ data = new
+ {
+ result = 0
+ }
+ };
+ string payload1 = JsonSerializer.Serialize(requestData1);
+ await _mqttClientManager.PublishAsync(topicRequest1, payload1);
+
+ response.Result = 1;
+
+ }
+ catch (Exception ex)
+ {
+ response.Code = 500;
+ response.Message = ex.Message;
+ }
+ return response; ;
+
+ }
+
+
+
+ ///
+ /// 设置直播镜头
+ ///
+ ///
+ [HttpPost]
+ public async Task> SetCamera(string cameraType, string videoId)
+ {
+ Response response = new Response();
+ try
+ {
+
+ var topicRequest = $"thing/product/8UUXN5400A079H/services";
+ var requestData = new
+ {
+ bid = Guid.NewGuid().ToString(),
+ method = "live_lens_change",
+ tid = Guid.NewGuid().ToString(),
+ timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+ data = new
+ {
+ video_type = cameraType,
+ video_id = "8UUXN5400A079H/165-0-7/normal-0"
+ }
+ };
+ string payload = JsonSerializer.Serialize(requestData);
+ await _mqttClientManager.PublishAsync(topicRequest, payload);
+
+ var topicRequest1 = $"thing/product/8UUXN5400A079H/services_reply";
+ var requestData1 = new
+ {
+ bid = Guid.NewGuid().ToString(),
+ method = "live_lens_change",
+ tid = Guid.NewGuid().ToString(),
+ timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+ data = new
+ {
+ result = 0
+ }
+ };
+ string payload1 = JsonSerializer.Serialize(requestData1);
+ await _mqttClientManager.PublishAsync(topicRequest1, payload1);
+
+ response.Result = 1;
+
+ }
+ catch (Exception ex)
+ {
+ response.Code = 500;
+ response.Message = ex.Message;
+ }
+ return response;
+
+ }
+
+
+ ///
+ /// 设置直播清晰度
+ ///
+ ///
+ [HttpPost]
+ public async Task> SetCameraVideo(int videoQuality, string videoId)
+ {
+ Response response = new Response();
+ try
+ {
+
+ var topicRequest = $"thing/product/8UUXN5400A079H/services";
+ var requestData = new
+ {
+ bid = Guid.NewGuid().ToString(),
+ method = "live_set_quality",
+ tid = Guid.NewGuid().ToString(),
+ timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+ data = new
+ {
+ video_quality = videoQuality,
+ video_id = "8UUXN5400A079H/165-0-7/normal-0"
+ }
+ };
+ string payload = JsonSerializer.Serialize(requestData);
+ await _mqttClientManager.PublishAsync(topicRequest, payload);
+
+ var topicRequest1 = $"thing/product/8UUXN5400A079H/services_reply";
+ var requestData1 = new
+ {
+ bid = Guid.NewGuid().ToString(),
+ method = "live_set_quality",
+ tid = Guid.NewGuid().ToString(),
+ timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+ data = new
+ {
+ result = 0
+ }
+ };
+ string payload1 = JsonSerializer.Serialize(requestData1);
+ await _mqttClientManager.PublishAsync(topicRequest1, payload1);
+
+ response.Result = 1;
+
+ }
+ catch (Exception ex)
+ {
+ response.Code = 500;
+ response.Message = ex.Message;
+ }
+ return response;
+
+ }
+
+
+ ///
+ /// 停止直播
+ ///
+ ///
+ [HttpPost]
+ public async Task> EndLive( string videoId)
+ {
+ Response response = new Response();
+ try
+ {
+
+ var topicRequest = $"thing/product/8UUXN5400A079H/services";
+ var requestData = new
+ {
+ bid = Guid.NewGuid().ToString(),
+ method = "live_stop_push",
+ tid = Guid.NewGuid().ToString(),
+ timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+ data = new
+ {
+
+ video_id = "8UUXN5400A079H/165-0-7/normal-0"
+ }
+ };
+ string payload = JsonSerializer.Serialize(requestData);
+ await _mqttClientManager.PublishAsync(topicRequest, payload);
+
+ var topicRequest1 = $"thing/product/8UUXN5400A079H/services_reply";
+ var requestData1 = new
+ {
+ bid = Guid.NewGuid().ToString(),
+ method = "live_start_push",
+ tid = Guid.NewGuid().ToString(),
+ timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+ data = new
+ {
+ result = 0
+ }
+ };
+ string payload1 = JsonSerializer.Serialize(requestData1);
+ await _mqttClientManager.PublishAsync(topicRequest1, payload1);
+
+ response.Result = 1;
+
+
+
+ }
+ catch (Exception ex)
+ {
+ response.Code = 500;
+ response.Message = ex.Message;
+ }
+ return response;
+
+ }
+
+
+
+ ///
+ /// 开始直播
+ ///
+ ///
+ [HttpPost]
+ public async Task> StartLive(string videoId,int urlType,string url,int quality)
+ {
+ Response response = new Response();
+ try
+ {
+
+ var topicRequest = $"thing/product/8UUXN5400A079H/services";
+ var requestData = new
+ {
+ bid = Guid.NewGuid().ToString(),
+ method = "live_start_push",
+ tid = Guid.NewGuid().ToString(),
+ timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+ data = new
+ {
+ url_type = urlType,
+ url = url,
+ video_quality = quality,
+ video_id = "8UUXN5400A079H/165-0-7/normal-0"
+ }
+ };
+ string payload = JsonSerializer.Serialize(requestData);
+ await _mqttClientManager.PublishAsync(topicRequest, payload);
+
+
+
+ response.Result = 1;
+
+
+
+ }
+ catch (Exception ex)
+ {
+ response.Code = 500;
+ response.Message = ex.Message;
+ }
+ return response;
+
+ }
}
}