diff options
author | crupest <crupest@outlook.com> | 2021-02-13 15:46:02 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-02-13 15:46:02 +0800 |
commit | 4538aa0be40316a967d6fbcbc08bc9670b9bbcf0 (patch) | |
tree | 9a3b573c2325fa500b565f82f734bd7540f765c9 /BackEnd/Timeline/Controllers/BookmarkTimelineController.cs | |
parent | 01c3c5800f9b8a7b89d98b28ea748d496497c0b2 (diff) | |
download | timeline-4538aa0be40316a967d6fbcbc08bc9670b9bbcf0.tar.gz timeline-4538aa0be40316a967d6fbcbc08bc9670b9bbcf0.tar.bz2 timeline-4538aa0be40316a967d6fbcbc08bc9670b9bbcf0.zip |
feat: Add timeline manageable.
Diffstat (limited to 'BackEnd/Timeline/Controllers/BookmarkTimelineController.cs')
-rw-r--r-- | BackEnd/Timeline/Controllers/BookmarkTimelineController.cs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/BackEnd/Timeline/Controllers/BookmarkTimelineController.cs b/BackEnd/Timeline/Controllers/BookmarkTimelineController.cs index 16793de6..e2a08dcb 100644 --- a/BackEnd/Timeline/Controllers/BookmarkTimelineController.cs +++ b/BackEnd/Timeline/Controllers/BookmarkTimelineController.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Threading.Tasks;
+using Timeline.Entities;
using Timeline.Models.Http;
using Timeline.Models.Mapper;
using Timeline.Models.Validation;
@@ -28,6 +29,11 @@ namespace Timeline.Controllers _timelineMapper = timelineMapper;
}
+ private Task<List<HttpTimeline>> Map(List<TimelineEntity> timelines)
+ {
+ return _timelineMapper.MapToHttp(timelines, Url, this.GetOptionalUserId(), this.UserHasPermission(UserPermission.AllTimelineManagement));
+ }
+
/// <summary>
/// Get bookmark list in order.
/// </summary>
@@ -40,7 +46,7 @@ namespace Timeline.Controllers {
var ids = await _service.GetBookmarks(this.GetUserId());
var timelines = await _timelineService.GetTimelineList(ids);
- return await _timelineMapper.MapToHttp(timelines, Url, this.GetOptionalUserId());
+ return await Map(timelines);
}
/// <summary>
|