70 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
		
		
			
		
	
	
			70 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| 
								 | 
							
								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; }
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								}
							 |