From 13f56cda573233cab7d6f2210b24e963377c5089 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A4=D1=80=D0=BE=D0=BB=D0=BE=D0=B2?= Date: Thu, 22 Jul 2021 10:16:55 +0500 Subject: [PATCH] api client update --- src/services/api/index.ts | 7 ++- src/services/api/models/ClusterAnalysisDto.ts | 7 --- src/services/api/models/ClusterDto.ts | 6 +- src/services/api/models/ClusterStatDto.ts | 14 +++++ src/services/api/models/CompanyDto.ts | 9 +++ src/services/api/models/DataSaubBaseDto.ts | 2 + src/services/api/models/DepositDto.ts | 4 +- src/services/api/models/OperationDto.ts | 12 ++++ .../models/OperationDtoPaginationContainer.ts | 12 ++++ .../api/models/OperationDurationDto.ts | 2 +- src/services/api/models/UserTokenDto.ts | 2 +- src/services/api/models/WellDto.ts | 5 +- src/services/api/models/WellSectionDto.ts | 21 +++++++ src/services/api/models/WellStatDto.ts | 28 +++++++++ src/services/api/services/AnalyticsService.ts | 58 +++++++++++++++---- src/services/api/services/ClusterService.ts | 22 +++---- 16 files changed, 171 insertions(+), 40 deletions(-) delete mode 100644 src/services/api/models/ClusterAnalysisDto.ts create mode 100644 src/services/api/models/ClusterStatDto.ts create mode 100644 src/services/api/models/CompanyDto.ts create mode 100644 src/services/api/models/OperationDto.ts create mode 100644 src/services/api/models/OperationDtoPaginationContainer.ts create mode 100644 src/services/api/models/WellSectionDto.ts create mode 100644 src/services/api/models/WellStatDto.ts diff --git a/src/services/api/index.ts b/src/services/api/index.ts index 6af8497..9371e5f 100644 --- a/src/services/api/index.ts +++ b/src/services/api/index.ts @@ -5,14 +5,17 @@ export { ApiError } from './core/ApiError'; export { OpenAPI } from './core/OpenAPI'; export type { AuthDto } from './models/AuthDto'; -export type { ClusterAnalysisDto } from './models/ClusterAnalysisDto'; export type { ClusterDto } from './models/ClusterDto'; +export type { ClusterStatDto } from './models/ClusterStatDto'; +export type { CompanyDto } from './models/CompanyDto'; export type { DataSaubBaseDto } from './models/DataSaubBaseDto'; export type { DatesRangeDto } from './models/DatesRangeDto'; export type { DepositDto } from './models/DepositDto'; export type { EventDto } from './models/EventDto'; export type { MessageDto } from './models/MessageDto'; export type { MessageDtoPaginationContainer } from './models/MessageDtoPaginationContainer'; +export type { OperationDto } from './models/OperationDto'; +export type { OperationDtoPaginationContainer } from './models/OperationDtoPaginationContainer'; export type { OperationDurationDto } from './models/OperationDurationDto'; export type { TelemetryInfoDto } from './models/TelemetryInfoDto'; export type { TelemetryMessageDto } from './models/TelemetryMessageDto'; @@ -21,6 +24,8 @@ export type { UserTokenDto } from './models/UserTokenDto'; export type { WellDepthToDayDto } from './models/WellDepthToDayDto'; export type { WellDepthToIntervalDto } from './models/WellDepthToIntervalDto'; export type { WellDto } from './models/WellDto'; +export type { WellSectionDto } from './models/WellSectionDto'; +export type { WellStatDto } from './models/WellStatDto'; export { AnalyticsService } from './services/AnalyticsService'; export { AuthService } from './services/AuthService'; diff --git a/src/services/api/models/ClusterAnalysisDto.ts b/src/services/api/models/ClusterAnalysisDto.ts deleted file mode 100644 index 82c311d..0000000 --- a/src/services/api/models/ClusterAnalysisDto.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type ClusterAnalysisDto = { - id?: number; -} \ No newline at end of file diff --git a/src/services/api/models/ClusterDto.ts b/src/services/api/models/ClusterDto.ts index f4270a6..82b801d 100644 --- a/src/services/api/models/ClusterDto.ts +++ b/src/services/api/models/ClusterDto.ts @@ -4,8 +4,8 @@ export type ClusterDto = { id?: number; - name?: string | null; + caption?: string | null; description?: string | null; - latitude?: number; - longitude?: number; + latitude?: number | null; + longitude?: number | null; } \ No newline at end of file diff --git a/src/services/api/models/ClusterStatDto.ts b/src/services/api/models/ClusterStatDto.ts new file mode 100644 index 0000000..dc711bb --- /dev/null +++ b/src/services/api/models/ClusterStatDto.ts @@ -0,0 +1,14 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { WellStatDto } from './WellStatDto'; + +export type ClusterStatDto = { + id?: number; + caption?: string | null; + description?: string | null; + latitude?: number | null; + longitude?: number | null; + wellsStat?: Array | null; +} \ No newline at end of file diff --git a/src/services/api/models/CompanyDto.ts b/src/services/api/models/CompanyDto.ts new file mode 100644 index 0000000..fcd415a --- /dev/null +++ b/src/services/api/models/CompanyDto.ts @@ -0,0 +1,9 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type CompanyDto = { + id?: number; + caption?: string | null; + companyType?: string | null; +} \ No newline at end of file diff --git a/src/services/api/models/DataSaubBaseDto.ts b/src/services/api/models/DataSaubBaseDto.ts index 0a9e94f..e12e1c5 100644 --- a/src/services/api/models/DataSaubBaseDto.ts +++ b/src/services/api/models/DataSaubBaseDto.ts @@ -38,4 +38,6 @@ export type DataSaubBaseDto = { flow?: number | null; flowIdle?: number | null; flowDeltaLimitMax?: number | null; + idFeedRegulator?: number | null; + mseState?: number | null; } \ No newline at end of file diff --git a/src/services/api/models/DepositDto.ts b/src/services/api/models/DepositDto.ts index a605887..0cbaeec 100644 --- a/src/services/api/models/DepositDto.ts +++ b/src/services/api/models/DepositDto.ts @@ -6,6 +6,6 @@ export type DepositDto = { id?: number; name?: string | null; description?: string | null; - latitude?: number; - longitude?: number; + latitude?: number | null; + longitude?: number | null; } \ No newline at end of file diff --git a/src/services/api/models/OperationDto.ts b/src/services/api/models/OperationDto.ts new file mode 100644 index 0000000..9481988 --- /dev/null +++ b/src/services/api/models/OperationDto.ts @@ -0,0 +1,12 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type OperationDto = { + id?: number; + name?: string | null; + beginDate?: string; + endDate?: string; + startWellDepth?: number; + endWellDepth?: number; +} \ No newline at end of file diff --git a/src/services/api/models/OperationDtoPaginationContainer.ts b/src/services/api/models/OperationDtoPaginationContainer.ts new file mode 100644 index 0000000..64fcf00 --- /dev/null +++ b/src/services/api/models/OperationDtoPaginationContainer.ts @@ -0,0 +1,12 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { OperationDto } from './OperationDto'; + +export type OperationDtoPaginationContainer = { + skip?: number; + take?: number; + count?: number; + items?: Array | null; +} \ No newline at end of file diff --git a/src/services/api/models/OperationDurationDto.ts b/src/services/api/models/OperationDurationDto.ts index 7f061a0..5be7a04 100644 --- a/src/services/api/models/OperationDurationDto.ts +++ b/src/services/api/models/OperationDurationDto.ts @@ -3,6 +3,6 @@ /* eslint-disable */ export type OperationDurationDto = { - processName?: string | null; + operationName?: string | null; duration?: number; } \ No newline at end of file diff --git a/src/services/api/models/UserTokenDto.ts b/src/services/api/models/UserTokenDto.ts index 9b4db8f..1439c28 100644 --- a/src/services/api/models/UserTokenDto.ts +++ b/src/services/api/models/UserTokenDto.ts @@ -9,7 +9,7 @@ export type UserTokenDto = { surname?: string | null; patronymic?: string | null; id?: number; - customerName?: string | null; + companyName?: string | null; roleName?: string | null; token?: string | null; } \ No newline at end of file diff --git a/src/services/api/models/WellDto.ts b/src/services/api/models/WellDto.ts index 17e0645..e33d86b 100644 --- a/src/services/api/models/WellDto.ts +++ b/src/services/api/models/WellDto.ts @@ -8,6 +8,7 @@ export type WellDto = { deposit?: string | null; id?: number; lastData?: any; - latitude?: number; - longitude?: number; + latitude?: number | null; + longitude?: number | null; + wellType?: string | null; } \ No newline at end of file diff --git a/src/services/api/models/WellSectionDto.ts b/src/services/api/models/WellSectionDto.ts new file mode 100644 index 0000000..684e7e5 --- /dev/null +++ b/src/services/api/models/WellSectionDto.ts @@ -0,0 +1,21 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type WellSectionDto = { + sectionType?: string | null; + wellDepthPlan?: number; + wellDepthFact?: number; + buildDaysPlan?: number; + buildDaysFact?: number; + rateOfPenetrationPlan?: number; + rateOfPenetrationFact?: number; + routeSpeedPlan?: number; + routeSpeedFact?: number; + bhaUpSpeedPlan?: number; + bhaUpSpeedFact?: number; + bhaDownSpeedPlan?: number; + bhaDownSpeedFact?: number; + casingDownSpeedPlan?: number; + casingDownSpeedFact?: number; +} \ No newline at end of file diff --git a/src/services/api/models/WellStatDto.ts b/src/services/api/models/WellStatDto.ts new file mode 100644 index 0000000..18176e6 --- /dev/null +++ b/src/services/api/models/WellStatDto.ts @@ -0,0 +1,28 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { CompanyDto } from './CompanyDto'; +import type { WellSectionDto } from './WellSectionDto'; + +export type WellStatDto = { + caption?: string | null; + cluster?: string | null; + deposit?: string | null; + id?: number; + lastData?: any; + latitude?: number | null; + longitude?: number | null; + wellType?: string | null; + planStart?: string | null; + planEnd?: string | null; + factStart?: string | null; + factEnd?: string | null; + unProductiveDays?: number | null; + rateOfPenetrationPlan?: number | null; + rateOfPenetrationFact?: number | null; + routeSpeedPlan?: number | null; + routeSpeedFact?: number | null; + sections?: Array | null; + companies?: Array | null; +} \ No newline at end of file diff --git a/src/services/api/services/AnalyticsService.ts b/src/services/api/services/AnalyticsService.ts index e9d0d87..8c52822 100644 --- a/src/services/api/services/AnalyticsService.ts +++ b/src/services/api/services/AnalyticsService.ts @@ -1,6 +1,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +import type { OperationDtoPaginationContainer } from '../models/OperationDtoPaginationContainer'; import type { OperationDurationDto } from '../models/OperationDurationDto'; import type { WellDepthToDayDto } from '../models/WellDepthToDayDto'; import type { WellDepthToIntervalDto } from '../models/WellDepthToIntervalDto'; @@ -8,6 +9,39 @@ import { request as __request } from '../core/request'; export class AnalyticsService { + /** + * Возвращает список операций на скважине за все время + * @param wellId id скважины + * @param skip для пагинации кол-во записей пропустить + * @param take для пагинации кол-во записей + * @param categoryIds список категорий + * @param begin дата начала + * @param end окончание + * @returns OperationDtoPaginationContainer Success + * @throws ApiError + */ + public static async getOperationsByWell( +wellId: number, +skip: number, +take: number = 32, +categoryIds?: Array, +begin?: string, +end?: string, +): Promise { + const result = await __request({ + method: 'GET', + path: `/api/analytics/${wellId}/operationsByWell`, + query: { + 'skip': skip, + 'take': take, + 'categoryIds': categoryIds, + 'begin': begin, + 'end': end, + }, + }); + return result.body; + } + /** * Возвращает данные по скважине "глубина-день" * @param wellId id скважины @@ -27,22 +61,22 @@ wellId: number, /** * Возвращает данные по глубине скважины за период * @param wellId id скважины - * @param intervalHoursTimestamp количество секунд в необходимом интервале времени - * @param workBeginTimestamp количество секунд в времени начала смены + * @param intervalSeconds количество секунд в необходимом интервале времени + * @param workBeginSeconds количество секунд в времени начала смены * @returns WellDepthToIntervalDto Success * @throws ApiError */ public static async getWellDepthToInterval( wellId: number, -intervalHoursTimestamp?: number, -workBeginTimestamp?: number, +intervalSeconds?: number, +workBeginSeconds?: number, ): Promise> { const result = await __request({ method: 'GET', path: `/api/analytics/${wellId}/wellDepthToInterval`, query: { - 'intervalHoursTimestamp': intervalHoursTimestamp, - 'workBeginTimestamp': workBeginTimestamp, + 'intervalSeconds': intervalSeconds, + 'workBeginSeconds': workBeginSeconds, }, }); return result.body; @@ -75,22 +109,22 @@ end?: string, /** * Возвращает детальные данные по операциям на скважине за период * @param wellId id скважины - * @param intervalHoursTimestamp количество секунд в необходимом интервале времени - * @param workBeginTimestamp количество секунд в времени начала смены + * @param intervalSeconds количество секунд в необходимом интервале времени + * @param workBeginSeconds количество секунд в времени начала смены * @returns OperationDurationDto Success * @throws ApiError */ public static async getOperationsToInterval( wellId: number, -intervalHoursTimestamp?: number, -workBeginTimestamp?: number, +intervalSeconds?: number, +workBeginSeconds?: number, ): Promise> { const result = await __request({ method: 'GET', path: `/api/analytics/${wellId}/operationsToInterval`, query: { - 'intervalHoursTimestamp': intervalHoursTimestamp, - 'workBeginTimestamp': workBeginTimestamp, + 'intervalSeconds': intervalSeconds, + 'workBeginSeconds': workBeginSeconds, }, }); return result.body; diff --git a/src/services/api/services/ClusterService.ts b/src/services/api/services/ClusterService.ts index e839088..da970cc 100644 --- a/src/services/api/services/ClusterService.ts +++ b/src/services/api/services/ClusterService.ts @@ -1,8 +1,8 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { ClusterAnalysisDto } from '../models/ClusterAnalysisDto'; import type { ClusterDto } from '../models/ClusterDto'; +import type { ClusterStatDto } from '../models/ClusterStatDto'; import type { WellDto } from '../models/WellDto'; import { request as __request } from '../core/request'; @@ -23,32 +23,32 @@ export class ClusterService { /** * Получение доступных пользователю скважин - * @param clusterId + * @param idCluster * @returns WellDto Success * @throws ApiError */ public static async getWells( -clusterId: number, +idCluster: number, ): Promise> { const result = await __request({ method: 'GET', - path: `/api/cluster/${clusterId}`, + path: `/api/cluster/${idCluster}`, }); return result.body; } /** - * Получение обопщенной аналитики по кусту (лучшая/худшая скважина) - * @param clusterId - * @returns ClusterAnalysisDto Success + * Получение обопщенной статистики по кусту (лучшая/худшая скважина) + * @param idCluster + * @returns ClusterStatDto Success * @throws ApiError */ - public static async getAnalysis( -clusterId: number, -): Promise> { + public static async getStat( +idCluster: number, +): Promise { const result = await __request({ method: 'GET', - path: `/api/cluster/${clusterId}/Analysis`, + path: `/api/cluster/${idCluster}/Stat`, }); return result.body; }