aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline
diff options
context:
space:
mode:
Diffstat (limited to 'BackEnd/Timeline')
-rw-r--r--BackEnd/Timeline/Models/Http/HttpTimeline.cs7
-rw-r--r--BackEnd/Timeline/Models/Http/HttpTimelinePost.cs14
-rw-r--r--BackEnd/Timeline/Services/Mapper/TimelineMapper.cs3
3 files changed, 21 insertions, 3 deletions
diff --git a/BackEnd/Timeline/Models/Http/HttpTimeline.cs b/BackEnd/Timeline/Models/Http/HttpTimeline.cs
index e3e46bd5..83398baf 100644
--- a/BackEnd/Timeline/Models/Http/HttpTimeline.cs
+++ b/BackEnd/Timeline/Models/Http/HttpTimeline.cs
@@ -10,11 +10,12 @@ namespace Timeline.Models.Http
{
public HttpTimeline() { }
- public HttpTimeline(string uniqueId, string title, string name, DateTime nameLastModifed, string description, HttpUser owner, TimelineVisibility visibility, List<HttpUser> members, string? color, DateTime createTime, DateTime lastModified, bool isHighlight, bool isBookmark, bool manageable, bool postable, HttpTimelineLinks links)
+ public HttpTimeline(string uniqueId, string title, string name, string nameV2, DateTime nameLastModifed, string description, HttpUser owner, TimelineVisibility visibility, List<HttpUser> members, string? color, DateTime createTime, DateTime lastModified, bool isHighlight, bool isBookmark, bool manageable, bool postable, HttpTimelineLinks links)
{
UniqueId = uniqueId;
Title = title;
Name = name;
+ NameV2 = nameV2;
NameLastModifed = nameLastModifed;
Description = description;
Owner = owner;
@@ -43,6 +44,10 @@ namespace Timeline.Models.Http
/// </summary>
public string Name { get; set; } = default!;
/// <summary>
+ /// Name of timeline.
+ /// </summary>
+ public string NameV2 { get; set; } = default!;
+ /// <summary>
/// Last modified time of timeline name.
/// </summary>
public DateTime NameLastModifed { get; set; } = default!;
diff --git a/BackEnd/Timeline/Models/Http/HttpTimelinePost.cs b/BackEnd/Timeline/Models/Http/HttpTimelinePost.cs
index 5e069821..5c6a7167 100644
--- a/BackEnd/Timeline/Models/Http/HttpTimelinePost.cs
+++ b/BackEnd/Timeline/Models/Http/HttpTimelinePost.cs
@@ -11,7 +11,7 @@ namespace Timeline.Models.Http
{
public HttpTimelinePost() { }
- public HttpTimelinePost(long id, List<HttpTimelinePostDataDigest> dataList, bool deleted, DateTime time, HttpUser? author, string? color, DateTime lastUpdated, string timelineName, bool editable)
+ public HttpTimelinePost(long id, List<HttpTimelinePostDataDigest> dataList, bool deleted, DateTime time, HttpUser? author, string? color, DateTime lastUpdated, string timelineOwnerV2, string timelineNameV2, string timelineName, bool editable)
{
Id = id;
DataList = dataList;
@@ -20,6 +20,8 @@ namespace Timeline.Models.Http
Author = author;
Color = color;
LastUpdated = lastUpdated;
+ TimelineOwnerV2 = timelineOwnerV2;
+ TimelineNameV2 = timelineNameV2;
TimelineName = timelineName;
Editable = editable;
}
@@ -27,7 +29,7 @@ namespace Timeline.Models.Http
/// <summary>
/// Post id.
/// </summary>
- public long Id { get; set; }
+ public long Id { get; set; }
/// <summary>
/// The data list.
/// </summary>
@@ -54,6 +56,14 @@ namespace Timeline.Models.Http
/// Last updated time.
/// </summary>
public DateTime LastUpdated { get; set; } = default!;
+ /// <summary>
+ /// Timeline owner username.
+ /// </summary>
+ public string TimelineOwnerV2 { get; set; } = default!;
+ /// <summary>
+ /// Timeline name.
+ /// </summary>
+ public string TimelineNameV2 { get; set; } = default!;
/// <summary>
/// Timeline name.
/// </summary>
diff --git a/BackEnd/Timeline/Services/Mapper/TimelineMapper.cs b/BackEnd/Timeline/Services/Mapper/TimelineMapper.cs
index 2a0ba89f..a59b906c 100644
--- a/BackEnd/Timeline/Services/Mapper/TimelineMapper.cs
+++ b/BackEnd/Timeline/Services/Mapper/TimelineMapper.cs
@@ -77,6 +77,7 @@ namespace Timeline.Services.Mapper
uniqueId: entity.UniqueId,
title: string.IsNullOrEmpty(entity.Title) ? timelineName : entity.Title,
name: timelineName,
+ nameV2: entity.Name is null ? "self" : entity.Name,
nameLastModifed: entity.NameLastModified,
description: entity.Description ?? "",
owner: await _userMapper.MapAsync(entity.Owner, urlHelper, user),
@@ -137,6 +138,8 @@ namespace Timeline.Services.Mapper
color: entity.Color,
deleted: entity.Deleted,
lastUpdated: entity.LastUpdated,
+ timelineOwnerV2: entity.Timeline.Owner.Username,
+ timelineNameV2: entity.Timeline.Name is null ? "self" : entity.Timeline.Name,
timelineName: CalculateTimelineName(entity.Timeline),
editable: editable
);