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.
73 lines
1.5 KiB
73 lines
1.5 KiB
using System; |
|
|
|
namespace Sanhe.Abp.Notifications; |
|
|
|
/// <summary> |
|
/// 通知信息 |
|
/// </summary> |
|
public class NotificationInfo |
|
{ |
|
/// <summary> |
|
/// 租户Id |
|
/// </summary> |
|
public Guid? TenantId { get; set; } |
|
/// <summary> |
|
/// 名称 |
|
/// </summary> |
|
public string Name { get; set; } |
|
/// <summary> |
|
/// Id |
|
/// </summary> |
|
public string Id { get; set; } |
|
/// <summary> |
|
/// 通知数据 |
|
/// </summary> |
|
public NotificationData Data { get; set; } |
|
/// <summary> |
|
/// 创建时间 |
|
/// </summary> |
|
public DateTime CreationTime { get; set; } |
|
/// <summary> |
|
/// 通知存活时间 |
|
/// </summary> |
|
public NotificationLifetime Lifetime { get; set; } |
|
/// <summary> |
|
/// 通知类型 |
|
/// </summary> |
|
public NotificationType Type { get; set; } |
|
/// <summary> |
|
/// 通知严重级别 |
|
/// </summary> |
|
public NotificationSeverity Severity { get; set; } |
|
|
|
public NotificationInfo() |
|
{ |
|
Data = new NotificationData(); |
|
Lifetime = NotificationLifetime.Persistent; |
|
Type = NotificationType.Application; |
|
Severity = NotificationSeverity.Info; |
|
|
|
CreationTime = DateTime.Now; |
|
} |
|
|
|
/// <summary> |
|
/// 设置Id |
|
/// </summary> |
|
/// <param name="id"></param> |
|
public void SetId(long id) |
|
{ |
|
if (Id.IsNullOrWhiteSpace()) |
|
{ |
|
Id = id.ToString(); |
|
} |
|
} |
|
|
|
/// <summary> |
|
/// 获取Id |
|
/// </summary> |
|
/// <returns></returns> |
|
public long GetId() |
|
{ |
|
return long.Parse(Id); |
|
} |
|
}
|
|
|