From b87abbb8ed0aa86a808b2f97e4d22b0ee1addd9f Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 29 Apr 2021 19:29:35 +0800 Subject: ... --- .../Services/Api/IBookmarkTimelineService.cs | 64 ++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 BackEnd/Timeline/Services/Api/IBookmarkTimelineService.cs (limited to 'BackEnd/Timeline/Services/Api/IBookmarkTimelineService.cs') diff --git a/BackEnd/Timeline/Services/Api/IBookmarkTimelineService.cs b/BackEnd/Timeline/Services/Api/IBookmarkTimelineService.cs new file mode 100644 index 00000000..18feee54 --- /dev/null +++ b/BackEnd/Timeline/Services/Api/IBookmarkTimelineService.cs @@ -0,0 +1,64 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using Timeline.Services.Timeline; +using Timeline.Services.User; + +namespace Timeline.Services.Api +{ + /// + /// Service interface that manages timeline bookmarks. + /// + public interface IBookmarkTimelineService + { + /// + /// Get bookmarks of a user. + /// + /// User id of bookmark owner. + /// Id of Bookmark timelines in order. + /// Thrown when user does not exist. + Task> GetBookmarksAsync(long userId); + + /// + /// Check if a timeline is a bookmark. + /// + /// The user id. + /// Timeline id. + /// If true it will throw when user does not exist. + /// If true it will throw when timeline does not exist. + /// True if timeline is a bookmark. Otherwise false. + /// Throw if user does not exist and is true. + /// Thrown if timeline does not exist and is true. + Task IsBookmarkAsync(long userId, long timelineId, bool checkUserExistence = true, bool checkTimelineExistence = true); + + /// + /// Add a bookmark to tail to a user. + /// + /// User id of bookmark owner. + /// Timeline id. + /// True if timeline is added to bookmark. False if it already is. + /// Thrown when user does not exist. + /// Thrown when timeline does not exist. + Task AddBookmarkAsync(long userId, long timelineId); + + /// + /// Remove a bookmark from a user. + /// + /// User id of bookmark owner. + /// Timeline id. + /// True if deletion is performed. False if bookmark does not exist. + /// Thrown when user does not exist. + /// Thrown when timeline does not exist. + Task RemoveBookmarkAsync(long userId, long timelineId); + + /// + /// Move bookmark to a new position. + /// + /// User id of bookmark owner. + /// Timeline name. + /// New position. Starts at 1. + /// Thrown when user does not exist. + /// Thrown when timeline does not exist. + /// Thrown when the timeline is not a bookmark. + Task MoveBookmarkAsync(long userId, long timelineId, long newPosition); + } +} -- cgit v1.2.3