diff options
author | crupest <crupest@outlook.com> | 2020-11-27 00:07:09 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-11-27 00:07:09 +0800 |
commit | 7883590a7a0c5c5c4e5cff6290e26c64e1258a25 (patch) | |
tree | 28e1ad4d02c4054e13b6cf539c64aba8d00df3e5 /BackEnd/Timeline/Models/Timeline.cs | |
parent | ce85af942c64fc3bad4e4502d683f730c882de96 (diff) | |
download | timeline-7883590a7a0c5c5c4e5cff6290e26c64e1258a25.tar.gz timeline-7883590a7a0c5c5c4e5cff6290e26c64e1258a25.tar.bz2 timeline-7883590a7a0c5c5c4e5cff6290e26c64e1258a25.zip |
refactor: ...
Diffstat (limited to 'BackEnd/Timeline/Models/Timeline.cs')
-rw-r--r-- | BackEnd/Timeline/Models/Timeline.cs | 98 |
1 files changed, 0 insertions, 98 deletions
diff --git a/BackEnd/Timeline/Models/Timeline.cs b/BackEnd/Timeline/Models/Timeline.cs deleted file mode 100644 index a5987577..00000000 --- a/BackEnd/Timeline/Models/Timeline.cs +++ /dev/null @@ -1,98 +0,0 @@ -using System;
-using System.Collections.Generic;
-
-namespace Timeline.Models
-{
- public enum TimelineVisibility
- {
- /// <summary>
- /// All people including those without accounts.
- /// </summary>
- Public,
- /// <summary>
- /// Only people signed in.
- /// </summary>
- Register,
- /// <summary>
- /// Only member.
- /// </summary>
- Private
- }
-
- public static class TimelinePostContentTypes
- {
- public const string Text = "text";
- public const string Image = "image";
- }
-
- public interface ITimelinePostContent
- {
- public string Type { get; }
- }
-
- public class TextTimelinePostContent : ITimelinePostContent
- {
- public TextTimelinePostContent(string text) { Text = text; }
-
- public string Type { get; } = TimelinePostContentTypes.Text;
- public string Text { get; set; }
- }
-
- public class ImageTimelinePostContent : ITimelinePostContent
- {
- public ImageTimelinePostContent(string dataTag) { DataTag = dataTag; }
-
- public string Type { get; } = TimelinePostContentTypes.Image;
-
- /// <summary>
- /// The tag of the data. The tag of the entry in DataManager. Also the etag (not quoted).
- /// </summary>
- public string DataTag { get; set; }
- }
-
- public class TimelinePost
- {
- public TimelinePost(long id, ITimelinePostContent? content, DateTime time, User? author, DateTime lastUpdated, string timelineName)
- {
- Id = id;
- Content = content;
- Time = time;
- Author = author;
- LastUpdated = lastUpdated;
- TimelineName = timelineName;
- }
-
- public long Id { get; set; }
- public ITimelinePostContent? Content { get; set; }
- public bool Deleted => Content == null;
- public DateTime Time { get; set; }
- public User? Author { get; set; }
- public DateTime LastUpdated { get; set; }
- public string TimelineName { get; set; }
- }
-
-#pragma warning disable CA1724 // Type names should not match namespaces
- public class Timeline
-#pragma warning restore CA1724 // Type names should not match namespaces
- {
- public string UniqueID { get; set; } = default!;
- public string Name { get; set; } = default!;
- public DateTime NameLastModified { get; set; } = default!;
- public string Title { get; set; } = default!;
- public string Description { get; set; } = default!;
- public User Owner { get; set; } = default!;
- public TimelineVisibility Visibility { get; set; }
-#pragma warning disable CA2227 // Collection properties should be read only
- public List<User> Members { get; set; } = default!;
-#pragma warning restore CA2227 // Collection properties should be read only
- public DateTime CreateTime { get; set; } = default!;
- public DateTime LastModified { get; set; } = default!;
- }
-
- public class TimelineChangePropertyRequest
- {
- public string? Title { get; set; }
- public string? Description { get; set; }
- public TimelineVisibility? Visibility { get; set; }
- }
-}
|