ApprovalFlowNotifyLog.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. namespace Admin.NET.Plugin.ApprovalFlow;
  2. /// <summary>
  3. /// 审批流通知推送日志(P4-16)
  4. /// 记录每次 NotifyUsers 按渠道分发的结果,便于运维排障与降级审计。
  5. /// 一条记录 = 一次(实例 × 通知类型 × 渠道)的分发结果(接收用户合并入 TargetUserIds / TargetCount)。
  6. /// </summary>
  7. [SugarTable(null, "审批流通知推送日志")]
  8. [SugarIndex("idx_flownotifylog_instance", nameof(InstanceId), OrderByType.Asc)]
  9. public class ApprovalFlowNotifyLog : EntityBase
  10. {
  11. /// <summary>
  12. /// 关联流程实例 Id
  13. /// </summary>
  14. [SugarColumn(ColumnDescription = "流程实例Id")]
  15. public long InstanceId { get; set; }
  16. /// <summary>
  17. /// 通知类型(NewTask / Urge / FlowCompleted / Transferred / Returned / AddSign / Withdrawn / Escalated / Timeout)
  18. /// </summary>
  19. [SugarColumn(ColumnDescription = "通知类型", Length = 32, IsNullable = true)]
  20. [MaxLength(32)]
  21. public string? NotifyType { get; set; }
  22. /// <summary>
  23. /// 推送渠道(SignalR / Email / Sms / DingTalk / WorkWeixin)
  24. /// </summary>
  25. [SugarColumn(ColumnDescription = "推送渠道", Length = 16)]
  26. [MaxLength(16)]
  27. public string Channel { get; set; } = "";
  28. /// <summary>
  29. /// 通知标题(冗余便于检索)
  30. /// </summary>
  31. [SugarColumn(ColumnDescription = "通知标题", Length = 256, IsNullable = true)]
  32. [MaxLength(256)]
  33. public string? Title { get; set; }
  34. /// <summary>
  35. /// 目标用户 Id 列表(CSV,最多保留 1024 字符)
  36. /// </summary>
  37. [SugarColumn(ColumnDescription = "目标用户ID列表CSV", Length = 1024, IsNullable = true)]
  38. [MaxLength(1024)]
  39. public string? TargetUserIds { get; set; }
  40. /// <summary>
  41. /// 目标用户数
  42. /// </summary>
  43. [SugarColumn(ColumnDescription = "目标用户数")]
  44. public int TargetCount { get; set; }
  45. /// <summary>
  46. /// 是否成功(至少一次底层调用未抛异常视为成功;对于 SignalR 若无在线用户也记 true)
  47. /// </summary>
  48. [SugarColumn(ColumnDescription = "是否成功")]
  49. public bool Success { get; set; }
  50. /// <summary>
  51. /// 错误信息(失败时填充,最多 1024 字符)
  52. /// </summary>
  53. [SugarColumn(ColumnDescription = "错误信息", Length = 1024, IsNullable = true)]
  54. [MaxLength(1024)]
  55. public string? ErrorMessage { get; set; }
  56. /// <summary>
  57. /// 耗时毫秒
  58. /// </summary>
  59. [SugarColumn(ColumnDescription = "耗时ms")]
  60. public int ElapsedMs { get; set; }
  61. }