aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Services/Api/ISearchService.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-04-29 19:29:35 +0800
committercrupest <crupest@outlook.com>2021-04-29 19:29:35 +0800
commitb87abbb8ed0aa86a808b2f97e4d22b0ee1addd9f (patch)
treebf8c16169dce15e78fd41c00a364b028771433e5 /BackEnd/Timeline/Services/Api/ISearchService.cs
parentb4c08ef8e7eb7d3f7d8a37d04fd478326cb75d2c (diff)
downloadtimeline-b87abbb8ed0aa86a808b2f97e4d22b0ee1addd9f.tar.gz
timeline-b87abbb8ed0aa86a808b2f97e4d22b0ee1addd9f.tar.bz2
timeline-b87abbb8ed0aa86a808b2f97e4d22b0ee1addd9f.zip
...
Diffstat (limited to 'BackEnd/Timeline/Services/Api/ISearchService.cs')
-rw-r--r--BackEnd/Timeline/Services/Api/ISearchService.cs33
1 files changed, 33 insertions, 0 deletions
diff --git a/BackEnd/Timeline/Services/Api/ISearchService.cs b/BackEnd/Timeline/Services/Api/ISearchService.cs
new file mode 100644
index 00000000..d8b4bb44
--- /dev/null
+++ b/BackEnd/Timeline/Services/Api/ISearchService.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Threading.Tasks;
+using Timeline.Entities;
+
+namespace Timeline.Services.Api
+{
+ public interface ISearchService
+ {
+ /// <summary>
+ /// Search timelines whose name or title contains query string.
+ /// </summary>
+ /// <param name="query">String to contain.</param>
+ /// <returns>Search results.</returns>
+ /// <exception cref="ArgumentNullException">Thrown when <paramref name="query"/> is null.</exception>
+ /// <exception cref="ArgumentException">Thrown when <paramref name="query"/> is empty.</exception>
+ /// <remarks>
+ /// Implementation should promise high score is at first.
+ /// </remarks>
+ Task<SearchResult<TimelineEntity>> SearchTimelineAsync(string query);
+
+ /// <summary>
+ /// Search users whose username or nickname contains query string.
+ /// </summary>
+ /// <param name="query">String to contain.</param>
+ /// <returns>Search results.</returns>
+ /// <exception cref="ArgumentNullException">Thrown when <paramref name="query"/> is null.</exception>
+ /// <exception cref="ArgumentException">Thrown when <paramref name="query"/> is empty.</exception>
+ /// <remarks>
+ /// Implementation should promise high score is at first.
+ /// </remarks>
+ Task<SearchResult<UserEntity>> SearchUserAsync(string query);
+ }
+}