From 03c8f8d3fc894700b182883c0a52f7d5309e1b44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A4=D1=80=D0=BE=D0=BB=D0=BE=D0=B2?= Date: Mon, 19 Jul 2021 16:18:34 +0500 Subject: [PATCH] update rest client --- src/services/api/index.ts | 9 ++ src/services/api/models/ClusterAnalysisDto.ts | 7 ++ src/services/api/models/ClusterDto.ts | 11 +++ src/services/api/models/DepositDto.ts | 11 +++ .../api/models/OperationDurationDto.ts | 8 ++ src/services/api/models/WellDepthToDayDto.ts | 9 ++ .../api/models/WellDepthToIntervalDto.ts | 8 ++ src/services/api/models/WellDto.ts | 2 + src/services/api/services/AnalyticsService.ts | 99 +++++++++++++++++++ src/services/api/services/ClusterService.ts | 42 ++++++++ src/services/api/services/DepositService.ts | 39 ++++++++ 11 files changed, 245 insertions(+) create mode 100644 src/services/api/models/ClusterAnalysisDto.ts create mode 100644 src/services/api/models/ClusterDto.ts create mode 100644 src/services/api/models/DepositDto.ts create mode 100644 src/services/api/models/OperationDurationDto.ts create mode 100644 src/services/api/models/WellDepthToDayDto.ts create mode 100644 src/services/api/models/WellDepthToIntervalDto.ts create mode 100644 src/services/api/services/AnalyticsService.ts create mode 100644 src/services/api/services/ClusterService.ts create mode 100644 src/services/api/services/DepositService.ts diff --git a/src/services/api/index.ts b/src/services/api/index.ts index 52c5279..6af8497 100644 --- a/src/services/api/index.ts +++ b/src/services/api/index.ts @@ -5,19 +5,28 @@ 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 { 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 { OperationDurationDto } from './models/OperationDurationDto'; export type { TelemetryInfoDto } from './models/TelemetryInfoDto'; export type { TelemetryMessageDto } from './models/TelemetryMessageDto'; export type { TelemetryUserDto } from './models/TelemetryUserDto'; 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 { AnalyticsService } from './services/AnalyticsService'; export { AuthService } from './services/AuthService'; +export { ClusterService } from './services/ClusterService'; export { DataService } from './services/DataService'; +export { DepositService } from './services/DepositService'; export { MessageService } from './services/MessageService'; export { ReportService } from './services/ReportService'; export { TelemetryService } from './services/TelemetryService'; diff --git a/src/services/api/models/ClusterAnalysisDto.ts b/src/services/api/models/ClusterAnalysisDto.ts new file mode 100644 index 0000000..82c311d --- /dev/null +++ b/src/services/api/models/ClusterAnalysisDto.ts @@ -0,0 +1,7 @@ +/* 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 new file mode 100644 index 0000000..f4270a6 --- /dev/null +++ b/src/services/api/models/ClusterDto.ts @@ -0,0 +1,11 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type ClusterDto = { + id?: number; + name?: string | null; + description?: string | null; + latitude?: number; + longitude?: number; +} \ No newline at end of file diff --git a/src/services/api/models/DepositDto.ts b/src/services/api/models/DepositDto.ts new file mode 100644 index 0000000..a605887 --- /dev/null +++ b/src/services/api/models/DepositDto.ts @@ -0,0 +1,11 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type DepositDto = { + id?: number; + name?: string | null; + description?: string | null; + latitude?: number; + longitude?: number; +} \ No newline at end of file diff --git a/src/services/api/models/OperationDurationDto.ts b/src/services/api/models/OperationDurationDto.ts new file mode 100644 index 0000000..7f061a0 --- /dev/null +++ b/src/services/api/models/OperationDurationDto.ts @@ -0,0 +1,8 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type OperationDurationDto = { + processName?: string | null; + duration?: number; +} \ No newline at end of file diff --git a/src/services/api/models/WellDepthToDayDto.ts b/src/services/api/models/WellDepthToDayDto.ts new file mode 100644 index 0000000..51cef5f --- /dev/null +++ b/src/services/api/models/WellDepthToDayDto.ts @@ -0,0 +1,9 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type WellDepthToDayDto = { + wellDepth?: number; + bitDepth?: number; + date?: string; +} \ No newline at end of file diff --git a/src/services/api/models/WellDepthToIntervalDto.ts b/src/services/api/models/WellDepthToIntervalDto.ts new file mode 100644 index 0000000..a92c110 --- /dev/null +++ b/src/services/api/models/WellDepthToIntervalDto.ts @@ -0,0 +1,8 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type WellDepthToIntervalDto = { + intervalStartDate?: string; + intervalDepthProgress?: number; +} \ No newline at end of file diff --git a/src/services/api/models/WellDto.ts b/src/services/api/models/WellDto.ts index c161219..17e0645 100644 --- a/src/services/api/models/WellDto.ts +++ b/src/services/api/models/WellDto.ts @@ -8,4 +8,6 @@ export type WellDto = { deposit?: string | null; id?: number; lastData?: any; + latitude?: number; + longitude?: number; } \ No newline at end of file diff --git a/src/services/api/services/AnalyticsService.ts b/src/services/api/services/AnalyticsService.ts new file mode 100644 index 0000000..e9d0d87 --- /dev/null +++ b/src/services/api/services/AnalyticsService.ts @@ -0,0 +1,99 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { OperationDurationDto } from '../models/OperationDurationDto'; +import type { WellDepthToDayDto } from '../models/WellDepthToDayDto'; +import type { WellDepthToIntervalDto } from '../models/WellDepthToIntervalDto'; +import { request as __request } from '../core/request'; + +export class AnalyticsService { + + /** + * Возвращает данные по скважине "глубина-день" + * @param wellId id скважины + * @returns WellDepthToDayDto Success + * @throws ApiError + */ + public static async getWellDepthToDay( +wellId: number, +): Promise> { + const result = await __request({ + method: 'GET', + path: `/api/analytics/${wellId}/wellDepthToDay`, + }); + return result.body; + } + + /** + * Возвращает данные по глубине скважины за период + * @param wellId id скважины + * @param intervalHoursTimestamp количество секунд в необходимом интервале времени + * @param workBeginTimestamp количество секунд в времени начала смены + * @returns WellDepthToIntervalDto Success + * @throws ApiError + */ + public static async getWellDepthToInterval( +wellId: number, +intervalHoursTimestamp?: number, +workBeginTimestamp?: number, +): Promise> { + const result = await __request({ + method: 'GET', + path: `/api/analytics/${wellId}/wellDepthToInterval`, + query: { + 'intervalHoursTimestamp': intervalHoursTimestamp, + 'workBeginTimestamp': workBeginTimestamp, + }, + }); + return result.body; + } + + /** + * Возвращает данные по операциям на скважине "операции-время" + * @param wellId id скважины + * @param begin дата начала интервала + * @param end дата окончания интервала + * @returns OperationDurationDto Success + * @throws ApiError + */ + public static async getOperationsSummary( +wellId: number, +begin?: string, +end?: string, +): Promise> { + const result = await __request({ + method: 'GET', + path: `/api/analytics/${wellId}/operationsSummary`, + query: { + 'begin': begin, + 'end': end, + }, + }); + return result.body; + } + + /** + * Возвращает детальные данные по операциям на скважине за период + * @param wellId id скважины + * @param intervalHoursTimestamp количество секунд в необходимом интервале времени + * @param workBeginTimestamp количество секунд в времени начала смены + * @returns OperationDurationDto Success + * @throws ApiError + */ + public static async getOperationsToInterval( +wellId: number, +intervalHoursTimestamp?: number, +workBeginTimestamp?: number, +): Promise> { + const result = await __request({ + method: 'GET', + path: `/api/analytics/${wellId}/operationsToInterval`, + query: { + 'intervalHoursTimestamp': intervalHoursTimestamp, + 'workBeginTimestamp': workBeginTimestamp, + }, + }); + return result.body; + } + +} \ No newline at end of file diff --git a/src/services/api/services/ClusterService.ts b/src/services/api/services/ClusterService.ts new file mode 100644 index 0000000..b31f270 --- /dev/null +++ b/src/services/api/services/ClusterService.ts @@ -0,0 +1,42 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { ClusterAnalysisDto } from '../models/ClusterAnalysisDto'; +import type { WellDto } from '../models/WellDto'; +import { request as __request } from '../core/request'; + +export class ClusterService { + + /** + * Получение доступных пользователю скважин + * @param clusterId + * @returns WellDto Success + * @throws ApiError + */ + public static async getWells( +clusterId: number, +): Promise> { + const result = await __request({ + method: 'GET', + path: `/api/Cluster/${clusterId}`, + }); + return result.body; + } + + /** + * Получение обопщенной аналитики по кусту (лучшая/худшая скважина) + * @param clusterId + * @returns ClusterAnalysisDto Success + * @throws ApiError + */ + public static async getAnalysis( +clusterId: number, +): Promise> { + const result = await __request({ + method: 'GET', + path: `/api/Cluster/${clusterId}/Analysis`, + }); + return result.body; + } + +} \ No newline at end of file diff --git a/src/services/api/services/DepositService.ts b/src/services/api/services/DepositService.ts new file mode 100644 index 0000000..ff64c74 --- /dev/null +++ b/src/services/api/services/DepositService.ts @@ -0,0 +1,39 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { ClusterDto } from '../models/ClusterDto'; +import type { DepositDto } from '../models/DepositDto'; +import { request as __request } from '../core/request'; + +export class DepositService { + + /** + * Получает список доступных пользователю месторождений + * @returns DepositDto Success + * @throws ApiError + */ + public static async getDeposits(): Promise> { + const result = await __request({ + method: 'GET', + path: `/api/Deposit`, + }); + return result.body; + } + + /** + * Получает список доступных пользователю кустов месторождения + * @param depositId + * @returns ClusterDto Success + * @throws ApiError + */ + public static async getClusters( +depositId: number, +): Promise> { + const result = await __request({ + method: 'GET', + path: `/api/Deposit/${depositId}`, + }); + return result.body; + } + +} \ No newline at end of file