平安校园
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

52 lines
1.1 KiB

  1. //
  2. namespace SafeCampus.System;
  3. public class MessagePageInput : BasePageInput
  4. {
  5. /// <summary>
  6. /// 站内信分类
  7. /// </summary>
  8. public string Category { get; set; }
  9. }
  10. /// <summary>
  11. /// 发送参数
  12. /// </summary>
  13. public class MessageSendInput : SysMessage, IValidatableObject
  14. {
  15. /// <summary>
  16. /// 主题
  17. /// </summary>
  18. [Required(ErrorMessage = "Subject不能为空")]
  19. public override string Subject { get; set; }
  20. /// <summary>
  21. /// 分类
  22. /// </summary>
  23. [Required(ErrorMessage = "Category不能为空")]
  24. public override string Category { get; set; }
  25. /// <summary>
  26. /// 接收人Id
  27. /// </summary>
  28. [Required(ErrorMessage = "ReceiverIdList不能为空")]
  29. public List<long> ReceiverIdList { get; set; }
  30. public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
  31. {
  32. if (Category != CateGoryConst.MESSAGE_INFORM && Category != CateGoryConst.MESSAGE_NOTICE)
  33. {
  34. yield return new ValidationResult("分类错误", new[] { nameof(Category) });
  35. }
  36. }
  37. }