Exemplo n.º 1
0
        public override async ValueTask <TagWriteIntegrationEventReply> HandleRpcAsync(TagWriteIntegrationEvent @event, CancellationToken cancellationToken = default)
        {
            //Logger.LogTrace("HandleRpcAsync... " + @event.RoutingKey + " " + @event.ReplyRoutingKey);
            //Logger.LogTrace("HandleRpcAsync... " + @event.RoutingKey);
            var result = await _biz.SetTagValueAsync(@event.GroupName, @event.Name, @event.Value).ConfigureAwait(false);

            //Logger.LogTrace("HandleRpcAsync: " + tagValue);
            //return new TagWriteIntegrationEventReply(@event.GroupName + @event.ReplyRoutingKey, @event.GroupName, @event.Name, @event.CreationDate, result);
            return(new TagWriteIntegrationEventReply(@event.ReplyRoutingKey, @event.GroupName, @event.Name, @event.CreationDate, result));
        }
Exemplo n.º 2
0
        public async ValueTask <KSociety.Com.App.Dto.Res.Biz.SetTagValue> ExecuteAsync(SetTagValue request, CancellationToken cancellationToken = default)
        {
            var output = new KSociety.Com.App.Dto.Res.Biz.SetTagValue();

            //_logger.LogTrace("GetTagValue ExecuteAsync: " + request.GroupName + " - " + request.TagName + " - " + _startup.SystemGroups.Count);
            try
            {
                var result = await _startup.SetTagValueAsync(new TagWriteIntegrationEvent(request.GroupName + ".automation.write", request.GroupName + ".automation.write.client.com", request.GroupName, request.TagName, request.Value)).ConfigureAwait(false);

                output.GroupName = result.GroupName;
                output.TagName   = result.TagName;
                output.Result    = true;
            }
            catch (Exception ex)
            {
                _logger.LogError("SetTagValue Execute:  " + ex.Message + " - " + ex.StackTrace);
            }
            return(output);
        }
Exemplo n.º 3
0
        public override async ValueTask <TagWriteIntegrationEventReply> HandleRpcAsync(TagWriteIntegrationEvent @event, CancellationToken cancellationToken = default)
        {
            var result = await _biz.SetTagValueAsync(@event.GroupName, @event.Name, @event.Value).ConfigureAwait(false);

            return(new TagWriteIntegrationEventReply(@event.GroupName + ".automation.write", @event.GroupName, @event.Name, @event.CreationDate, result));
        }