You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
98 lines
4.6 KiB
98 lines
4.6 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Shared
|
|
{
|
|
public interface IQuoteService<TQuote>
|
|
{
|
|
// Retrieves the daily quote in a specified language.
|
|
// 'lang' is a language code.
|
|
Task<TQuote> GetDailyQuote(DateOnly date, int lang);
|
|
|
|
// Retrieves a specific quote by its unique identifier (id).
|
|
Task<TQuote> GetQuoteById(int id);
|
|
|
|
// Retrieves all available quotes in the system, without any filters.
|
|
Task<PaginationResult<TQuote>> GetAllQuote();
|
|
|
|
// Retrieves a page of some availble quote based on the index (pagination)
|
|
// 'index' is the starting point for pagination
|
|
// 'pageSize' determines the number of quotes per page
|
|
Task<PaginationResult<TQuote>> GetSomeQuote(int index, int pageSize);
|
|
|
|
// Retrieves all available quotes but filtered by language.
|
|
// 'lang' is a language code used to filter the quotes in the chosen language.
|
|
Task<PaginationResult<TQuote>> GetAllQuoteLang(int index, int pageSize, int lang);
|
|
|
|
// Retrieves all inavailable quotes but filtered by language.
|
|
// 'lang' is a language code used to filter the quotes in the chosen language.
|
|
Task<PaginationResult<TQuote>> GetInvalidQuote(int index, int pageSize, int lang);
|
|
// Retrieves a page of quote suggestions based on the index (pagination) and language.
|
|
// 'index' is the starting point for pagination
|
|
// 'pageSize' determines the number of quotes per page
|
|
// 'lang' specifies the language for the suggestions.
|
|
Task<PaginationResult<TQuote>> GetSuggestions(int index, int pageSize, int lang);
|
|
|
|
// Retrieves the favorite quotes of a specific user.
|
|
// 'index' is the starting point for pagination
|
|
// 'pageSize' determines the number of quotes per page
|
|
// 'UserId' is the identifier of the user to fetch their favorite quotes.
|
|
Task<PaginationResult<TQuote>> GetFavorites(int index, int pageSize, int UserId);
|
|
|
|
// Retrieves a page of valid quotes with pagination.
|
|
// 'index' is the current page
|
|
// 'pageSize' is the number of quotes per page.
|
|
Task<PaginationResult<TQuote>> GetValidQuote(int index, int pageSize);
|
|
|
|
// Retrieves a page of invalid quotes with pagination.
|
|
// 'index' is the current page
|
|
// 'pageSize' is the number of quotes per page.
|
|
Task<PaginationResult<TQuote>> GetInvalidQuote(int index, int pageSize);
|
|
|
|
|
|
// Searches for quotes based on content (text of the quote), with pagination and filtering by language.
|
|
// 'content' is the text of the quote
|
|
// 'index' is the current page
|
|
// 'pageSize' is the number of results per page
|
|
// 'lang' is the language code to filter the results.
|
|
Task<PaginationResult<TQuote>> SearchByContent(string content, int index, int pageSize, int lang);
|
|
|
|
// Searches for quotes by their source, with pagination and filtering by language.
|
|
// 'source' is the source of the quote
|
|
// 'index' is the current page
|
|
// 'pageSize' is the number of results per page
|
|
// 'lang' is the language code to filter the results.
|
|
Task<PaginationResult<TQuote>> SearchBySource(string source, int index, int pageSize, int lang);
|
|
|
|
// Searches for quotes related to a specific character, with pagination and filtering by language.
|
|
// 'character' refers to a name or role in the content
|
|
// 'index' is the current page
|
|
// 'pageSize' is the number of results per page,
|
|
// 'lang' is the language code to filter the results.
|
|
Task<PaginationResult<TQuote>> SearchByCharacter(string character, int index, int pageSize, int lang);
|
|
|
|
// Adds a new quote.
|
|
// 'quote' is the quote object that will be added.
|
|
Task AddQuote(TQuote quote);
|
|
|
|
// Updates an existing quote identified by 'quoteId' with new details.
|
|
// 'quoteId' is the ID of the quote to be updated
|
|
// 'quote' contains the new data.
|
|
Task UpdateQuote(int quoteId, TQuote quote);
|
|
|
|
// Removes a quote based on its unique identifier ('quoteId').
|
|
Task RemoveQuote(int quoteId);
|
|
|
|
// Retrieves the last ID.
|
|
Task<int> GetLastQuoteId();
|
|
|
|
// Validates or invalidates a quote based on the 'quoteId' and a boolean value ('isValidate').
|
|
// If 'isValidate' is true, the quote is marked as valid; if false, it is invalid.
|
|
Task ValidateQuote(int quoteId, bool isValidate);
|
|
|
|
}
|
|
}
|