|
@@ -939,6 +939,22 @@ namespace WingDeviceService.Service
|
|
|
public async Task<ReportVideoDeviceInfoResult> ReportVideoDeviceInfo(ReportVideoDeviceInfoRequest request)
|
|
|
{
|
|
|
var result = new ReportVideoDeviceInfoResult();
|
|
|
+ if (request.VideoDeviceInfos == null || request.VideoDeviceInfos.Count == 0)
|
|
|
+ {
|
|
|
+ //视屏设备画面信息为空
|
|
|
+ ThrowCustomerException(CustomerRpcCode.VideoDeviceInfosEmpty, "VideoDeviceInfosEmpty");
|
|
|
+ }
|
|
|
+ if (request.VideoDeviceInfos.Any(x => string.IsNullOrWhiteSpace(x.VideoDeviceId)))
|
|
|
+ {
|
|
|
+ //视屏设备ID为空
|
|
|
+ ThrowCustomerException(CustomerRpcCode.VideoDeviceIdEmpty, "VideoDeviceIdEmpty");
|
|
|
+ }
|
|
|
+ var videoDeviceIdCount = request.VideoDeviceInfos.Select(x => x.VideoDeviceId).Distinct().Count();
|
|
|
+ if (videoDeviceIdCount < request.VideoDeviceInfos.Count)
|
|
|
+ {
|
|
|
+ //视屏设备ID重复
|
|
|
+ ThrowCustomerException(CustomerRpcCode.VideoDeviceIdRepeatError, "VideoDeviceIdRepeatError");
|
|
|
+ }
|
|
|
var deviceCode = await GetClientIdByTokenAsync(request.Token);
|
|
|
var deviceDTO = await _deviceInfoDBServiceProxy.FindDeviceInfoByCodeAsync(deviceCode);
|
|
|
deviceDTO.VideoDeviceInfos = request.VideoDeviceInfos;
|