aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Controllers/BookmarkTimelineController.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-01-07 20:12:00 +0800
committercrupest <crupest@outlook.com>2021-01-07 20:12:00 +0800
commit97e6ac51ac4df58cd1229e7974d2b846b192558a (patch)
tree73a1baa078fa7a38dcdbdd38620bba0ef6a1298f /BackEnd/Timeline/Controllers/BookmarkTimelineController.cs
parentd3c9d0a9335ac6df3e330172b1b1a8a219cbdbaf (diff)
downloadtimeline-97e6ac51ac4df58cd1229e7974d2b846b192558a.tar.gz
timeline-97e6ac51ac4df58cd1229e7974d2b846b192558a.tar.bz2
timeline-97e6ac51ac4df58cd1229e7974d2b846b192558a.zip
refactor: Make mapper a service. Fix #202.
Diffstat (limited to 'BackEnd/Timeline/Controllers/BookmarkTimelineController.cs')
-rw-r--r--BackEnd/Timeline/Controllers/BookmarkTimelineController.cs6
1 files changed, 4 insertions, 2 deletions
diff --git a/BackEnd/Timeline/Controllers/BookmarkTimelineController.cs b/BackEnd/Timeline/Controllers/BookmarkTimelineController.cs
index 7412232d..64cb8afa 100644
--- a/BackEnd/Timeline/Controllers/BookmarkTimelineController.cs
+++ b/BackEnd/Timeline/Controllers/BookmarkTimelineController.cs
@@ -19,11 +19,13 @@ namespace Timeline.Controllers
{
private readonly IBookmarkTimelineService _service;
private readonly ITimelineService _timelineService;
+ private readonly TimelineMapper _timelineMapper;
- public BookmarkTimelineController(IBookmarkTimelineService service, ITimelineService timelineService)
+ public BookmarkTimelineController(IBookmarkTimelineService service, ITimelineService timelineService, TimelineMapper timelineMapper)
{
_service = service;
_timelineService = timelineService;
+ _timelineMapper = timelineMapper;
}
/// <summary>
@@ -38,7 +40,7 @@ namespace Timeline.Controllers
{
var ids = await _service.GetBookmarks(this.GetUserId());
var timelines = await _timelineService.GetTimelineList(ids);
- return Ok(timelines.MapToHttp(Url));
+ return await _timelineMapper.MapToHttp(timelines, Url);
}
/// <summary>