转EventUtil

本文介绍了一个实用的JavaScript工具包,用于实现跨浏览器的事件监听和移除功能,并提供了事件格式化的解决方案,确保不同浏览器间事件处理的一致性。

分段解释一下这段方法在干什么? public void updateEventType(String regionCode, String accountId, String deviceId, String deviceType, String uuid, Collection<String> eventTypes, String orderServiceType, Collection<UpdateEventTypeReq.EventTypeInfo> eventTypeInfos) { if (StringUtils.isEmpty(orderServiceType)) { log.warn("OrderServiceType is null"); } ManuallyUpdateEventTypeResponse response = indexServerApi.manuallyUpdateEventType(accountId, deviceId, uuid, eventTypes, orderServiceType, eventTypeInfos); if (response.getUpdated()) { long previousEventType = response.getPreviousEventType(); long currentEventType = response.getCurrentEventType(); long detectionSource = response.getDetectionSource(); List<UpdateEventTypeChannelResult> multiChannelResults = response.getEventTypeUpdateChannelResultsList().stream() .map(info -> modelMapper.map(info, UpdateEventTypeChannelResult.class)).collect(Collectors.toList()); statService.recordUpdateEventType(UpdateEventTypeStat.builder() .accountId(accountId).deviceId(deviceId).deviceType(deviceType).uuid(uuid) .previousEventType(previousEventType).currentEventType(currentEventType) .detectionSource(detectionSource) .agentHubDeviceId(response.getAgentHubDeviceId()) .orderServiceType(orderServiceType) .updateEventTypeChannelResults(multiChannelResults) .build()); String agentHubDeviceId = response.getAgentHubDeviceId(); if (StringUtils.isEmpty(agentHubDeviceId)) { deviceServiceV2.reportUpdatedEventType(regionCode, accountId, deviceId, deviceType, uuid, previousEventType, currentEventType, detectionSource, null, multiChannelResults); return; } boolean isHubDetect = EventUtil.isHubDetect(previousEventType, currentEventType, detectionSource); boolean idCameraDetect = EventUtil.isCameraDetect(previousEventType, currentEventType, detectionSource); if (isHubDetect) { deviceServiceV2.reportUpdatedEventType(regionCode, accountId, agentHubDeviceId, deviceType, uuid, previousEventType, currentEventType, detectionSource, deviceId, multiChannelResults); } if (idCameraDetect) { deviceServiceV2.reportUpdatedEventType(regionCode, accountId, deviceId, deviceType, uuid, previousEventType, currentEventType, detectionSource, null, multiChannelResults); } } }
最新发布
09-25
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值