diff options
author | 杨宇千 <crupest@outlook.com> | 2020-02-01 00:26:35 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-01 00:26:35 +0800 |
commit | 7b962cd876719fb871569ba3c97fb5545721a3f8 (patch) | |
tree | f02f8d57440c777d4732bc4439f82e8b25c6732c /Timeline/Models/Http/TimelineCommon.cs | |
parent | 289c7e1fada1f4dae6ce5e421e997ebddd55c2df (diff) | |
parent | bcb0a2361467614531a337282da1fd23996924f1 (diff) | |
download | timeline-7b962cd876719fb871569ba3c97fb5545721a3f8.tar.gz timeline-7b962cd876719fb871569ba3c97fb5545721a3f8.tar.bz2 timeline-7b962cd876719fb871569ba3c97fb5545721a3f8.zip |
Merge pull request #56 from crupest/dev
Refactor API to be RESTful.
Diffstat (limited to 'Timeline/Models/Http/TimelineCommon.cs')
-rw-r--r-- | Timeline/Models/Http/TimelineCommon.cs | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/Timeline/Models/Http/TimelineCommon.cs b/Timeline/Models/Http/TimelineCommon.cs new file mode 100644 index 00000000..febb8186 --- /dev/null +++ b/Timeline/Models/Http/TimelineCommon.cs @@ -0,0 +1,44 @@ +using System;
+using System.Collections.Generic;
+
+namespace Timeline.Models.Http
+{
+ 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 class TimelinePostInfo
+ {
+ public long Id { get; set; }
+ public string Content { get; set; } = default!;
+ public DateTime Time { get; set; }
+ public UserInfo Author { get; set; } = default!;
+ public DateTime LastUpdated { get; set; } = default!;
+ }
+
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2227:Collection properties should be read only", Justification = "This is a DTO class.")]
+ public class BaseTimelineInfo
+ {
+ public string Description { get; set; } = default!;
+ public UserInfo Owner { get; set; } = default!;
+ public TimelineVisibility Visibility { get; set; }
+ public List<UserInfo> Members { get; set; } = default!;
+ }
+
+ public class TimelineInfo : BaseTimelineInfo
+ {
+ public string Name { get; set; } = default!;
+ }
+}
|