You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
658 B
36 lines
658 B
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Wood.Util;
|
|
|
|
namespace Wood.EventBus
|
|
{
|
|
public class IntegrationEvent
|
|
{
|
|
/// <summary>
|
|
/// id
|
|
/// </summary>
|
|
public string Id { get; } = IdGeneratorHelper.Instance.GetGuid();
|
|
|
|
/// <summary>
|
|
/// 发布时间
|
|
/// </summary>
|
|
public DateTime CreateTime { get; } = DateTime.Now;
|
|
|
|
/// <summary>
|
|
/// 携带数据
|
|
/// </summary>
|
|
public object? Payload { get; init; }
|
|
|
|
public T? GetPayload<T>()
|
|
{
|
|
if (Payload == null)
|
|
return default(T);
|
|
|
|
return (T)Payload;
|
|
}
|
|
}
|
|
}
|
|
|