Asoka.Wang 2b3f9acdce 123
2025-09-22 19:09:47 +08:00

61 lines
1.5 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.

using System;
namespace NPP.SmartSchedue.Api.Contracts.Services.Notification.Output;
/// <summary>
/// 发送系统消息输出模型
/// </summary>
public class SendSystemMessageOutput
{
/// <summary>
/// 是否发送成功
/// </summary>
public bool Success { get; set; }
/// <summary>
/// 消息ID发送成功时返回
/// </summary>
public long? MessageId { get; set; }
/// <summary>
/// 错误消息(发送失败时返回)
/// </summary>
public string ErrorMessage { get; set; } = "";
/// <summary>
/// 发送时间
/// </summary>
public DateTime? SentTime { get; set; }
/// <summary>
/// 接收人员ID
/// </summary>
public long RecipientPersonnelId { get; set; }
/// <summary>
/// 创建成功结果
/// </summary>
public static SendSystemMessageOutput CreateSuccess(long messageId, long recipientPersonnelId, DateTime sentTime)
{
return new SendSystemMessageOutput
{
Success = true,
MessageId = messageId,
RecipientPersonnelId = recipientPersonnelId,
SentTime = sentTime
};
}
/// <summary>
/// 创建失败结果
/// </summary>
public static SendSystemMessageOutput CreateFailure(long recipientPersonnelId, string errorMessage)
{
return new SendSystemMessageOutput
{
Success = false,
RecipientPersonnelId = recipientPersonnelId,
ErrorMessage = errorMessage
};
}
}