97 lines
3.4 KiB
C#
97 lines
3.4 KiB
C#
using F9WebAiTest.Domain.Entities.Notice;
|
|
|
|
namespace F9WebAiTest.Application.Dtos.Notice;
|
|
|
|
// ---- 消息类型 ----
|
|
public class NotificationTypeDto
|
|
{
|
|
public long Id { get; set; }
|
|
public string Code { get; set; }
|
|
public string Name { get; set; }
|
|
public string Description { get; set; }
|
|
public string RequiredPermission { get; set; }
|
|
public bool IsActive { get; set; }
|
|
public long CreatedBy { get; set; }
|
|
public int Sort { get; set; }
|
|
public int Category { get; set; } // 消息分类:0通知 1待办 2公告
|
|
public string Icon { get; set; } = ""; // 图标
|
|
public string RouteTemplate { get; set; } = ""; // Web 端跳转路由模板
|
|
public bool Subscribed { get; set; } // 当前用户是否已订阅
|
|
public bool CanSubscribe { get; set; } = true; // 当前用户是否有权限订阅
|
|
}
|
|
|
|
public class NotificationTypeCreateDto
|
|
{
|
|
public string Code { get; set; } = "";
|
|
public string Name { get; set; } = "";
|
|
public string Description { get; set; } = "";
|
|
public string RequiredPermission { get; set; } = "";
|
|
public bool IsActive { get; set; } = true;
|
|
public int Sort { get; set; }
|
|
public int Category { get; set; } // 消息分类:0通知 1待办 2公告
|
|
public string Icon { get; set; } = "";
|
|
public string RouteTemplate { get; set; } = ""; // Web 端跳转路由模板,支持 {businessId} 占位符
|
|
}
|
|
|
|
// ---- 订阅 ----
|
|
public class SubscribeDto
|
|
{
|
|
public long NotificationTypeId { get; set; }
|
|
public bool Subscribe { get; set; } = true; // true=订阅 false=取消
|
|
}
|
|
|
|
// ---- 消息 ----
|
|
public class NotificationMessageDto
|
|
{
|
|
public long Id { get; set; }
|
|
public long NotificationTypeId { get; set; }
|
|
public string MessageTypeCode { get; set; }
|
|
public string TypeName { get; set; }
|
|
public string Title { get; set; }
|
|
public string Content { get; set; }
|
|
public int Priority { get; set; }
|
|
public string BusinessType { get; set; }
|
|
public string BusinessId { get; set; }
|
|
public int Category { get; set; } // 消息分类:0通知 1待办 2公告
|
|
public string RoutePath { get; set; } = ""; // Web 端跳转路由(点击消息时跳转)
|
|
public DateTime CreatedTime { get; set; }
|
|
public int ReadStatus { get; set; } // 当前用户阅读状态 0=未读 1=已读
|
|
public DateTime? ReadTime { get; set; }
|
|
}
|
|
|
|
public class UnreadCountDto
|
|
{
|
|
public int Count { get; set; }
|
|
}
|
|
|
|
// ---- 待办 ----
|
|
public class TodoItemDto
|
|
{
|
|
public long Id { get; set; }
|
|
public long MessageId { get; set; }
|
|
public string Title { get; set; } = "";
|
|
public string Content { get; set; } = "";
|
|
public int Priority { get; set; }
|
|
public string BusinessType { get; set; } = "";
|
|
public string BusinessId { get; set; } = "";
|
|
public string RoutePath { get; set; } = "";
|
|
public int TodoStatus { get; set; } // 0待处理 1处理中 2已完成 3已取消
|
|
public DateTime? DueTime { get; set; }
|
|
public DateTime? CompletedTime { get; set; }
|
|
public DateTime CreatedTime { get; set; }
|
|
}
|
|
|
|
public class CompleteTodoDto
|
|
{
|
|
public string HandleResult { get; set; } = ""; // 处理结果说明
|
|
}
|
|
|
|
// ---- 广播通知 ----
|
|
public class BroadcastNotificationDto
|
|
{
|
|
public string Title { get; set; } = "";
|
|
public string Content { get; set; } = "";
|
|
public NotificationPriority? Priority { get; set; }
|
|
public string RoutePath { get; set; } = "";
|
|
}
|