diff options
author | crupest <crupest@outlook.com> | 2020-08-31 22:49:57 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-31 22:49:57 +0800 |
commit | edfefcf9bdbf5ba186a8f2c7d021acf04dbbb329 (patch) | |
tree | fdd69c951f68cda72ac1cbf017ca272ee1b783f5 /Timeline/Models | |
parent | 1886b3411c69d8eb4fffbbfe29eb3a917d04e2f4 (diff) | |
parent | ff90e2819a1c0b7d1b605b45edaaaee7527c05b1 (diff) | |
download | timeline-edfefcf9bdbf5ba186a8f2c7d021acf04dbbb329.tar.gz timeline-edfefcf9bdbf5ba186a8f2c7d021acf04dbbb329.tar.bz2 timeline-edfefcf9bdbf5ba186a8f2c7d021acf04dbbb329.zip |
Merge pull request #158 from crupest/dev
Develop new features of back end.
Diffstat (limited to 'Timeline/Models')
-rw-r--r-- | Timeline/Models/Http/Timeline.cs | 11 | ||||
-rw-r--r-- | Timeline/Models/Http/TimelineController.cs | 24 | ||||
-rw-r--r-- | Timeline/Models/Timeline.cs | 6 |
3 files changed, 40 insertions, 1 deletions
diff --git a/Timeline/Models/Http/Timeline.cs b/Timeline/Models/Http/Timeline.cs index 6498fa74..a81b33f5 100644 --- a/Timeline/Models/Http/Timeline.cs +++ b/Timeline/Models/Http/Timeline.cs @@ -25,6 +25,10 @@ namespace Timeline.Models.Http /// If post is of image type. This is the image url.
/// </summary>
public string? Url { get; set; }
+ /// <summary>
+ /// If post has data (currently it means it's a image post), this is the data etag.
+ /// </summary>
+ public string? ETag { get; set; }
}
/// <summary>
@@ -68,6 +72,10 @@ namespace Timeline.Models.Http /// </summary>
public string UniqueId { get; set; } = default!;
/// <summary>
+ /// Title.
+ /// </summary>
+ public string Title { get; set; } = default!;
+ /// <summary>
/// Name of timeline.
/// </summary>
public string Name { get; set; } = default!;
@@ -188,7 +196,8 @@ namespace Timeline.Models.Http Url = urlHelper.ActionLink(
action: nameof(TimelineController.PostDataGet),
controller: nameof(TimelineController)[0..^nameof(Controller).Length],
- values: new { Name = source.TimelineName, Id = source.Id })
+ values: new { Name = source.TimelineName, Id = source.Id }),
+ ETag = $"\"{imageContent.DataTag}\""
};
}
else
diff --git a/Timeline/Models/Http/TimelineController.cs b/Timeline/Models/Http/TimelineController.cs index aad361ee..7bd141ed 100644 --- a/Timeline/Models/Http/TimelineController.cs +++ b/Timeline/Models/Http/TimelineController.cs @@ -57,6 +57,11 @@ namespace Timeline.Models.Http public class TimelinePatchRequest
{
/// <summary>
+ /// New title. Null for not change.
+ /// </summary>
+ public string? Title { get; set; }
+
+ /// <summary>
/// New description. Null for not change.
/// </summary>
public string? Description { get; set; }
@@ -66,4 +71,23 @@ namespace Timeline.Models.Http /// </summary>
public TimelineVisibility? Visibility { get; set; }
}
+
+ /// <summary>
+ /// Change timeline name request model.
+ /// </summary>
+ public class TimelineChangeNameRequest
+ {
+ /// <summary>
+ /// Old name of timeline.
+ /// </summary>
+ [Required]
+ [TimelineName]
+ public string OldName { get; set; } = default!;
+ /// <summary>
+ /// New name of timeline.
+ /// </summary>
+ [Required]
+ [TimelineName]
+ public string NewName { get; set; } = default!;
+ }
}
diff --git a/Timeline/Models/Timeline.cs b/Timeline/Models/Timeline.cs index 34c253a0..a5987577 100644 --- a/Timeline/Models/Timeline.cs +++ b/Timeline/Models/Timeline.cs @@ -43,6 +43,10 @@ namespace Timeline.Models 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; }
}
@@ -74,6 +78,7 @@ namespace Timeline.Models 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; }
@@ -86,6 +91,7 @@ namespace Timeline.Models public class TimelineChangePropertyRequest
{
+ public string? Title { get; set; }
public string? Description { get; set; }
public TimelineVisibility? Visibility { get; set; }
}
|