初始化
This commit is contained in:
70
FutureMailAPI/DTOs/NotificationDTOs.cs
Normal file
70
FutureMailAPI/DTOs/NotificationDTOs.cs
Normal file
@@ -0,0 +1,70 @@
|
||||
namespace FutureMailAPI.DTOs
|
||||
{
|
||||
public class NotificationDeviceDto
|
||||
{
|
||||
public string DeviceId { get; set; } = string.Empty;
|
||||
public string DeviceType { get; set; } = string.Empty; // iOS, Android, Web
|
||||
public string DeviceToken { get; set; } = string.Empty;
|
||||
public bool IsActive { get; set; } = true;
|
||||
public DateTime RegisteredAt { get; set; }
|
||||
public DateTime? LastActiveAt { get; set; }
|
||||
}
|
||||
|
||||
public class NotificationSettingsDto
|
||||
{
|
||||
public bool EmailDelivery { get; set; } = true;
|
||||
public bool PushNotification { get; set; } = true;
|
||||
public bool InAppNotification { get; set; } = true;
|
||||
public bool DeliveryReminder { get; set; } = true;
|
||||
public bool ReceivedNotification { get; set; } = true;
|
||||
public bool SystemUpdates { get; set; } = false;
|
||||
public string QuietHoursStart { get; set; } = "22:00";
|
||||
public string QuietHoursEnd { get; set; } = "08:00";
|
||||
public bool EnableQuietHours { get; set; } = false;
|
||||
}
|
||||
|
||||
public class NotificationMessageDto
|
||||
{
|
||||
public string Id { get; set; } = string.Empty;
|
||||
public int UserId { get; set; }
|
||||
public string Title { get; set; } = string.Empty;
|
||||
public string Body { get; set; } = string.Empty;
|
||||
public string Type { get; set; } = string.Empty; // DELIVERY, RECEIVED, SYSTEM, REMINDER
|
||||
public string RelatedEntityId { get; set; } = string.Empty; // 邮件ID等
|
||||
public bool IsRead { get; set; } = false;
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public DateTime? ReadAt { get; set; }
|
||||
public Dictionary<string, object> Data { get; set; } = new();
|
||||
}
|
||||
|
||||
public class NotificationDeviceRequestDto
|
||||
{
|
||||
public string DeviceType { get; set; } = string.Empty;
|
||||
public string DeviceToken { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class NotificationDeviceResponseDto
|
||||
{
|
||||
public string DeviceId { get; set; } = string.Empty;
|
||||
public string DeviceType { get; set; } = string.Empty;
|
||||
public bool IsActive { get; set; }
|
||||
public DateTime RegisteredAt { get; set; }
|
||||
}
|
||||
|
||||
public class NotificationListQueryDto
|
||||
{
|
||||
public bool UnreadOnly { get; set; } = false;
|
||||
public string? Type { get; set; }
|
||||
public int Page { get; set; } = 1;
|
||||
public int Size { get; set; } = 20;
|
||||
}
|
||||
|
||||
public class NotificationListResponseDto
|
||||
{
|
||||
public List<NotificationMessageDto> Notifications { get; set; } = new();
|
||||
public int Total { get; set; }
|
||||
public int UnreadCount { get; set; }
|
||||
public int Page { get; set; }
|
||||
public int Size { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user