From 056642f7059ecbeb7485bb7fac3d63a3dc1a590b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A4=D1=80=D0=BE=D0=BB=D0=BE=D0=B2?= Date: Wed, 11 Aug 2021 11:22:52 +0500 Subject: [PATCH] update api client --- src/services/api/services/TelemetryService.ts | 2 +- .../api/services/WellSectionService.ts | 34 ++++++++++++------- src/services/api/services/WellService.ts | 16 --------- 3 files changed, 22 insertions(+), 30 deletions(-) diff --git a/src/services/api/services/TelemetryService.ts b/src/services/api/services/TelemetryService.ts index 250a2bd..172fa7d 100644 --- a/src/services/api/services/TelemetryService.ts +++ b/src/services/api/services/TelemetryService.ts @@ -11,7 +11,7 @@ import { request as __request } from '../core/request'; export class TelemetryService { /** - * Принимает общую информацию по скважин�� + * Принимает общую информацию по скважине * @param uid Уникальный идентификатор отправителя * @param requestBody нформация об отправителе * @returns any Success diff --git a/src/services/api/services/WellSectionService.ts b/src/services/api/services/WellSectionService.ts index ba9950e..9c5ecb6 100644 --- a/src/services/api/services/WellSectionService.ts +++ b/src/services/api/services/WellSectionService.ts @@ -8,15 +8,23 @@ export class WellSectionService { /** * @param idWell + * @param skip + * @param take * @returns any Success * @throws ApiError */ public static async getAll( -idWell: string, +idWell: number, +skip: number, +take: number = 32, ): Promise { const result = await __request({ method: 'GET', - path: `/api/well/${idWell}`, + path: `/api/well/${idWell}/sections`, + query: { + 'skip': skip, + 'take': take, + }, }); return result.body; } @@ -28,30 +36,30 @@ idWell: string, * @throws ApiError */ public static async insert( -idWell: string, -requestBody?: WellSectionDto, +idWell: number, +requestBody?: Array, ): Promise { const result = await __request({ method: 'POST', - path: `/api/well/${idWell}`, + path: `/api/well/${idWell}/sections`, body: requestBody, }); return result.body; } /** - * @param id + * @param idSection * @param idWell * @returns any Success * @throws ApiError */ public static async get( -id: number, -idWell: string, +idSection: number, +idWell: number, ): Promise { const result = await __request({ method: 'GET', - path: `/api/well/${idWell}/${id}`, + path: `/api/well/${idWell}/sections/${idSection}`, }); return result.body; } @@ -65,12 +73,12 @@ idWell: string, */ public static async put( id: number, -idWell: string, +idWell: number, requestBody?: WellSectionDto, ): Promise { const result = await __request({ method: 'PUT', - path: `/api/well/${idWell}/${id}`, + path: `/api/well/${idWell}/sections/${id}`, body: requestBody, }); return result.body; @@ -84,11 +92,11 @@ requestBody?: WellSectionDto, */ public static async delete( id: number, -idWell: string, +idWell: number, ): Promise { const result = await __request({ method: 'DELETE', - path: `/api/well/${idWell}/${id}`, + path: `/api/well/${idWell}/sections/${id}`, }); return result.body; } diff --git a/src/services/api/services/WellService.ts b/src/services/api/services/WellService.ts index a12772e..c3c6290 100644 --- a/src/services/api/services/WellService.ts +++ b/src/services/api/services/WellService.ts @@ -3,7 +3,6 @@ /* eslint-disable */ import type { WellDto } from '../models/WellDto'; import type { WellOperationDto } from '../models/WellOperationDto'; -import type { WellSectionDto } from '../models/WellSectionDto'; import { request as __request } from '../core/request'; export class WellService { @@ -20,21 +19,6 @@ export class WellService { return result.body; } - /** - * @param idWell - * @returns WellSectionDto Success - * @throws ApiError - */ - public static async getSections( -idWell: number, -): Promise> { - const result = await __request({ - method: 'GET', - path: `/api/well/${idWell}/sections`, - }); - return result.body; - } - /** * @param idWell * @returns WellOperationDto Success