using CFX;
using CFX.ResourcePerformance;
using CFX.Structures;
using Sln.Iot.Serilog;

namespace Sln.Iot.CFX.Event
{
    /// <summary>
    /// 错误清除事件
    /// </summary>
    public class FaultClearedEvent
    {
        /// <summary>
        /// 数据封装处理
        /// </summary>
        /// <returns></returns>
        public CFXMessage Handle(Guid faultGuid)
        {
            CFXMessage eve = null;
            try
            {
                eve = new FaultCleared()
                {
                    Operator = new Operator()
                    {
                        ActorType = ActorType.Robot,
                        LoginName = "admin",
                    },
                    FaultOccurrenceId = faultGuid
                };
            }
            catch (Exception e)
            {
                SerilogHelper.Instance.Error("终端节点连接事件数据封装异常", e);
            }
            return eve;
        }
    }
}
