From f4b3dfd9febf978711a2a3f2249190d6deb84bd5 Mon Sep 17 00:00:00 2001 From: ngfrolov Date: Tue, 9 Aug 2022 11:10:01 +0500 Subject: [PATCH] doc --- AsbCloudApp/Data/WellOperationDto.cs | 2 + AsbCloudApp/Services/IDailyReportService.cs | 42 ++++++++- AsbCloudApp/Services/IMessageService.cs | 22 +++++ .../Services/IOperationValueService.cs | 4 + .../Services/IOperationsStatService.cs | 38 ++++++++ AsbCloudApp/Services/IPaginationService.cs | 10 --- AsbCloudApp/Services/IReportService.cs | 42 +++++++++ .../Services/IReportsBackgroundQueue.cs | 11 --- AsbCloudApp/Services/IRequestTracker.cs | 45 ++++++++++ .../Services/IScheduleReportService.cs | 9 ++ AsbCloudApp/Services/IScheduleService.cs | 11 +++ AsbCloudApp/Services/ISetpointsService.cs | 42 +++++++++ AsbCloudApp/Services/ITelemetryDataService.cs | 21 +++++ AsbCloudApp/Services/ITelemetryService.cs | 78 +++++++++++++++++ AsbCloudApp/Services/ITelemetryTracker.cs | 25 ++++++ AsbCloudApp/Services/ITelemetryUserService.cs | 10 +++ AsbCloudApp/Services/ITimeZoneService.cs | 17 ++++ AsbCloudApp/Services/IUserRoleService.cs | 32 +++++++ AsbCloudApp/Services/IUserService.cs | 42 +++++++++ .../Services/IUserSettingsRepository.cs | 44 ++++++++++ AsbCloudApp/Services/IWellCompositeService.cs | 17 ++++ .../Services/IWellOperationImportService.cs | 20 +++++ AsbCloudApp/Services/IWellOperationService.cs | 63 ++++++++++++++ AsbCloudApp/Services/IWellService.cs | 86 ++++++++++++++++++- AsbCloudApp/Services/InstantDataRepository.cs | 2 +- 25 files changed, 709 insertions(+), 26 deletions(-) delete mode 100644 AsbCloudApp/Services/IPaginationService.cs delete mode 100644 AsbCloudApp/Services/IReportsBackgroundQueue.cs diff --git a/AsbCloudApp/Data/WellOperationDto.cs b/AsbCloudApp/Data/WellOperationDto.cs index 4c451d26..f5caebef 100644 --- a/AsbCloudApp/Data/WellOperationDto.cs +++ b/AsbCloudApp/Data/WellOperationDto.cs @@ -2,6 +2,8 @@ namespace AsbCloudApp.Data { + //todo: добавить валидацию + /// /// Операции на скважине (заведенные пользователем) /// diff --git a/AsbCloudApp/Services/IDailyReportService.cs b/AsbCloudApp/Services/IDailyReportService.cs index 28bc72fc..1b8a29d9 100644 --- a/AsbCloudApp/Services/IDailyReportService.cs +++ b/AsbCloudApp/Services/IDailyReportService.cs @@ -12,11 +12,51 @@ namespace AsbCloudApp.Services /// public interface IDailyReportService { - + /// + /// получить список сформированных рапортов по скважине за период времени + /// + /// + /// + /// + /// + /// Task> GetListAsync(int idWell, DateTime? v1, DateTime? v2, CancellationToken cancellationToken); + + /// + /// получить из БД или генерировать данные для суточного рапорта за указанную дату + /// + /// + /// + /// + /// Task GetOrGenerateAsync(int idWell, DateTime date, CancellationToken token); + + /// + /// Добавить новый рапорт + /// + /// + /// + /// + /// Task AddAsync(int idWell, DailyReportDto dto, CancellationToken token = default); + + /// + /// изменить данные для суточного рапорта + /// + /// + /// + /// + /// + /// Task UpdateAsync(int idWell, DateTime date, DailyReportDto dto, CancellationToken token = default); + + /// + /// Сформировать файл рапорта + /// + /// + /// + /// + /// Task MakeReportAsync(int idWell, DateTime date, CancellationToken token = default); } } diff --git a/AsbCloudApp/Services/IMessageService.cs b/AsbCloudApp/Services/IMessageService.cs index 98dc863d..0b2261a4 100644 --- a/AsbCloudApp/Services/IMessageService.cs +++ b/AsbCloudApp/Services/IMessageService.cs @@ -7,14 +7,36 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services { + /// + /// Сервис сообщений панели оператора + /// public interface IMessageService { + /// + /// Получить сообщения по параметрам + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Task> GetMessagesAsync(int idWell, IEnumerable categoryids = default, DateTime begin = default, DateTime end = default, string searchString = default, int skip = 0, int take = 32, CancellationToken token = default); + /// + /// Метод для сохранения сообщения от панели + /// + /// + /// + /// + /// Task InsertAsync(string uid, IEnumerable dtos, CancellationToken token); } diff --git a/AsbCloudApp/Services/IOperationValueService.cs b/AsbCloudApp/Services/IOperationValueService.cs index a35af223..da097507 100644 --- a/AsbCloudApp/Services/IOperationValueService.cs +++ b/AsbCloudApp/Services/IOperationValueService.cs @@ -2,6 +2,10 @@ namespace AsbCloudApp.Services { + // TODO: Remove this + /// + /// + /// public interface IOperationValueService : ICrudWellRelatedService { } diff --git a/AsbCloudApp/Services/IOperationsStatService.cs b/AsbCloudApp/Services/IOperationsStatService.cs index e1292855..6ceb76e1 100644 --- a/AsbCloudApp/Services/IOperationsStatService.cs +++ b/AsbCloudApp/Services/IOperationsStatService.cs @@ -5,12 +5,50 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services { + /// + /// Сервис расчета статистики по операциям вводимым вручную + /// public interface IOperationsStatService { + /// + /// Получить статистику МСП по кусту в котором находится скважина с IdWell + /// + /// + /// + /// Task GetRopStatAsync(int idWell, CancellationToken token); + + /// + /// Получить статистику по скважинам куста, которые доступны компании + /// + /// + /// + /// + /// Task GetStatClusterAsync(int idCluster, int idCompany, CancellationToken token = default); + + /// + /// получить статистику по скважине + /// + /// + /// + /// Task GetWellStatAsync(int idWell, CancellationToken token = default); + + /// + /// Получить данные для графика TVD + /// + /// + /// + /// Task>> GetTvdAsync(int idWell, CancellationToken token); + + /// + /// Получить статистику по набору скважин + /// + /// + /// + /// Task> GetWellsStatAsync(IEnumerable idWells, CancellationToken token); } } diff --git a/AsbCloudApp/Services/IPaginationService.cs b/AsbCloudApp/Services/IPaginationService.cs deleted file mode 100644 index 57195edb..00000000 --- a/AsbCloudApp/Services/IPaginationService.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Threading; -using System.Threading.Tasks; - -namespace AsbCloudApp.Services -{ - public interface IPaginationService - { - Task> GetPageAsync(int skip = 0, int take = 32, CancellationToken token = default); - } -} \ No newline at end of file diff --git a/AsbCloudApp/Services/IReportService.cs b/AsbCloudApp/Services/IReportService.cs index 0261e986..c66861b7 100644 --- a/AsbCloudApp/Services/IReportService.cs +++ b/AsbCloudApp/Services/IReportService.cs @@ -6,15 +6,57 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services { + /// + /// Сервис рапортов + /// public interface IReportService { + /// + /// категория рапорта + /// int ReportCategoryId { get; } + + // TODO: rename this method + /// + /// Поставить рапорт в очередь на формирование + /// + /// + /// + /// + /// + /// + /// + /// + /// string CreateReport(int idWell, int idUser, int stepSeconds, int format, DateTime begin, DateTime end, Action handleReportProgress); + + /// + /// Получить предполагаемый список страниц рапорта + /// + /// + /// + /// + /// + /// + /// int GetReportPagesCount(int idWell, DateTime begin, DateTime end, int stepSeconds, int format); + + /// + /// получить диапазон дат за которые есть данные + /// + /// + /// DatesRangeDto GetDatesRangeOrDefault(int idWell); + + /// + /// Список готовых рапортов + /// + /// + /// + /// Task> GetAllReportsByWellAsync(int idWell, CancellationToken token); } } diff --git a/AsbCloudApp/Services/IReportsBackgroundQueue.cs b/AsbCloudApp/Services/IReportsBackgroundQueue.cs deleted file mode 100644 index adc42c56..00000000 --- a/AsbCloudApp/Services/IReportsBackgroundQueue.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; - -namespace AsbCloudApp.Services -{ - public interface IReportsBackgroundQueue - { - int EnqueueTask(Action action); - - bool TryDequeue(out (Action action, int id) item); - } -} diff --git a/AsbCloudApp/Services/IRequestTracker.cs b/AsbCloudApp/Services/IRequestTracker.cs index f18d8b9f..48e09afd 100644 --- a/AsbCloudApp/Services/IRequestTracker.cs +++ b/AsbCloudApp/Services/IRequestTracker.cs @@ -4,14 +4,59 @@ using System.Collections.Generic; namespace AsbCloudApp.Services { + // TODO: make this nullable + + /// + /// Отслеживание и сбор статистики по запросам + /// public interface IRequerstTrackerService { + /// + /// Регистрирует новый запрос + /// + /// void RegisterRequest(RequestLogDto requestLog); + + /// + /// Регистрирует новый запрос, вызвавший ошибку на сервере + /// + /// + /// void RegisterRequestError(RequestLogDto requestLog, Exception ex); + + /// + /// все зарегистрированные запросы + /// + /// + /// IEnumerable GetAll(int take = -1); + + /// + /// запросы которые выполнялись быстро + /// + /// + /// IEnumerable GetFast(int take = -1); + + /// + /// запросы, которые выполнялись медленно + /// + /// + /// IEnumerable GetSlow(int take = -1); + + /// + /// запросы, которые завершились ошибкой + /// + /// + /// IEnumerable GetError(int take = -1); + + /// + /// Статистика посещений пользователей + /// + /// + /// IEnumerable GetUsersStat(int take = -1); } } diff --git a/AsbCloudApp/Services/IScheduleReportService.cs b/AsbCloudApp/Services/IScheduleReportService.cs index 0b0180d5..8b6ebcce 100644 --- a/AsbCloudApp/Services/IScheduleReportService.cs +++ b/AsbCloudApp/Services/IScheduleReportService.cs @@ -4,8 +4,17 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services { + /// + /// Сервис формирования Сетевого графика. + /// public interface IScheduleReportService { + /// + /// Сформировать. + /// + /// + /// + /// Task MakeReportAsync(int idWell, CancellationToken token = default); } } \ No newline at end of file diff --git a/AsbCloudApp/Services/IScheduleService.cs b/AsbCloudApp/Services/IScheduleService.cs index db892c18..4a0d9fb4 100644 --- a/AsbCloudApp/Services/IScheduleService.cs +++ b/AsbCloudApp/Services/IScheduleService.cs @@ -5,8 +5,19 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services { + /// + /// Сервис расписания смен бурильщика + /// public interface IScheduleService : ICrudWellRelatedService { + // TODO: this should be nullable. + /// + /// получить бурильщика по idWell и времени + /// + /// + /// + /// + /// Task GetDrillerAsync(int idWell, DateTime workTime, CancellationToken token); } } diff --git a/AsbCloudApp/Services/ISetpointsService.cs b/AsbCloudApp/Services/ISetpointsService.cs index 3b608683..cd80feef 100644 --- a/AsbCloudApp/Services/ISetpointsService.cs +++ b/AsbCloudApp/Services/ISetpointsService.cs @@ -5,13 +5,55 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services { + /// + /// Сервис рекомендаций новых уставок для панели оператора САУБ + /// public interface ISetpointsService { + /// + /// Добавить новый набор рекомендаций + /// + /// + /// + /// Task InsertAsync(SetpointsRequestDto setpoints, CancellationToken token); + + /// + /// Получить наборы уставок на скважине + /// + /// + /// + /// Task> GetAsync(int idWell, CancellationToken token); + + /// + /// Скачать новые рекомендации (скачивает панель оператора) + /// + /// + /// + /// Task> GetForPanelAsync(string uid, CancellationToken token); + + /// + /// Попробовать удалить (успешно, если панель еще не забрала уставки) + /// + /// + /// + /// Task TryDelete(int id, CancellationToken token); + + /// + /// отредактировать состояние набора рекомендаций + /// + /// + /// + /// Task UpdateStateAsync(SetpointsRequestDto setpointsRequestDto, CancellationToken token); + + /// + /// Список уставок для рекомендаций + /// + /// IEnumerable GetSetpointsNames(); } } diff --git a/AsbCloudApp/Services/ITelemetryDataService.cs b/AsbCloudApp/Services/ITelemetryDataService.cs index 3e34e202..6b0020ba 100644 --- a/AsbCloudApp/Services/ITelemetryDataService.cs +++ b/AsbCloudApp/Services/ITelemetryDataService.cs @@ -6,12 +6,33 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services { + /// + /// сервис данных тех. процесса + /// + /// public interface ITelemetryDataService where TDto : ITelemetryData { + + /// + /// получить данные тех. процесса + /// + /// + /// + /// + /// кол-во элементов до которых эти данные прореживаются + /// + /// Task> GetAsync(int idWell, DateTime dateBegin = default, double intervalSec = 600d, int approxPointsCount = 1024, CancellationToken token = default); + /// + /// добавить/изменить данные тех. процесса (используется панелью) + /// + /// + /// + /// + /// Task UpdateDataAsync(string uid, IEnumerable dtos, CancellationToken token = default); } } \ No newline at end of file diff --git a/AsbCloudApp/Services/ITelemetryService.cs b/AsbCloudApp/Services/ITelemetryService.cs index b177f383..0975d0cf 100644 --- a/AsbCloudApp/Services/ITelemetryService.cs +++ b/AsbCloudApp/Services/ITelemetryService.cs @@ -7,18 +7,89 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services { + /// + /// Сервис телеметрии + /// public interface ITelemetryService { + /// + /// сервис временных зон + /// ITimezoneService TimeZoneService { get; } + + /// + /// трекер запросов + /// ITelemetryTracker TelemetryTracker { get; } + + /// + /// получить idWell по uid телеметрии + /// + /// + /// int? GetIdWellByTelemetryUid(string uid); + + /// + /// Получить id телеметрии. Если её нет в БД, то добавить новую. + /// + /// + /// int GetOrCreateTelemetryIdByUid(string uid); + + /// + /// получить временную зону скважины по idTelemetry + /// + /// + /// SimpleTimezoneDto GetTimezone(int idTelemetry); + + // TODO: вероятно лишнее + /// + /// Список передающих в данный момент телеметрий + /// + /// IEnumerable GetTransmittingTelemetries(); + + // TODO: вероятно лишнее + /// + /// Получить дату получения последних данных + /// + /// + /// + /// DateTime GetLastTelemetryDate(int idTelemetry, bool useUtc = false); + + /// + /// получить idTelemetry по IdWell + /// + /// + /// int? GetIdTelemetryByIdWell(int idWell); + + /// + /// получить диапазон дат за которые есть данные + /// + /// + /// DatesRangeDto GetDatesRange(int idTelemetry); + + /// + /// обновить данные о телеметрии (используется панелью) + /// + /// + /// + /// + /// Task UpdateInfoAsync(string uid, TelemetryInfoDto info, CancellationToken token); + + // TODO: вероятно лишнее + /// + /// обновить данные о временной зоне (используется панелью) + /// + /// + /// + /// + /// Task UpdateTimezoneAsync(string uid, SimpleTimezoneDto telemetryTimeZoneInfo, CancellationToken token); /// @@ -29,6 +100,13 @@ namespace AsbCloudApp.Services /// /// Task MergeAsync(int from, int to, CancellationToken token); + + // TODO: вероятно лишнее + /// + /// сохранить данные о запросе + /// + /// + /// void SaveRequestDate(string uid, DateTimeOffset remoteDate); } } \ No newline at end of file diff --git a/AsbCloudApp/Services/ITelemetryTracker.cs b/AsbCloudApp/Services/ITelemetryTracker.cs index 73a98d93..ae9acb80 100644 --- a/AsbCloudApp/Services/ITelemetryTracker.cs +++ b/AsbCloudApp/Services/ITelemetryTracker.cs @@ -4,11 +4,36 @@ using System.Collections.Generic; namespace AsbCloudApp.Services { + /// + /// Сервис статистики телеметрии + /// public interface ITelemetryTracker { + /// + /// получить дату последней отправки данных панелью + /// + /// + /// DateTimeOffset GetLastTelemetryDateByUid(string uid); + + /// + /// получить диапазон дат за которые есть данные по телеметрии + /// + /// + /// DatesRangeDto GetTelemetryDateRangeByUid(string uid); + + /// + /// список передающих телеметрий + /// + /// IEnumerable GetTransmittingTelemetriesUids(); + + /// + /// обновить статистику по телеметрии + /// + /// + /// void SaveRequestDate(string uid, DateTimeOffset remoteDate); } } diff --git a/AsbCloudApp/Services/ITelemetryUserService.cs b/AsbCloudApp/Services/ITelemetryUserService.cs index 1e904197..aa529634 100644 --- a/AsbCloudApp/Services/ITelemetryUserService.cs +++ b/AsbCloudApp/Services/ITelemetryUserService.cs @@ -5,8 +5,18 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services { + /// + /// сервис пользователей телеметрии + /// public interface ITelemetryUserService { + /// + /// получает и сохраняет/обновляет список пользователей панели оператора + /// + /// + /// + /// + /// Task UpsertAsync(string uid, IEnumerable dtos, CancellationToken token = default); } } \ No newline at end of file diff --git a/AsbCloudApp/Services/ITimeZoneService.cs b/AsbCloudApp/Services/ITimeZoneService.cs index 23fd9e5e..3eae4ca7 100644 --- a/AsbCloudApp/Services/ITimeZoneService.cs +++ b/AsbCloudApp/Services/ITimeZoneService.cs @@ -4,9 +4,26 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services { + /// + /// сервис определения временной зоны + /// public interface ITimezoneService { + /// + /// по координатам + /// + /// + /// + /// SimpleTimezoneDto GetByCoordinates(double latitude, double longitude); + + /// + /// по координатам + /// + /// + /// + /// + /// Task GetByCoordinatesAsync(double latitude, double longitude, CancellationToken token); } } \ No newline at end of file diff --git a/AsbCloudApp/Services/IUserRoleService.cs b/AsbCloudApp/Services/IUserRoleService.cs index 3d5a7ec3..8235bbe6 100644 --- a/AsbCloudApp/Services/IUserRoleService.cs +++ b/AsbCloudApp/Services/IUserRoleService.cs @@ -5,11 +5,43 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services { + /// + /// Репозиторий ролей пользователя + /// public interface IUserRoleService : ICrudService { + // todo: скорее всего не используется + /// + /// + /// + /// + /// + /// Task GetByNameAsync(string name, CancellationToken token = default); + + // todo: переименовать + /// + /// получить dto по названиям + /// + /// + /// + /// Task> GetByNamesAsync(IEnumerable names, CancellationToken token = default); + + /// + /// получить все вложенные разрешения + /// + /// + /// + /// IEnumerable GetNestedById(int id, int counter = 10); + + /// + /// определяет содержится ли разрешение в одной из указанных ролей + /// + /// + /// + /// bool HasPermission(IEnumerable rolesIds, string permissionName); } } \ No newline at end of file diff --git a/AsbCloudApp/Services/IUserService.cs b/AsbCloudApp/Services/IUserService.cs index 6496b144..8c5b8bb1 100644 --- a/AsbCloudApp/Services/IUserService.cs +++ b/AsbCloudApp/Services/IUserService.cs @@ -3,13 +3,55 @@ using System.Collections.Generic; namespace AsbCloudApp.Services { + /// + /// Сервис пользователей + /// public interface IUserService : ICrudService { + /// + /// Сервис ролей + /// IUserRoleService RoleService { get; } + + /// + /// Получить список всех прав пользователя (включая наследование групп) + /// + /// + /// IEnumerable GetNestedPermissions(int idUser); + + /// + /// Получить список ролей пользователя (включая наследование) + /// + /// + /// + /// IEnumerable GetRolesByIdUser(int idUser, int nestedLevel = 0); + + // TODO: скорее всего не используется + /// + /// + /// + /// + /// + /// bool HasAnyRoleOf(int idUser, IEnumerable roleNames); + + // TODO: скорее всего не используется + /// + /// + /// + /// + /// + /// bool HasAnyRoleOf(int idUser, IEnumerable roleIds); + + /// + /// определяет есть ли у пользователя указанное разрешение + /// + /// + /// + /// public bool HasPermission(int idUser, string permissionName); } } diff --git a/AsbCloudApp/Services/IUserSettingsRepository.cs b/AsbCloudApp/Services/IUserSettingsRepository.cs index 218b23f3..37c222ef 100644 --- a/AsbCloudApp/Services/IUserSettingsRepository.cs +++ b/AsbCloudApp/Services/IUserSettingsRepository.cs @@ -3,13 +3,57 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services { + /// + /// репозиторий для личных настроек пользователя + /// public interface IUserSettingsRepository { + /// + /// код ошибки: ключ не найден + /// public const int ErrorKeyNotFound = -1; + + /// + /// код ошибки: ключ уже занят + /// public const int ErrorKeyIsUsed = -2; + + /// + /// Получить настройки по ключу для пользователя + /// + /// + /// + /// + /// Task GetOrDefaultAsync(int userId, string key, CancellationToken token); + + /// + /// Добавить настройки с ключем для пользователя + /// + /// + /// + /// + /// + /// Task InsertAsync(int userId, string key, object value, CancellationToken token); + + /// + /// Отредактировать настройки с ключем для пользователя + /// + /// + /// + /// + /// + /// Task UpdateAsync(int userId, string key, object value, CancellationToken token); + + /// + /// Удалить настройки с ключем для пользователя + /// + /// + /// + /// + /// Task DeleteAsync(int userId, string key, CancellationToken token); } } \ No newline at end of file diff --git a/AsbCloudApp/Services/IWellCompositeService.cs b/AsbCloudApp/Services/IWellCompositeService.cs index 0e0be853..80088619 100644 --- a/AsbCloudApp/Services/IWellCompositeService.cs +++ b/AsbCloudApp/Services/IWellCompositeService.cs @@ -5,9 +5,26 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services { + /// + /// Сервис создания композитной скважины + /// public interface IWellCompositeService { + /// + /// Получить секции композитной скважины + /// + /// + /// + /// Task> GetAsync(int idWell, CancellationToken cancellationToken); + + /// + /// сохранить секции композитной скважины + /// + /// + /// + /// + /// Task SaveAsync(int idWell, IEnumerable wellComposites, CancellationToken token); } } diff --git a/AsbCloudApp/Services/IWellOperationImportService.cs b/AsbCloudApp/Services/IWellOperationImportService.cs index e0f2e39d..5199d0a7 100644 --- a/AsbCloudApp/Services/IWellOperationImportService.cs +++ b/AsbCloudApp/Services/IWellOperationImportService.cs @@ -2,10 +2,30 @@ namespace AsbCloudApp.Services { + /// + /// сервис импорта/экспорта операций по скважине вводимых вручную + /// public interface IWellOperationImportService { + /// + /// скачать в excel + /// + /// + /// Stream Export(int idWell); + + /// + /// скачать шаблон для заполнения + /// + /// Stream GetExcelTemplateStream(); + + /// + /// закгрузить из excel список операций + /// + /// + /// + /// Очистить старые перед импортом (если файл проходит валидацию) void Import(int idWell, Stream stream, bool deleteWellOperationsBeforeImport = false); } } \ No newline at end of file diff --git a/AsbCloudApp/Services/IWellOperationService.cs b/AsbCloudApp/Services/IWellOperationService.cs index d3d3a310..283bc150 100644 --- a/AsbCloudApp/Services/IWellOperationService.cs +++ b/AsbCloudApp/Services/IWellOperationService.cs @@ -6,10 +6,33 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services { + /// + /// сервис операций по скважине + /// public interface IWellOperationService { + /// + /// список названий операций + /// + /// IEnumerable GetCategories(); + // TODO: объединить параметры в объект запроса + /// + /// Получить список операций + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Task> GetOperationsAsync( int idWell, int? operationType = null, @@ -23,16 +46,56 @@ namespace AsbCloudApp.Services int take = 32, CancellationToken token = default); + /// + /// Получить операцию по id + /// + /// + /// + /// Task GetAsync(int id, CancellationToken token); + //todo: idWell Не нужен + /// + /// Добавить несколько операций за один раз + /// + /// + /// + /// + /// Task InsertRangeAsync(int idWell, IEnumerable wellOperationDtos, CancellationToken token); + //todo: id Не нужны + /// + /// Обновить существующую операцию + /// + /// + /// + /// + /// + /// Task UpdateAsync(int idWell, int idOperation, WellOperationDto item, CancellationToken token); + /// + /// Удалить операции по id + /// + /// + /// + /// Task DeleteAsync(IEnumerable ids, CancellationToken token); + + /// + /// Список секций + /// + /// IDictionary GetSectionTypes(); + + /// + /// дата/время первой операции по скважине + /// + /// + /// DateTimeOffset? FirstOperationDate(int idWell); } } diff --git a/AsbCloudApp/Services/IWellService.cs b/AsbCloudApp/Services/IWellService.cs index b655566a..5ec2b1ea 100644 --- a/AsbCloudApp/Services/IWellService.cs +++ b/AsbCloudApp/Services/IWellService.cs @@ -6,21 +6,101 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services { + /// + /// сервис скважин + /// public interface IWellService : ICrudService { + /// + /// сервис телеметрии + /// ITelemetryService TelemetryService { get; } + /// + /// Список скважин доступных компании + /// + /// + /// + /// Task> GetWellsByCompanyAsync(int idCompany, CancellationToken token); + + /// + /// проверяет доступ к скважине для компании + /// + /// + /// + /// + /// Task IsCompanyInvolvedInWellAsync(int idCompany, int idWell, CancellationToken token); - Task GetWellCaptionByIdAsync(int idWell, CancellationToken token); - //TODO: remove that - Task> GetCompaniesAsync(int idWell, CancellationToken token); + + /// + /// проверяет доступ к скважине для компании + /// + /// + /// + /// bool IsCompanyInvolvedInWell(int idCompany, int idWell); + + /// + /// получить название скважины по id + /// + /// + /// + /// + Task GetWellCaptionByIdAsync(int idWell, CancellationToken token); + + //TODO: remove that + /// + /// + /// + /// + /// + /// + Task> GetCompaniesAsync(int idWell, CancellationToken token); + + //TODO: remove that + /// + /// + /// + /// + /// string GetStateText(int state); + + /// + /// дата получения последних данных от панели + /// + /// + /// DateTimeOffset GetLastTelemetryDate(int idWell); + + //TODO: выяснить и удалить отсюда + /// + /// получение списка скважин куста в котором находится указанная скважина + /// + /// + /// + /// Task> GetClusterWellsIdsAsync(int idWell, CancellationToken token); + + /// + /// часовой пояс скважины + /// + /// + /// SimpleTimezoneDto GetTimezone(int idWell); + + /// + /// диапазон дат с данными телеметрии + /// + /// + /// DatesRangeDto GetDatesRange(int idWell); + + /// + /// Проверить задан ли у скважины часовой пояс и задать его если он не задан + /// + /// + /// Task EnshureTimezonesIsSetAsync(CancellationToken token); } } diff --git a/AsbCloudApp/Services/InstantDataRepository.cs b/AsbCloudApp/Services/InstantDataRepository.cs index 8c3b217f..d58e602e 100644 --- a/AsbCloudApp/Services/InstantDataRepository.cs +++ b/AsbCloudApp/Services/InstantDataRepository.cs @@ -4,7 +4,7 @@ using System.Collections.Concurrent; namespace AsbCloudApp.Services { /// - /// + /// Репозиторий для хранения в оперативке данных (от панели) /// public class InstantDataRepository : ConcurrentDictionary> {