Ejemplo n.º 1
0
        public KSociety.Com.App.Dto.Res.Biz.SetTagValue Execute(SetTagValue request)
        {
            var output = new KSociety.Com.App.Dto.Res.Biz.SetTagValue();

            try
            {
                var result = _startup.SetTagValue(new TagWriteIntegrationEvent(request.GroupName + ".automation.write", request.GroupName + ".automation.write.client.com", request.GroupName, request.TagName, request.Value));
                output.GroupName = result.GroupName;
                output.TagName   = result.TagName;
                output.Result    = true;
            }
            catch (Exception ex)
            {
                _logger.LogError("SetTagValue Execute:  " + ex.Message + " - " + ex.StackTrace);
            }

            return(output);
        }
Ejemplo n.º 2
0
        public App.Dto.Res.Biz.SetTagValue SetTagValue(SetTagValue request, CancellationToken cancellationToken = default)
        {
            CallOptions = CallOptions.WithCancellationToken(cancellationToken);
            CallContext = new CallContext(CallOptions, CallContextFlags.IgnoreStreamTermination);
            App.Dto.Res.Biz.SetTagValue output = new App.Dto.Res.Biz.SetTagValue();
            try
            {
                using (Channel)
                {
                    IBiz client = Channel.CreateGrpcService <IBiz>();

                    var result = client.SetTagValue(request, CallContext);

                    output = result;
                }
            }
            catch (Exception ex)
            {
                Logger.LogError(GetType().FullName + "." + System.Reflection.MethodBase.GetCurrentMethod()?.Name + " - " + ex.Source + " " + ex.Message + " " + ex.StackTrace);
            }
            return(output);
        }