i'm sorry guys it's stupid commit...
This commit is contained in:
parent
77cfacb95e
commit
4b4739ce89
13 changed files with 174 additions and 1 deletions
|
|
@ -0,0 +1,40 @@
|
|||
using SurveyLib.Core.Models;
|
||||
using SurveyLib.Core.Repositories;
|
||||
using SurveyLib.Core.Services;
|
||||
|
||||
namespace SurveyBackend.Services.Services;
|
||||
|
||||
public class CompletionService : ICompletionService
|
||||
{
|
||||
private readonly ICompletionRepository _completionRepository;
|
||||
|
||||
public CompletionService(ICompletionRepository completionRepository)
|
||||
{
|
||||
_completionRepository = completionRepository;
|
||||
}
|
||||
|
||||
public async Task AddCompletionAsync(Completion completion)
|
||||
{
|
||||
// TODO: проверить существование опроса
|
||||
await _completionRepository.AddAsync(completion);
|
||||
}
|
||||
|
||||
public async Task UpdateCompletionAsync(Completion completion)
|
||||
{
|
||||
// TODO: лол а что вообще значит ОбновитьВыполнение, надо выпилить из SurveyLib
|
||||
await _completionRepository.UpdateAsync(completion);
|
||||
}
|
||||
|
||||
public async Task DeleteCompletionAsync(int id)
|
||||
{
|
||||
// TODO: да и удалять их как-то бессмысленно
|
||||
await _completionRepository.DeleteAsync(id);
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<Completion>> GetCompletionsBySurveyIdAsync(int surveyId)
|
||||
{
|
||||
// TODO: проверить существование опроса
|
||||
// TODO: проверить что запрашивает создатель (хз как)
|
||||
return await _completionRepository.GetCompletionsBySurveyIdAsync(surveyId);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue