From 7594a16e38304739487b053405153379faee6e58 Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 7 Jan 2021 16:23:20 +0800 Subject: 史诗级重构! MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Timeline/Controllers/BookmarkTimelineController.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'BackEnd/Timeline/Controllers/BookmarkTimelineController.cs') diff --git a/BackEnd/Timeline/Controllers/BookmarkTimelineController.cs b/BackEnd/Timeline/Controllers/BookmarkTimelineController.cs index 9dff95f3..7412232d 100644 --- a/BackEnd/Timeline/Controllers/BookmarkTimelineController.cs +++ b/BackEnd/Timeline/Controllers/BookmarkTimelineController.cs @@ -1,9 +1,9 @@ -using AutoMapper; -using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; using System.Threading.Tasks; using Timeline.Models.Http; +using Timeline.Models.Mapper; using Timeline.Models.Validation; using Timeline.Services; using Timeline.Services.Exceptions; @@ -18,13 +18,12 @@ namespace Timeline.Controllers public class BookmarkTimelineController : Controller { private readonly IBookmarkTimelineService _service; + private readonly ITimelineService _timelineService; - private readonly IMapper _mapper; - - public BookmarkTimelineController(IBookmarkTimelineService service, IMapper mapper) + public BookmarkTimelineController(IBookmarkTimelineService service, ITimelineService timelineService) { _service = service; - _mapper = mapper; + _timelineService = timelineService; } /// @@ -37,8 +36,9 @@ namespace Timeline.Controllers [ProducesResponseType(401)] public async Task>> List() { - var bookmarks = await _service.GetBookmarks(this.GetUserId()); - return Ok(_mapper.Map>(bookmarks)); + var ids = await _service.GetBookmarks(this.GetUserId()); + var timelines = await _timelineService.GetTimelineList(ids); + return Ok(timelines.MapToHttp(Url)); } /// -- cgit v1.2.3