aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Models
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-01-31 15:42:52 +0800
committercrupest <crupest@outlook.com>2021-01-31 15:42:52 +0800
commit7f88e120aba0f218641084aca4f467ffd27981d9 (patch)
tree54b320b4f236ae55895f32a64dbbc61d0022c835 /BackEnd/Timeline/Models
parent607460b87376be19d9117cdd7be11883410d8691 (diff)
downloadtimeline-7f88e120aba0f218641084aca4f467ffd27981d9.tar.gz
timeline-7f88e120aba0f218641084aca4f467ffd27981d9.tar.bz2
timeline-7f88e120aba0f218641084aca4f467ffd27981d9.zip
...
Diffstat (limited to 'BackEnd/Timeline/Models')
-rw-r--r--BackEnd/Timeline/Models/Http/TimelineController.cs25
-rw-r--r--BackEnd/Timeline/Models/Mapper/TimelineMapper.cs4
2 files changed, 8 insertions, 21 deletions
diff --git a/BackEnd/Timeline/Models/Http/TimelineController.cs b/BackEnd/Timeline/Models/Http/TimelineController.cs
index 257076f0..79be1826 100644
--- a/BackEnd/Timeline/Models/Http/TimelineController.cs
+++ b/BackEnd/Timeline/Models/Http/TimelineController.cs
@@ -59,6 +59,12 @@ namespace Timeline.Models.Http
public class HttpTimelinePatchRequest
{
/// <summary>
+ /// New name. Null for not change.
+ /// </summary>
+ [TimelineName]
+ public string? Name { get; set; }
+
+ /// <summary>
/// New title. Null for not change.
/// </summary>
public string? Title { get; set; }
@@ -74,25 +80,6 @@ namespace Timeline.Models.Http
public TimelineVisibility? Visibility { get; set; }
}
- /// <summary>
- /// Change timeline name request model.
- /// </summary>
- public class HttpTimelineChangeNameRequest
- {
- /// <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!;
- }
-
public class HttpTimelineControllerAutoMapperProfile : Profile
{
public HttpTimelineControllerAutoMapperProfile()
diff --git a/BackEnd/Timeline/Models/Mapper/TimelineMapper.cs b/BackEnd/Timeline/Models/Mapper/TimelineMapper.cs
index 95418573..79a6fa1d 100644
--- a/BackEnd/Timeline/Models/Mapper/TimelineMapper.cs
+++ b/BackEnd/Timeline/Models/Mapper/TimelineMapper.cs
@@ -48,7 +48,7 @@ namespace Timeline.Models.Mapper
isBookmark: userId is not null && await _bookmarkTimelineService.IsBookmark(userId.Value, entity.Id, false, false),
links: new HttpTimelineLinks(
self: urlHelper.ActionLink(nameof(TimelineController.TimelineGet), nameof(TimelineController)[0..^nameof(Controller).Length], new { timeline = timelineName }),
- posts: urlHelper.ActionLink(nameof(TimelineController.PostListGet), nameof(TimelineController)[0..^nameof(Controller).Length], new { timeline = timelineName })
+ posts: urlHelper.ActionLink(nameof(TimelinePostController.PostList), nameof(TimelinePostController)[0..^nameof(Controller).Length], new { timeline = timelineName })
)
);
}
@@ -83,7 +83,7 @@ namespace Timeline.Models.Mapper
(
type: TimelinePostContentTypes.Image,
text: null,
- url: urlHelper.ActionLink(nameof(TimelineController.PostDataGet), nameof(TimelineController)[0..^nameof(Controller).Length], new { timeline = timelineName, post = entity.LocalId }),
+ url: urlHelper.ActionLink(nameof(TimelinePostController.PostDataGet), nameof(TimelinePostController)[0..^nameof(Controller).Length], new { timeline = timelineName, post = entity.LocalId }),
eTag: $"\"{entity.Content}\""
),
_ => throw new DatabaseCorruptedException(string.Format(CultureInfo.InvariantCulture, "Unknown timeline post type {0}.", entity.ContentType))