平安校园
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.

MessageInput.cs 1.1 KiB

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