forked from ddrilling/AsbCloudServer
114 lines
4.6 KiB
C#
114 lines
4.6 KiB
C#
using AsbCloudApp.Data;
|
||
using AsbCloudApp.Data.User;
|
||
using System.Collections.Generic;
|
||
using System.Threading;
|
||
using System.Threading.Tasks;
|
||
|
||
namespace AsbCloudApp.Services
|
||
{
|
||
/// <summary>
|
||
/// Программа бурения
|
||
/// </summary>
|
||
public interface IDrillingProgramService
|
||
{
|
||
/// <summary>
|
||
/// Получить пользователей доступных для назначения в публикаторы или акцепторы
|
||
/// </summary>
|
||
/// <param name="idWell"></param>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<IEnumerable<UserDto>> GetAvailableUsers(int idWell, CancellationToken token = default);
|
||
|
||
/// <summary>
|
||
/// Части программы бурения
|
||
/// </summary>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<IEnumerable<FileCategoryDto>> GetCategoriesAsync(CancellationToken token = default);
|
||
|
||
/// <summary>
|
||
/// Состояние программы бурения
|
||
/// </summary>
|
||
/// <param name="idWell"></param>
|
||
/// <param name="idUser"></param>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<DrillingProgramStateDto> GetStateAsync(int idWell, int idUser,
|
||
CancellationToken token = default);
|
||
|
||
/// <summary>
|
||
/// Загрузить файл
|
||
/// </summary>
|
||
/// <param name="idWell"></param>
|
||
/// <param name="idFileCategory"></param>
|
||
/// <param name="idUser"></param>
|
||
/// <param name="fileFullName"></param>
|
||
/// <param name="fileStream"></param>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<int> AddFile(int idWell, int idFileCategory, int idUser, string fileFullName, System.IO.Stream fileStream, CancellationToken token = default);
|
||
|
||
/// <summary>
|
||
/// Добавить часть программы бурения
|
||
/// </summary>
|
||
/// <param name="idWell"></param>
|
||
/// <param name="idFileCategories"></param>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<int> AddPartsAsync(int idWell, IEnumerable<int> idFileCategories, CancellationToken token = default);
|
||
|
||
/// <summary>
|
||
/// Удалить часть программы бурения
|
||
/// </summary>
|
||
/// <param name="idWell"></param>
|
||
/// <param name="idFileCategories"></param>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<int> RemovePartsAsync(int idWell, IEnumerable<int> idFileCategories, CancellationToken token = default);
|
||
|
||
/// <summary>
|
||
/// Назначить пользователю роль
|
||
/// </summary>
|
||
/// <param name="idWell"></param>
|
||
/// <param name="idFileCategory"></param>
|
||
/// <param name="idUser"></param>
|
||
/// <param name="idUserRole"></param>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<int> AddUserAsync(int idWell, int idFileCategory, int idUser, int idUserRole, CancellationToken token = default);
|
||
|
||
/// <summary>
|
||
/// Удалить пользователя
|
||
/// </summary>
|
||
/// <param name="idWell"></param>
|
||
/// <param name="idFileCategory"></param>
|
||
/// <param name="idUser"></param>
|
||
/// <param name="idUserRole"></param>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<int> RemoveUserAsync(int idWell, int idFileCategory, int idUser, int idUserRole, CancellationToken token = default);
|
||
|
||
/// <summary>
|
||
/// Добавить или изменить отметку для файла (согласование/отклонение)
|
||
/// </summary>
|
||
/// <param name="fileMarkDto"></param>
|
||
/// <param name="idUser"></param>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<int> AddOrReplaceFileMarkAsync(FileMarkDto fileMarkDto, int idUser, CancellationToken token);
|
||
|
||
/// <summary>
|
||
/// Удалить отметку с файла
|
||
/// </summary>
|
||
/// <param name="idFileMark"></param>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<int> MarkAsDeletedFileMarkAsync(int idFileMark, CancellationToken token);
|
||
|
||
/// <summary>
|
||
/// Сбросить ошибку формирования
|
||
/// </summary>
|
||
/// <param name="idWell"></param>
|
||
void ClearError(int idWell);
|
||
}
|
||
} |