diff options
author | 杨宇千 <crupest@outlook.com> | 2019-11-20 18:21:17 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-20 18:21:17 +0800 |
commit | 751467deb8ae18909ebd2b241bbb64f1f9da8295 (patch) | |
tree | 788b8acdf1141c757cb3226d3cd5f64594386b8f /Timeline/Entities/TimelineEntity.cs | |
parent | 2de7fa95bb5ad0a10f74fb390bac464a250dee42 (diff) | |
parent | 33318b9244a82fee6d711aa15f853e1590ff13f7 (diff) | |
download | timeline-751467deb8ae18909ebd2b241bbb64f1f9da8295.tar.gz timeline-751467deb8ae18909ebd2b241bbb64f1f9da8295.tar.bz2 timeline-751467deb8ae18909ebd2b241bbb64f1f9da8295.zip |
Merge pull request #54 from crupest/timeline
Add core feature Timeline (currently only personal timeline)
Diffstat (limited to 'Timeline/Entities/TimelineEntity.cs')
-rw-r--r-- | Timeline/Entities/TimelineEntity.cs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Timeline/Entities/TimelineEntity.cs b/Timeline/Entities/TimelineEntity.cs new file mode 100644 index 00000000..9cacfcae --- /dev/null +++ b/Timeline/Entities/TimelineEntity.cs @@ -0,0 +1,41 @@ +using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using Timeline.Models;
+
+namespace Timeline.Entities
+{
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2227:Collection properties should be read only", Justification = "This is entity object.")]
+ [Table("timelines")]
+ public class TimelineEntity
+ {
+ [Column("id"), Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public long Id { get; set; }
+
+ /// <summary>
+ /// If null, then this timeline is a personal timeline.
+ /// </summary>
+ [Column("name")]
+ public string? Name { get; set; }
+
+ [Column("description")]
+ public string? Description { get; set; }
+
+ [Column("owner")]
+ public long OwnerId { get; set; }
+
+ [ForeignKey(nameof(OwnerId))]
+ public User Owner { get; set; } = default!;
+
+ [Column("visibility")]
+ public TimelineVisibility Visibility { get; set; }
+
+ [Column("create_time")]
+ public DateTime CreateTime { get; set; }
+
+ public List<TimelineMemberEntity> Members { get; set; } = default!;
+
+ public List<TimelinePostEntity> Posts { get; set; } = default!;
+ }
+}
|