2024-07-04 11:02:45 +05:00
|
|
|
|
using AsbCloudApp.Data;
|
2023-04-20 15:01:19 +05:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using AsbCloudApp.Requests;
|
|
|
|
|
using AsbCloudApp.Services;
|
|
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
|
namespace AsbCloudApp.Repositories;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// репозиторий по работе с faq-вопросами
|
|
|
|
|
/// </summary>
|
|
|
|
|
public interface IFaqRepository
|
2023-04-20 15:01:19 +05:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2024-08-19 10:01:07 +05:00
|
|
|
|
/// Получить список вопросов
|
2023-04-20 15:01:19 +05:00
|
|
|
|
/// </summary>
|
2024-08-19 10:01:07 +05:00
|
|
|
|
/// <param name="request"></param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
Task<IEnumerable<FaqDto>> GetFilteredAsync(FaqRequest request, CancellationToken token);
|
2023-04-20 15:01:19 +05:00
|
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Добавить вопрос
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="faqDto"></param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
Task<int> InsertAsync(FaqDto faqDto, CancellationToken token);
|
2023-04-20 15:01:19 +05:00
|
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Обновить существующий вопрос
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="dto"></param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
Task<int> UpdateAsync(FaqDto dto, CancellationToken token);
|
2023-04-20 15:01:19 +05:00
|
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Объединить 2 вопроса в 1
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sourceId1">ключ первого вопроса, подлежащего объединению</param>
|
|
|
|
|
/// <param name="sourceId2">ключ второго вопроса, подлежащего объединению</param>
|
|
|
|
|
/// <param name="mergeQuestions">Флаг, объединять текст вопросов или нет</param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
Task<int> MergeAsync(int sourceId1, int sourceId2, bool mergeQuestions, CancellationToken token);
|
2023-04-20 15:01:19 +05:00
|
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Пометить вопрос по id как удаленный
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id"></param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
Task<int> MarkAsDeletedAsync(int id, CancellationToken token);
|
2023-04-21 11:22:39 +05:00
|
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Удалить вопрос по ключу
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id"></param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
Task<int> DeleteAsync(int id, CancellationToken token);
|
2023-04-20 15:01:19 +05:00
|
|
|
|
}
|