|
@@ -1006,21 +1006,20 @@ namespace WingDeviceService.Service
|
|
|
public async Task<ReportVideoDeviceInfoResult> ReportVideoDeviceInfoAsync(ReportVideoDeviceInfoRequest request)
|
|
|
{
|
|
|
var result = new ReportVideoDeviceInfoResult();
|
|
|
- if (request.VideoDeviceInfos == null || request.VideoDeviceInfos.Count == 0)
|
|
|
+ request.VideoDeviceInfos = request.VideoDeviceInfos?.ToList() ?? new List<VideoDeviceInfo>();
|
|
|
+ if (request.VideoDeviceInfos.Any())
|
|
|
{
|
|
|
- //视屏设备画面信息为空
|
|
|
- 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");
|
|
|
+ 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);
|