//
namespace SafeCampus.System;
public class MessagePageInput : BasePageInput
{
///
/// 站内信分类
///
public string Category { get; set; }
}
///
/// 发送参数
///
public class MessageSendInput : SysMessage, IValidatableObject
{
///
/// 主题
///
[Required(ErrorMessage = "Subject不能为空")]
public override string Subject { get; set; }
///
/// 分类
///
[Required(ErrorMessage = "Category不能为空")]
public override string Category { get; set; }
///
/// 接收人Id
///
[Required(ErrorMessage = "ReceiverIdList不能为空")]
public List ReceiverIdList { get; set; }
public IEnumerable Validate(ValidationContext validationContext)
{
if (Category != CateGoryConst.MESSAGE_INFORM && Category != CateGoryConst.MESSAGE_NOTICE)
{
yield return new ValidationResult("分类错误", new[] { nameof(Category) });
}
}
}