fly 2 years ago
parent
commit
4e4f7a3a3a
2 changed files with 15 additions and 8 deletions
  1. 7 5
      AutoMapperProfile.cs
  2. 8 3
      Service/DeviceService.cs

+ 7 - 5
AutoMapperProfile.cs

@@ -1,16 +1,18 @@
 using AutoMapper;
 using WingInterfaceLibrary.DTO.Device;
 using WingInterfaceLibrary.DTO.User;
+using WingInterfaceLibrary.LiveConsultation;
 
 namespace WingDeviceService
 {
     public class AutoMapperProfile : Profile
-    {   
-         public AutoMapperProfile()
-         {
+    {
+        public AutoMapperProfile()
+        {
             CreateMap<UserDTO, UserPasswordDTO>().ReverseMap();
             CreateMap<DeviceInfoDTO, CacheDeviceDTO>().ReverseMap();
-            CreateMap<DeviceInfoDTO, DeviceExtendInfoDTO>().ReverseMap();  
-         }
+            CreateMap<DeviceInfoDTO, DeviceExtendInfoDTO>().ReverseMap();
+            CreateMap<VideoDeviceInfo, CacheVideoDeviceInfo>().ReverseMap();
+        }
     }
 }

+ 8 - 3
Service/DeviceService.cs

@@ -920,10 +920,15 @@ namespace WingDeviceService.Service
         /// <docSecondDirectory>实时会诊服务接口</docSecondDirectory>   
         /// <docThirdDirectory>会诊</docThirdDirectory>  
         /// <returns></returns>
-
-        public Task<ReportVideoDeviceInfoResult> ReportVideoDeviceInfo(ReportVideoDeviceInfoRequest request)
+        public async Task<ReportVideoDeviceInfoResult> ReportVideoDeviceInfo(ReportVideoDeviceInfoRequest request)
         {
-            return null;
+            var result =new ReportVideoDeviceInfoResult();
+            var deviceCode = await GetClientIdByTokenAsync(request.Token);
+            var deviceDTO = await _deviceInfoDBServiceProxy.FindDeviceInfoByCodeAsync(deviceCode);
+            deviceDTO.VideoDeviceInfos = request.VideoDeviceInfos;
+            await _deviceInfoDBServiceProxy.UpdateDeviceInfoByCodeAsync(deviceDTO.DeviceCode, deviceDTO, null);
+            CacheMaintenance.Instance.Get<IDeviceInfosManager>().Remove(request.DeviceCode);
+            return result;
         }
 
     }