aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Models/Http
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-02-06 16:41:19 +0800
committercrupest <crupest@outlook.com>2021-02-06 16:41:19 +0800
commit3591f59453846e235ce77e15adde6092dbbedac3 (patch)
tree3663c6da19945d9514f040c53205f037b49ec998 /BackEnd/Timeline/Models/Http
parentc987364ce795c7f4fe837ad8c2a685558c25b0b5 (diff)
downloadtimeline-3591f59453846e235ce77e15adde6092dbbedac3.tar.gz
timeline-3591f59453846e235ce77e15adde6092dbbedac3.tar.bz2
timeline-3591f59453846e235ce77e15adde6092dbbedac3.zip
...
Diffstat (limited to 'BackEnd/Timeline/Models/Http')
-rw-r--r--BackEnd/Timeline/Models/Http/HttpTimelinePostCreateRequestContent.cs2
-rw-r--r--BackEnd/Timeline/Models/Http/HttpTimelinePostPatchRequest.cs39
2 files changed, 41 insertions, 0 deletions
diff --git a/BackEnd/Timeline/Models/Http/HttpTimelinePostCreateRequestContent.cs b/BackEnd/Timeline/Models/Http/HttpTimelinePostCreateRequestContent.cs
index f4b300a9..12ab407f 100644
--- a/BackEnd/Timeline/Models/Http/HttpTimelinePostCreateRequestContent.cs
+++ b/BackEnd/Timeline/Models/Http/HttpTimelinePostCreateRequestContent.cs
@@ -1,4 +1,5 @@
using System.ComponentModel.DataAnnotations;
+using Timeline.Models.Validation;
namespace Timeline.Models.Http
{
@@ -11,6 +12,7 @@ namespace Timeline.Models.Http
/// Type of post content.
/// </summary>
[Required]
+ [TimelinePostContentType]
public string Type { get; set; } = default!;
/// <summary>
/// If post is of text type, this is the text.
diff --git a/BackEnd/Timeline/Models/Http/HttpTimelinePostPatchRequest.cs b/BackEnd/Timeline/Models/Http/HttpTimelinePostPatchRequest.cs
new file mode 100644
index 00000000..3dface29
--- /dev/null
+++ b/BackEnd/Timeline/Models/Http/HttpTimelinePostPatchRequest.cs
@@ -0,0 +1,39 @@
+using System;
+using Timeline.Models.Validation;
+
+namespace Timeline.Models.Http
+{
+ /// <summary>
+ /// The model of changing post content.
+ /// </summary>
+ public class HttpTimelinePostPatchRequestContent
+ {
+ /// <summary>
+ /// The new type of the post. If null, old type is used. This field can't be used alone. Use it with corresponding fields to change post content.
+ /// </summary>
+ [TimelinePostContentType]
+ public string? Type { get; set; }
+ /// <summary>
+ /// The new text. Null for not change.
+ /// </summary>
+ public string? Text { get; set; }
+ /// <summary>
+ /// The new data. Null for not change.
+ /// </summary>
+ public string? Data { get; set; }
+ }
+
+ public class HttpTimelinePostPatchRequest
+ {
+ /// <summary>
+ /// Change the time. Null for not change.
+ /// </summary>
+ public DateTime? Time { get; set; }
+
+ /// <summary>
+ /// Change the color. Null for not change.
+ /// </summary>
+ [Color]
+ public string? Color { get; set; }
+ }
+}