update api client

This commit is contained in:
Фролов 2021-08-20 13:49:21 +05:00
parent d9969a7468
commit 43e69021d4
3 changed files with 23 additions and 1 deletions

View File

@ -8,4 +8,5 @@ export type FileInfoDto = {
idCategory?: number; idCategory?: number;
uploadDate?: string; uploadDate?: string;
authorName?: string | null; authorName?: string | null;
companyId?: number;
} }

View File

@ -38,6 +38,7 @@ requestBody?: any,
* @param idCategory id категории файла * @param idCategory id категории файла
* @param begin дата начала * @param begin дата начала
* @param end дата окончания * @param end дата окончания
* @param companies id компаний для фильтрации возвращаемых файлов
* @returns FileInfoDtoPaginationContainer Success * @returns FileInfoDtoPaginationContainer Success
* @throws ApiError * @throws ApiError
*/ */
@ -48,6 +49,7 @@ take: number = 32,
idCategory: number, idCategory: number,
begin?: string, begin?: string,
end?: string, end?: string,
companies?: Array<number>,
): Promise<FileInfoDtoPaginationContainer> { ): Promise<FileInfoDtoPaginationContainer> {
const result = await __request({ const result = await __request({
method: 'GET', method: 'GET',
@ -58,6 +60,7 @@ end?: string,
'idCategory': idCategory, 'idCategory': idCategory,
'begin': begin, 'begin': begin,
'end': end, 'end': end,
'companies': companies,
}, },
}); });
return result.body; return result.body;
@ -81,4 +84,22 @@ fileId: number,
return result.body; return result.body;
} }
/**
* Удаляет файл с диска на сервере
* @param idWell id скважины
* @param idFile id запрашиваемого файла
* @returns number Success
* @throws ApiError
*/
public static async delete(
idWell: number,
idFile: number,
): Promise<number> {
const result = await __request({
method: 'DELETE',
path: `/api/well/${idWell}/files/${idFile}`,
});
return result.body;
}
} }

View File

@ -44,7 +44,7 @@ sectionTypeIds?: Array<number>,
operationCategoryIds?: Array<number>, operationCategoryIds?: Array<number>,
begin?: string, begin?: string,
end?: string, end?: string,
skip: number = 0, skip: number,
take: number = 32, take: number = 32,
): Promise<WellOperationDtoPaginationContainer> { ): Promise<WellOperationDtoPaginationContainer> {
const result = await __request({ const result = await __request({