1234567891011121314151617181920212223242526272829303132333435 |
- using System.ComponentModel.DataAnnotations;
- using System.ComponentModel.DataAnnotations.Schema;
- using Microsoft.EntityFrameworkCore;
- using PCC2.Data.Enums;
- namespace PCC2.Data.Entity;
- [Index(nameof(LocalPeerId),nameof(RemotePeerId),nameof(SenderTime))]
- public class ChatRecord
- {
- [Key]
- [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
- public int Id { get; set; }
- [Required] public int LocalPeerId { get; set; }
- public LocalPeer? LocalPeer { get; set; }
- [Required] public int RemotePeerId { get; set; }
- public RemotePeer? RemotePeer { get; set; }
- [Required] public ChatDirection Direction { get; set; }
- [Required] public ChatRecordKind Kind { get; set; }
- [Required] public DateTimeOffset SenderTime { get; set; }
- [Required][Column(TypeName = "TEXT")] public string? Content { get; set; }
- public DateTimeOffset? TargetAckTime { get; set; }
- public int? MediaRecordId { get; set; }
- public MediaRecord? MediaRecord { get; set; }
- }
|