campus-errand/server/Models/Dtos/MessageDtos.cs
2026-03-01 05:01:47 +08:00

71 lines
2.1 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

namespace CampusErrand.Models.Dtos;
/// <summary>
/// 未读消息数响应
/// </summary>
public class UnreadCountResponse
{
/// <summary>系统消息未读数</summary>
public int SystemUnread { get; set; }
/// <summary>订单通知未读数</summary>
public int OrderNotificationUnread { get; set; }
/// <summary>总未读数</summary>
public int TotalUnread { get; set; }
}
/// <summary>
/// 系统消息列表项响应
/// </summary>
public class SystemMessageResponse
{
public int Id { get; set; }
public string Title { get; set; } = string.Empty;
/// <summary>正文(截断至 3 行约 100 字)</summary>
public string ContentPreview { get; set; } = string.Empty;
public string? ThumbnailUrl { get; set; }
public DateTime CreatedAt { get; set; }
public bool IsRead { get; set; }
}
/// <summary>
/// 系统消息详情响应
/// </summary>
public class SystemMessageDetailResponse
{
public int Id { get; set; }
public string Title { get; set; } = string.Empty;
public string Content { get; set; } = string.Empty;
public string? ThumbnailUrl { get; set; }
public DateTime CreatedAt { get; set; }
}
/// <summary>
/// 订单通知列表项响应
/// </summary>
public class OrderNotificationResponse
{
public int Id { get; set; }
public string OrderNo { get; set; } = string.Empty;
public string OrderType { get; set; } = string.Empty;
public string Title { get; set; } = string.Empty;
public string ItemName { get; set; } = string.Empty;
public string Status { get; set; } = string.Empty;
public DateTime CreatedAt { get; set; }
}
/// <summary>
/// 发布系统通知请求
/// </summary>
public class CreateNotificationRequest
{
public string Title { get; set; } = string.Empty;
public string Content { get; set; } = string.Empty;
public string? ThumbnailUrl { get; set; }
/// <summary>目标类型All, OrderUser, RunnerUser, Specific</summary>
public string TargetType { get; set; } = "All";
/// <summary>指定用户 ID 列表TargetType=Specific 时使用)</summary>
public List<int>? TargetUserIds { get; set; }
}