From 700dbe21549e4c3f194b1b84795ada81863d5012 Mon Sep 17 00:00:00 2001 From: KharchenkoVV Date: Fri, 10 Sep 2021 15:24:55 +0500 Subject: [PATCH] Api methods and Dtos update --- src/services/api/index.ts | 9 ++ src/services/api/models/TelemetryDto.ts | 11 +++ src/services/api/models/UserRoleDto.ts | 11 +++ src/services/api/models/WellDto.ts | 3 + .../api/services/AdminClusterService.ts | 99 +++++++++++++++++++ .../api/services/AdminCompanyService.ts | 99 +++++++++++++++++++ .../api/services/AdminDepositService.ts | 99 +++++++++++++++++++ .../api/services/AdminTelemetryService.ts | 99 +++++++++++++++++++ .../api/services/AdminUserRoleService.ts | 99 +++++++++++++++++++ src/services/api/services/AdminUserService.ts | 99 +++++++++++++++++++ src/services/api/services/AdminWellService.ts | 99 +++++++++++++++++++ src/services/api/services/AuthService.ts | 37 +++++++ src/services/api/services/FileService.ts | 2 +- .../api/services/TelemetryAnalyticsService.ts | 17 ++++ .../api/services/WellOperationService.ts | 2 +- 15 files changed, 783 insertions(+), 2 deletions(-) create mode 100644 src/services/api/models/TelemetryDto.ts create mode 100644 src/services/api/models/UserRoleDto.ts create mode 100644 src/services/api/services/AdminClusterService.ts create mode 100644 src/services/api/services/AdminCompanyService.ts create mode 100644 src/services/api/services/AdminDepositService.ts create mode 100644 src/services/api/services/AdminTelemetryService.ts create mode 100644 src/services/api/services/AdminUserRoleService.ts create mode 100644 src/services/api/services/AdminUserService.ts create mode 100644 src/services/api/services/AdminWellService.ts diff --git a/src/services/api/index.ts b/src/services/api/index.ts index d441efd..9b3f048 100644 --- a/src/services/api/index.ts +++ b/src/services/api/index.ts @@ -21,6 +21,7 @@ export type { StatOperationsDto } from './models/StatOperationsDto'; export type { StatOperationsDtoPlanFactBase } from './models/StatOperationsDtoPlanFactBase'; export type { StatSectionDto } from './models/StatSectionDto'; export type { StatWellDto } from './models/StatWellDto'; +export type { TelemetryDto } from './models/TelemetryDto'; export type { TelemetryInfoDto } from './models/TelemetryInfoDto'; export type { TelemetryMessageDto } from './models/TelemetryMessageDto'; export type { TelemetryOperationDto } from './models/TelemetryOperationDto'; @@ -28,6 +29,7 @@ export type { TelemetryOperationDtoPaginationContainer } from './models/Telemetr export type { TelemetryOperationDurationDto } from './models/TelemetryOperationDurationDto'; export type { TelemetryUserDto } from './models/TelemetryUserDto'; export type { UserDto } from './models/UserDto'; +export type { UserRoleDto } from './models/UserRoleDto'; export type { UserTokenDto } from './models/UserTokenDto'; export type { WellDepthToDayDto } from './models/WellDepthToDayDto'; export type { WellDepthToIntervalDto } from './models/WellDepthToIntervalDto'; @@ -37,6 +39,13 @@ export type { WellOperationDto } from './models/WellOperationDto'; export type { WellOperationDtoPaginationContainer } from './models/WellOperationDtoPaginationContainer'; export type { WellOperationDtoPlanFactPredictBase } from './models/WellOperationDtoPlanFactPredictBase'; +export { AdminClusterService } from './services/AdminClusterService'; +export { AdminCompanyService } from './services/AdminCompanyService'; +export { AdminDepositService } from './services/AdminDepositService'; +export { AdminTelemetryService } from './services/AdminTelemetryService'; +export { AdminUserRoleService } from './services/AdminUserRoleService'; +export { AdminUserService } from './services/AdminUserService'; +export { AdminWellService } from './services/AdminWellService'; export { AuthService } from './services/AuthService'; export { ClusterService } from './services/ClusterService'; export { DataService } from './services/DataService'; diff --git a/src/services/api/models/TelemetryDto.ts b/src/services/api/models/TelemetryDto.ts new file mode 100644 index 0000000..a1eb21a --- /dev/null +++ b/src/services/api/models/TelemetryDto.ts @@ -0,0 +1,11 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { TelemetryInfoDto } from './TelemetryInfoDto'; + +export type TelemetryDto = { + id?: number; + remoteUid?: string | null; + info?: TelemetryInfoDto; +} \ No newline at end of file diff --git a/src/services/api/models/UserRoleDto.ts b/src/services/api/models/UserRoleDto.ts new file mode 100644 index 0000000..ad7f1d2 --- /dev/null +++ b/src/services/api/models/UserRoleDto.ts @@ -0,0 +1,11 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { UserDto } from './UserDto'; + +export type UserRoleDto = { + id?: number; + caption?: string | null; + users?: Array | null; +} \ No newline at end of file diff --git a/src/services/api/models/WellDto.ts b/src/services/api/models/WellDto.ts index d681ec5..f14c472 100644 --- a/src/services/api/models/WellDto.ts +++ b/src/services/api/models/WellDto.ts @@ -2,6 +2,8 @@ /* tslint:disable */ /* eslint-disable */ +import type { TelemetryDto } from './TelemetryDto'; + export type WellDto = { caption?: string | null; cluster?: string | null; @@ -10,4 +12,5 @@ export type WellDto = { latitude?: number | null; longitude?: number | null; wellType?: string | null; + telemetry?: TelemetryDto; } \ No newline at end of file diff --git a/src/services/api/services/AdminClusterService.ts b/src/services/api/services/AdminClusterService.ts new file mode 100644 index 0000000..da74c77 --- /dev/null +++ b/src/services/api/services/AdminClusterService.ts @@ -0,0 +1,99 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { ClusterDto } from '../models/ClusterDto'; +import { request as __request } from '../core/request'; + +export class AdminClusterService { + + /** + * Получить страницу с записями в PaginationContainer + * @param skip пропустить skip записей + * @param take получить take записей + * @returns any Success + * @throws ApiError + */ + public static async getPage( +skip: number, +take: number = 32, +): Promise { + const result = await __request({ + method: 'GET', + path: `/api/admin/cluster`, + query: { + 'skip': skip, + 'take': take, + }, + }); + return result.body; + } + + /** + * Добавить запись + * @param requestBody запись + * @returns any Success + * @throws ApiError + */ + public static async insert( +requestBody?: ClusterDto, +): Promise { + const result = await __request({ + method: 'POST', + path: `/api/admin/cluster`, + body: requestBody, + }); + return result.body; + } + + /** + * Получить одну запись по Id + * @param id id записи + * @returns any Success + * @throws ApiError + */ + public static async get( +id: number, +): Promise { + const result = await __request({ + method: 'GET', + path: `/api/admin/cluster/${id}`, + }); + return result.body; + } + + /** + * Редактировать запись по id + * @param id id записи + * @param requestBody запись + * @returns any Success + * @throws ApiError + */ + public static async put( +id: number, +requestBody?: ClusterDto, +): Promise { + const result = await __request({ + method: 'PUT', + path: `/api/admin/cluster/${id}`, + body: requestBody, + }); + return result.body; + } + + /** + * Удалить запись по id + * @param id id записи + * @returns any Success + * @throws ApiError + */ + public static async delete( +id: number, +): Promise { + const result = await __request({ + method: 'DELETE', + path: `/api/admin/cluster/${id}`, + }); + return result.body; + } + +} \ No newline at end of file diff --git a/src/services/api/services/AdminCompanyService.ts b/src/services/api/services/AdminCompanyService.ts new file mode 100644 index 0000000..0fadb8f --- /dev/null +++ b/src/services/api/services/AdminCompanyService.ts @@ -0,0 +1,99 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { CompanyDto } from '../models/CompanyDto'; +import { request as __request } from '../core/request'; + +export class AdminCompanyService { + + /** + * Получить страницу с записями в PaginationContainer + * @param skip пропустить skip записей + * @param take получить take записей + * @returns any Success + * @throws ApiError + */ + public static async getPage( +skip: number, +take: number = 32, +): Promise { + const result = await __request({ + method: 'GET', + path: `/api/admin/company`, + query: { + 'skip': skip, + 'take': take, + }, + }); + return result.body; + } + + /** + * Добавить запись + * @param requestBody запись + * @returns any Success + * @throws ApiError + */ + public static async insert( +requestBody?: CompanyDto, +): Promise { + const result = await __request({ + method: 'POST', + path: `/api/admin/company`, + body: requestBody, + }); + return result.body; + } + + /** + * Получить одну запись по Id + * @param id id записи + * @returns any Success + * @throws ApiError + */ + public static async get( +id: number, +): Promise { + const result = await __request({ + method: 'GET', + path: `/api/admin/company/${id}`, + }); + return result.body; + } + + /** + * Редактировать запись по id + * @param id id записи + * @param requestBody запись + * @returns any Success + * @throws ApiError + */ + public static async put( +id: number, +requestBody?: CompanyDto, +): Promise { + const result = await __request({ + method: 'PUT', + path: `/api/admin/company/${id}`, + body: requestBody, + }); + return result.body; + } + + /** + * Удалить запись по id + * @param id id записи + * @returns any Success + * @throws ApiError + */ + public static async delete( +id: number, +): Promise { + const result = await __request({ + method: 'DELETE', + path: `/api/admin/company/${id}`, + }); + return result.body; + } + +} \ No newline at end of file diff --git a/src/services/api/services/AdminDepositService.ts b/src/services/api/services/AdminDepositService.ts new file mode 100644 index 0000000..b90689e --- /dev/null +++ b/src/services/api/services/AdminDepositService.ts @@ -0,0 +1,99 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { DepositDto } from '../models/DepositDto'; +import { request as __request } from '../core/request'; + +export class AdminDepositService { + + /** + * Получить страницу с записями в PaginationContainer + * @param skip пропустить skip записей + * @param take получить take записей + * @returns any Success + * @throws ApiError + */ + public static async getPage( +skip: number, +take: number = 32, +): Promise { + const result = await __request({ + method: 'GET', + path: `/api/admin/deposit`, + query: { + 'skip': skip, + 'take': take, + }, + }); + return result.body; + } + + /** + * Добавить запись + * @param requestBody запись + * @returns any Success + * @throws ApiError + */ + public static async insert( +requestBody?: DepositDto, +): Promise { + const result = await __request({ + method: 'POST', + path: `/api/admin/deposit`, + body: requestBody, + }); + return result.body; + } + + /** + * Получить одну запись по Id + * @param id id записи + * @returns any Success + * @throws ApiError + */ + public static async get( +id: number, +): Promise { + const result = await __request({ + method: 'GET', + path: `/api/admin/deposit/${id}`, + }); + return result.body; + } + + /** + * Редактировать запись по id + * @param id id записи + * @param requestBody запись + * @returns any Success + * @throws ApiError + */ + public static async put( +id: number, +requestBody?: DepositDto, +): Promise { + const result = await __request({ + method: 'PUT', + path: `/api/admin/deposit/${id}`, + body: requestBody, + }); + return result.body; + } + + /** + * Удалить запись по id + * @param id id записи + * @returns any Success + * @throws ApiError + */ + public static async delete( +id: number, +): Promise { + const result = await __request({ + method: 'DELETE', + path: `/api/admin/deposit/${id}`, + }); + return result.body; + } + +} \ No newline at end of file diff --git a/src/services/api/services/AdminTelemetryService.ts b/src/services/api/services/AdminTelemetryService.ts new file mode 100644 index 0000000..a92eff4 --- /dev/null +++ b/src/services/api/services/AdminTelemetryService.ts @@ -0,0 +1,99 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { TelemetryDto } from '../models/TelemetryDto'; +import { request as __request } from '../core/request'; + +export class AdminTelemetryService { + + /** + * Получить страницу с записями в PaginationContainer + * @param skip пропустить skip записей + * @param take получить take записей + * @returns any Success + * @throws ApiError + */ + public static async getPage( +skip: number, +take: number = 32, +): Promise { + const result = await __request({ + method: 'GET', + path: `/api/admin/telemetry`, + query: { + 'skip': skip, + 'take': take, + }, + }); + return result.body; + } + + /** + * Добавить запись + * @param requestBody запись + * @returns any Success + * @throws ApiError + */ + public static async insert( +requestBody?: TelemetryDto, +): Promise { + const result = await __request({ + method: 'POST', + path: `/api/admin/telemetry`, + body: requestBody, + }); + return result.body; + } + + /** + * Получить одну запись по Id + * @param id id записи + * @returns any Success + * @throws ApiError + */ + public static async get( +id: number, +): Promise { + const result = await __request({ + method: 'GET', + path: `/api/admin/telemetry/${id}`, + }); + return result.body; + } + + /** + * Редактировать запись по id + * @param id id записи + * @param requestBody запись + * @returns any Success + * @throws ApiError + */ + public static async put( +id: number, +requestBody?: TelemetryDto, +): Promise { + const result = await __request({ + method: 'PUT', + path: `/api/admin/telemetry/${id}`, + body: requestBody, + }); + return result.body; + } + + /** + * Удалить запись по id + * @param id id записи + * @returns any Success + * @throws ApiError + */ + public static async delete( +id: number, +): Promise { + const result = await __request({ + method: 'DELETE', + path: `/api/admin/telemetry/${id}`, + }); + return result.body; + } + +} \ No newline at end of file diff --git a/src/services/api/services/AdminUserRoleService.ts b/src/services/api/services/AdminUserRoleService.ts new file mode 100644 index 0000000..a74ed7b --- /dev/null +++ b/src/services/api/services/AdminUserRoleService.ts @@ -0,0 +1,99 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { UserRoleDto } from '../models/UserRoleDto'; +import { request as __request } from '../core/request'; + +export class AdminUserRoleService { + + /** + * Получить страницу с записями в PaginationContainer + * @param skip пропустить skip записей + * @param take получить take записей + * @returns any Success + * @throws ApiError + */ + public static async getPage( +skip: number, +take: number = 32, +): Promise { + const result = await __request({ + method: 'GET', + path: `/api/admin/user/role`, + query: { + 'skip': skip, + 'take': take, + }, + }); + return result.body; + } + + /** + * Добавить запись + * @param requestBody запись + * @returns any Success + * @throws ApiError + */ + public static async insert( +requestBody?: UserRoleDto, +): Promise { + const result = await __request({ + method: 'POST', + path: `/api/admin/user/role`, + body: requestBody, + }); + return result.body; + } + + /** + * Получить одну запись по Id + * @param id id записи + * @returns any Success + * @throws ApiError + */ + public static async get( +id: number, +): Promise { + const result = await __request({ + method: 'GET', + path: `/api/admin/user/role/${id}`, + }); + return result.body; + } + + /** + * Редактировать запись по id + * @param id id записи + * @param requestBody запись + * @returns any Success + * @throws ApiError + */ + public static async put( +id: number, +requestBody?: UserRoleDto, +): Promise { + const result = await __request({ + method: 'PUT', + path: `/api/admin/user/role/${id}`, + body: requestBody, + }); + return result.body; + } + + /** + * Удалить запись по id + * @param id id записи + * @returns any Success + * @throws ApiError + */ + public static async delete( +id: number, +): Promise { + const result = await __request({ + method: 'DELETE', + path: `/api/admin/user/role/${id}`, + }); + return result.body; + } + +} \ No newline at end of file diff --git a/src/services/api/services/AdminUserService.ts b/src/services/api/services/AdminUserService.ts new file mode 100644 index 0000000..d7bd806 --- /dev/null +++ b/src/services/api/services/AdminUserService.ts @@ -0,0 +1,99 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { UserDto } from '../models/UserDto'; +import { request as __request } from '../core/request'; + +export class AdminUserService { + + /** + * Получить страницу с записями в PaginationContainer + * @param skip пропустить skip записей + * @param take получить take записей + * @returns any Success + * @throws ApiError + */ + public static async getPage( +skip: number, +take: number = 32, +): Promise { + const result = await __request({ + method: 'GET', + path: `/api/admin/user`, + query: { + 'skip': skip, + 'take': take, + }, + }); + return result.body; + } + + /** + * Добавить запись + * @param requestBody запись + * @returns any Success + * @throws ApiError + */ + public static async insert( +requestBody?: UserDto, +): Promise { + const result = await __request({ + method: 'POST', + path: `/api/admin/user`, + body: requestBody, + }); + return result.body; + } + + /** + * Получить одну запись по Id + * @param id id записи + * @returns any Success + * @throws ApiError + */ + public static async get( +id: number, +): Promise { + const result = await __request({ + method: 'GET', + path: `/api/admin/user/${id}`, + }); + return result.body; + } + + /** + * Редактировать запись по id + * @param id id записи + * @param requestBody запись + * @returns any Success + * @throws ApiError + */ + public static async put( +id: number, +requestBody?: UserDto, +): Promise { + const result = await __request({ + method: 'PUT', + path: `/api/admin/user/${id}`, + body: requestBody, + }); + return result.body; + } + + /** + * Удалить запись по id + * @param id id записи + * @returns any Success + * @throws ApiError + */ + public static async delete( +id: number, +): Promise { + const result = await __request({ + method: 'DELETE', + path: `/api/admin/user/${id}`, + }); + return result.body; + } + +} \ No newline at end of file diff --git a/src/services/api/services/AdminWellService.ts b/src/services/api/services/AdminWellService.ts new file mode 100644 index 0000000..244512c --- /dev/null +++ b/src/services/api/services/AdminWellService.ts @@ -0,0 +1,99 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { WellDto } from '../models/WellDto'; +import { request as __request } from '../core/request'; + +export class AdminWellService { + + /** + * Получить страницу с записями в PaginationContainer + * @param skip пропустить skip записей + * @param take получить take записей + * @returns any Success + * @throws ApiError + */ + public static async getPage( +skip: number, +take: number = 32, +): Promise { + const result = await __request({ + method: 'GET', + path: `/api/admin/well`, + query: { + 'skip': skip, + 'take': take, + }, + }); + return result.body; + } + + /** + * Добавить запись + * @param requestBody запись + * @returns any Success + * @throws ApiError + */ + public static async insert( +requestBody?: WellDto, +): Promise { + const result = await __request({ + method: 'POST', + path: `/api/admin/well`, + body: requestBody, + }); + return result.body; + } + + /** + * Получить одну запись по Id + * @param id id записи + * @returns any Success + * @throws ApiError + */ + public static async get( +id: number, +): Promise { + const result = await __request({ + method: 'GET', + path: `/api/admin/well/${id}`, + }); + return result.body; + } + + /** + * Редактировать запись по id + * @param id id записи + * @param requestBody запись + * @returns any Success + * @throws ApiError + */ + public static async put( +id: number, +requestBody?: WellDto, +): Promise { + const result = await __request({ + method: 'PUT', + path: `/api/admin/well/${id}`, + body: requestBody, + }); + return result.body; + } + + /** + * Удалить запись по id + * @param id id записи + * @returns any Success + * @throws ApiError + */ + public static async delete( +id: number, +): Promise { + const result = await __request({ + method: 'DELETE', + path: `/api/admin/well/${id}`, + }); + return result.body; + } + +} \ No newline at end of file diff --git a/src/services/api/services/AuthService.ts b/src/services/api/services/AuthService.ts index 403d1ff..c35ce11 100644 --- a/src/services/api/services/AuthService.ts +++ b/src/services/api/services/AuthService.ts @@ -2,6 +2,7 @@ /* tslint:disable */ /* eslint-disable */ import type { AuthDto } from '../models/AuthDto'; +import type { UserDto } from '../models/UserDto'; import type { UserTokenDto } from '../models/UserTokenDto'; import { request as __request } from '../core/request'; @@ -40,4 +41,40 @@ requestBody?: AuthDto, return result.body; } + /** + * Регистрация пользователя. Доступна администратору + * @param requestBody + * @returns any Success + * @throws ApiError + */ + public static async register( +requestBody?: UserDto, +): Promise { + const result = await __request({ + method: 'POST', + path: `/auth`, + body: requestBody, + }); + return result.body; + } + + /** + * Смена пароля пользователя. Доступна пользователю и администратору + * @param idUser + * @param requestBody + * @returns any Success + * @throws ApiError + */ + public static async changePassword( +idUser: number, +requestBody?: string, +): Promise { + const result = await __request({ + method: 'PUT', + path: `/auth/${idUser}/ChangePassword`, + body: requestBody, + }); + return result.body; + } + } \ No newline at end of file diff --git a/src/services/api/services/FileService.ts b/src/services/api/services/FileService.ts index 0703783..cd51ab2 100644 --- a/src/services/api/services/FileService.ts +++ b/src/services/api/services/FileService.ts @@ -51,7 +51,7 @@ companyName?: string, fileName?: string, begin?: string, end?: string, -skip: number =0, +skip?: number, take: number = 32, ): Promise { const result = await __request({ diff --git a/src/services/api/services/TelemetryAnalyticsService.ts b/src/services/api/services/TelemetryAnalyticsService.ts index e11f5ab..b4f828c 100644 --- a/src/services/api/services/TelemetryAnalyticsService.ts +++ b/src/services/api/services/TelemetryAnalyticsService.ts @@ -1,6 +1,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +import type { DatesRangeDto } from '../models/DatesRangeDto'; import type { TelemetryOperationDtoPaginationContainer } from '../models/TelemetryOperationDtoPaginationContainer'; import type { TelemetryOperationDurationDto } from '../models/TelemetryOperationDurationDto'; import type { WellDepthToDayDto } from '../models/WellDepthToDayDto'; @@ -130,4 +131,20 @@ workBeginSeconds?: number, return result.body; } + /** + * Возвращает даты первой и последней операций на скважине + * @param idWell id скважины + * @returns DatesRangeDto Success + * @throws ApiError + */ + public static async getOperationsDateRange( +idWell: number, +): Promise { + const result = await __request({ + method: 'GET', + path: `/api/well/${idWell}/telemetryAnalytics/datesRange`, + }); + return result.body; + } + } \ No newline at end of file diff --git a/src/services/api/services/WellOperationService.ts b/src/services/api/services/WellOperationService.ts index e621494..0fdbd49 100644 --- a/src/services/api/services/WellOperationService.ts +++ b/src/services/api/services/WellOperationService.ts @@ -48,7 +48,7 @@ begin?: string, end?: string, minDepth: number = -1.7976931348623157e+308, maxDepth: number = 1.7976931348623157e+308, -skip: number =0, +skip?: number, take: number = 32, ): Promise { const result = await __request({