From 57b95cf3c53c0248355ffa46214224cdba4bf79b Mon Sep 17 00:00:00 2001 From: crupest Date: Sat, 13 Feb 2021 15:46:02 +0800 Subject: feat: Add timeline manageable. --- BackEnd/Timeline/Controllers/BookmarkTimelineController.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'BackEnd/Timeline/Controllers/BookmarkTimelineController.cs') 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> Map(List timelines) + { + return _timelineMapper.MapToHttp(timelines, Url, this.GetOptionalUserId(), this.UserHasPermission(UserPermission.AllTimelineManagement)); + } + /// /// Get bookmark list in order. /// @@ -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); } /// -- cgit v1.2.3