From b87abbb8ed0aa86a808b2f97e4d22b0ee1addd9f Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 29 Apr 2021 19:29:35 +0800 Subject: ... --- .../Services/Api/IHighlightTimelineService.cs | 61 ++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 BackEnd/Timeline/Services/Api/IHighlightTimelineService.cs (limited to 'BackEnd/Timeline/Services/Api/IHighlightTimelineService.cs') diff --git a/BackEnd/Timeline/Services/Api/IHighlightTimelineService.cs b/BackEnd/Timeline/Services/Api/IHighlightTimelineService.cs new file mode 100644 index 00000000..4f14d19b --- /dev/null +++ b/BackEnd/Timeline/Services/Api/IHighlightTimelineService.cs @@ -0,0 +1,61 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using Timeline.Services.Timeline; +using Timeline.Services.User; + +namespace Timeline.Services.Api +{ + /// + /// Service that controls highlight timeline. + /// + public interface IHighlightTimelineService + { + /// + /// Get all highlight timelines in order. + /// + /// Id list of all highlight timelines. + Task> GetHighlightTimelinesAsync(); + + /// + /// Check if a timeline is highlight timeline. + /// + /// Timeline id. + /// If true it will throw if timeline does not exist. + /// True if timeline is highlight. Otherwise false. + /// Thrown when timeline does not exist and is true. + Task IsHighlightTimelineAsync(long timelineId, bool checkTimelineExistence = true); + + /// + /// Add a timeline to highlight list. + /// + /// The timeline id. + /// The user id of operator. + /// True if timeline is actually added to highligh. False if it already is. + /// Thrown when timeline with given id does not exist. + /// Thrown when user with given operator id does not exist. + Task AddHighlightTimelineAsync(long timelineId, long? operatorId); + + /// + /// Remove a timeline from highlight list. + /// + /// The timeline id. + /// The user id of operator. + /// True if deletion is actually performed. Otherwise false (timeline was not in the list). + /// Thrown when timeline with given id does not exist. + /// Thrown when user with given operator id does not exist. + Task RemoveHighlightTimelineAsync(long timelineId, long? operatorId); + + /// + /// Move a highlight timeline to a new position. + /// + /// The timeline name. + /// The new position. Starts at 1. + /// Thrown when timeline with given id does not exist. + /// Thrown when given timeline is not a highlight timeline. + /// + /// If is smaller than 1. Then move the timeline to head. + /// If is bigger than total count. Then move the timeline to tail. + /// + Task MoveHighlightTimelineAsync(long timelineId, long newPosition); + } +} -- cgit v1.2.3