forked from ddrilling/asb_cloud_front
update web-api client
This commit is contained in:
parent
10b6dcc307
commit
218d4b97fd
@ -27,14 +27,6 @@ const columns = [
|
||||
},
|
||||
];
|
||||
|
||||
// const groupBy = (table, key) => {
|
||||
// return table.reduce((rv, item) => {
|
||||
// rv[item[key]] = rv[item[key]] || []
|
||||
// rv[item[key]].push(item);
|
||||
// return rv;
|
||||
// }, []);
|
||||
// };
|
||||
|
||||
const groupBy = (table, ...keys) => {
|
||||
let key = keys[0]
|
||||
|
||||
|
@ -6,12 +6,17 @@ export { OpenAPI } from './core/OpenAPI';
|
||||
|
||||
export type { AuthDto } from './models/AuthDto';
|
||||
export type { DataSaubBaseDto } from './models/DataSaubBaseDto';
|
||||
export type { TelemetryDataDto } from './models/TelemetryDataDto';
|
||||
export type { EventDto } from './models/EventDto';
|
||||
export type { MessageDto } from './models/MessageDto';
|
||||
export type { MessageDtoPaginationContainer } from './models/MessageDtoPaginationContainer';
|
||||
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 { WellDto } from './models/WellDto';
|
||||
|
||||
export { AuthService } from './services/AuthService';
|
||||
export { DataService } from './services/DataService';
|
||||
export { MessageService } from './services/MessageService';
|
||||
export { TelemetryService } from './services/TelemetryService';
|
||||
export { WellService } from './services/WellService';
|
||||
|
@ -5,14 +5,23 @@
|
||||
export type DataSaubBaseDto = {
|
||||
date?: string;
|
||||
mode?: number | null;
|
||||
user?: string | null;
|
||||
wellDepth?: number | null;
|
||||
bitDepth?: number | null;
|
||||
blockHeight?: number | null;
|
||||
blockPosition?: number | null;
|
||||
blockPositionMin?: number | null;
|
||||
blockPositionMax?: number | null;
|
||||
blockSpeed?: number | null;
|
||||
blockSpeedSp?: number | null;
|
||||
blockSpeedSpRotor?: number | null;
|
||||
blockSpeedSpSlide?: number | null;
|
||||
blockSpeedSpDevelop?: number | null;
|
||||
pressure?: number | null;
|
||||
pressureIdle?: number | null;
|
||||
pressureSp?: number | null;
|
||||
pressureSpRotor?: number | null;
|
||||
pressureSpSlide?: number | null;
|
||||
pressureSpDevelop?: number | null;
|
||||
pressureDeltaLimitMax?: number | null;
|
||||
axialLoad?: number | null;
|
||||
axialLoadSp?: number | null;
|
||||
|
12
src/services/api/models/EventDto.ts
Normal file
12
src/services/api/models/EventDto.ts
Normal file
@ -0,0 +1,12 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
export type EventDto = {
|
||||
id?: number;
|
||||
message?: string | null;
|
||||
idCategory?: number;
|
||||
tag?: string | null;
|
||||
eventType?: number;
|
||||
idSound?: number;
|
||||
}
|
11
src/services/api/models/MessageDto.ts
Normal file
11
src/services/api/models/MessageDto.ts
Normal file
@ -0,0 +1,11 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
export type MessageDto = {
|
||||
id?: number;
|
||||
date?: string;
|
||||
categoryId?: number;
|
||||
user?: string | null;
|
||||
message?: string | null;
|
||||
}
|
12
src/services/api/models/MessageDtoPaginationContainer.ts
Normal file
12
src/services/api/models/MessageDtoPaginationContainer.ts
Normal file
@ -0,0 +1,12 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { MessageDto } from './MessageDto';
|
||||
|
||||
export type MessageDtoPaginationContainer = {
|
||||
skip?: number;
|
||||
take?: number;
|
||||
count?: number;
|
||||
items?: Array<MessageDto> | null;
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { DataSaubBaseDto } from './DataSaubBaseDto';
|
||||
|
||||
export type TelemetryDataDto = {
|
||||
date?: string;
|
||||
hmiVersion?: string | null;
|
||||
userName?: string | null;
|
||||
dataSaub?: Array<DataSaubBaseDto> | null;
|
||||
}
|
@ -3,7 +3,13 @@
|
||||
/* eslint-disable */
|
||||
|
||||
export type TelemetryInfoDto = {
|
||||
date?: string;
|
||||
timeZoneId?: string | null;
|
||||
timeZoneOffsetTotalHours?: number;
|
||||
caption?: string | null;
|
||||
cluster?: string | null;
|
||||
deposit?: string | null;
|
||||
hmiVersion?: string | null;
|
||||
plcVersion?: string | null;
|
||||
comment?: string | null;
|
||||
}
|
15
src/services/api/models/TelemetryMessageDto.ts
Normal file
15
src/services/api/models/TelemetryMessageDto.ts
Normal file
@ -0,0 +1,15 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
export type TelemetryMessageDto = {
|
||||
id?: number;
|
||||
date?: string;
|
||||
idEvent?: number;
|
||||
state?: number | null;
|
||||
idTelemetryUser?: number | null;
|
||||
arg0?: string | null;
|
||||
arg1?: string | null;
|
||||
arg2?: string | null;
|
||||
arg3?: string | null;
|
||||
}
|
11
src/services/api/models/TelemetryUserDto.ts
Normal file
11
src/services/api/models/TelemetryUserDto.ts
Normal file
@ -0,0 +1,11 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
export type TelemetryUserDto = {
|
||||
id?: number;
|
||||
name?: string | null;
|
||||
surname?: string | null;
|
||||
patronymic?: string | null;
|
||||
level?: number;
|
||||
}
|
@ -7,17 +7,29 @@ import { request as __request } from '../core/request';
|
||||
export class DataService {
|
||||
|
||||
/**
|
||||
* Возвращает данные САУБ по скважине
|
||||
* @param wellId
|
||||
* Возвращает данные САУБ по скважине.
|
||||
* По умолчанию за последние 10 минут.
|
||||
* @param wellId id скважины
|
||||
* @param begin дата начала выборки. По умолчанию: текущее время - intervalSec
|
||||
* @param intervalSec интервал времени даты начала выборки, секунды
|
||||
* @param approxPointsCount желаемое количество точек. Если в выборке точек будет больше, то выборка будет прорежена.
|
||||
* @returns DataSaubBaseDto Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static async get(
|
||||
wellId: number,
|
||||
begin?: string,
|
||||
intervalSec: number = 600,
|
||||
approxPointsCount: number = 1024,
|
||||
): Promise<Array<DataSaubBaseDto>> {
|
||||
const result = await __request({
|
||||
method: 'GET',
|
||||
path: `/api/well/${wellId}/data`,
|
||||
query: {
|
||||
'begin': begin,
|
||||
'intervalSec': intervalSec,
|
||||
'approxPointsCount': approxPointsCount,
|
||||
},
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
|
42
src/services/api/services/MessageService.ts
Normal file
42
src/services/api/services/MessageService.ts
Normal file
@ -0,0 +1,42 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { MessageDtoPaginationContainer } from '../models/MessageDtoPaginationContainer';
|
||||
import { request as __request } from '../core/request';
|
||||
|
||||
export class MessageService {
|
||||
|
||||
/**
|
||||
* Выдает список сообщений по скважине
|
||||
* @param wellId id скважины
|
||||
* @param categoryids список категорий
|
||||
* @param begin дата начала
|
||||
* @param end окончание
|
||||
* @param skip для пагинации кол-во записей пропустить
|
||||
* @param take для пагинации кол-во записей
|
||||
* @returns MessageDtoPaginationContainer Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static async get(
|
||||
wellId: number,
|
||||
categoryids?: Array<number>,
|
||||
begin?: string,
|
||||
end?: string,
|
||||
skip: number,
|
||||
take: number = 32,
|
||||
): Promise<MessageDtoPaginationContainer> {
|
||||
const result = await __request({
|
||||
method: 'GET',
|
||||
path: `/api/well/${wellId}/message`,
|
||||
query: {
|
||||
'categoryids': categoryids,
|
||||
'begin': begin,
|
||||
'end': end,
|
||||
'skip': skip,
|
||||
'take': take,
|
||||
},
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
|
||||
}
|
@ -1,8 +1,11 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { TelemetryDataDto } from '../models/TelemetryDataDto';
|
||||
import type { DataSaubBaseDto } from '../models/DataSaubBaseDto';
|
||||
import type { EventDto } from '../models/EventDto';
|
||||
import type { TelemetryInfoDto } from '../models/TelemetryInfoDto';
|
||||
import type { TelemetryMessageDto } from '../models/TelemetryMessageDto';
|
||||
import type { TelemetryUserDto } from '../models/TelemetryUserDto';
|
||||
import { request as __request } from '../core/request';
|
||||
|
||||
export class TelemetryService {
|
||||
@ -35,7 +38,7 @@ requestBody?: TelemetryInfoDto,
|
||||
*/
|
||||
public static async data(
|
||||
uid: string,
|
||||
requestBody?: TelemetryDataDto,
|
||||
requestBody?: Array<DataSaubBaseDto>,
|
||||
): Promise<any> {
|
||||
const result = await __request({
|
||||
method: 'POST',
|
||||
@ -45,4 +48,61 @@ requestBody?: TelemetryDataDto,
|
||||
return result.body;
|
||||
}
|
||||
|
||||
/**
|
||||
* Принимает список новых сообщений от телеметрии
|
||||
* @param uid Уникальный идентификатор отправителя
|
||||
* @param requestBody сообщения
|
||||
* @returns any Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static async message(
|
||||
uid: string,
|
||||
requestBody?: Array<TelemetryMessageDto>,
|
||||
): Promise<any> {
|
||||
const result = await __request({
|
||||
method: 'POST',
|
||||
path: `/api/telemetry/${uid}/message`,
|
||||
body: requestBody,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
|
||||
/**
|
||||
* Принимает справочник событий
|
||||
* @param uid Уникальный идентификатор отправителя
|
||||
* @param requestBody справочник событий
|
||||
* @returns any Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static async events(
|
||||
uid: string,
|
||||
requestBody?: Array<EventDto>,
|
||||
): Promise<any> {
|
||||
const result = await __request({
|
||||
method: 'POST',
|
||||
path: `/api/telemetry/${uid}/event`,
|
||||
body: requestBody,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
|
||||
/**
|
||||
* Принимает справочник пользователей телеметрии
|
||||
* @param uid Уникальный идентификатор отправителя
|
||||
* @param requestBody справочник пользователей телеметрии
|
||||
* @returns any Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static async users(
|
||||
uid: string,
|
||||
requestBody?: Array<TelemetryUserDto>,
|
||||
): Promise<any> {
|
||||
const result = await __request({
|
||||
method: 'POST',
|
||||
path: `/api/telemetry/${uid}/user`,
|
||||
body: requestBody,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user