aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Controllers/BookmarkTimelineController.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-01-07 16:23:20 +0800
committercrupest <crupest@outlook.com>2021-01-07 16:23:20 +0800
commit7594a16e38304739487b053405153379faee6e58 (patch)
treebb99d1a24fffc9c4142219b9c25dc66e3d2b60d2 /BackEnd/Timeline/Controllers/BookmarkTimelineController.cs
parent97e094c97dc9ed79cf7daa0a93568e1933015bdd (diff)
downloadtimeline-7594a16e38304739487b053405153379faee6e58.tar.gz
timeline-7594a16e38304739487b053405153379faee6e58.tar.bz2
timeline-7594a16e38304739487b053405153379faee6e58.zip
史诗级重构!
Diffstat (limited to 'BackEnd/Timeline/Controllers/BookmarkTimelineController.cs')
-rw-r--r--BackEnd/Timeline/Controllers/BookmarkTimelineController.cs16
1 files changed, 8 insertions, 8 deletions
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;
}
/// <summary>
@@ -37,8 +36,9 @@ namespace Timeline.Controllers
[ProducesResponseType(401)]
public async Task<ActionResult<List<HttpTimeline>>> List()
{
- var bookmarks = await _service.GetBookmarks(this.GetUserId());
- return Ok(_mapper.Map<List<HttpTimeline>>(bookmarks));
+ var ids = await _service.GetBookmarks(this.GetUserId());
+ var timelines = await _timelineService.GetTimelineList(ids);
+ return Ok(timelines.MapToHttp(Url));
}
/// <summary>