From 494fd8128c0eea355a95e3bc97150d4fcab3a7ef Mon Sep 17 00:00:00 2001 From: goodm2ice Date: Mon, 13 Dec 2021 10:19:07 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B2=D0=B8=D1=81=D1=8B=20?= =?UTF-8?q?=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/api/index.ts | 3 ++ src/services/api/models/PermissionBaseDto.ts | 9 ++++++ src/services/api/models/PermissionDto.ts | 5 +-- src/services/api/models/UserDto.ts | 3 +- src/services/api/models/UserExtendedDto.ts | 19 +++++++++++ .../api/models/UserRegistrationDto.ts | 19 +++++++++++ src/services/api/models/UserRoleDto.ts | 4 +-- src/services/api/models/UserTokenDto.ts | 10 ++++-- src/services/api/services/AdminUserService.ts | 14 ++++---- src/services/api/services/AuthService.ts | 4 +-- src/services/api/services/ReportService.ts | 32 ------------------- 11 files changed, 72 insertions(+), 50 deletions(-) create mode 100644 src/services/api/models/PermissionBaseDto.ts create mode 100644 src/services/api/models/UserExtendedDto.ts create mode 100644 src/services/api/models/UserRegistrationDto.ts diff --git a/src/services/api/index.ts b/src/services/api/index.ts index 3b92c51..21fd12a 100644 --- a/src/services/api/index.ts +++ b/src/services/api/index.ts @@ -20,6 +20,7 @@ export type { FilePublishInfoDto } from './models/FilePublishInfoDto'; export type { MeasureDto } from './models/MeasureDto'; export type { MessageDto } from './models/MessageDto'; export type { MessageDtoPaginationContainer } from './models/MessageDtoPaginationContainer'; +export type { PermissionBaseDto } from './models/PermissionBaseDto'; export type { PermissionDto } from './models/PermissionDto'; export type { PermissionInfoDto } from './models/PermissionInfoDto'; export type { SetpointInfoDto } from './models/SetpointInfoDto'; @@ -40,6 +41,8 @@ export type { TelemetryOperationDurationDto } from './models/TelemetryOperationD export type { TelemetryTimeZoneDto } from './models/TelemetryTimeZoneDto'; export type { TelemetryUserDto } from './models/TelemetryUserDto'; export type { UserDto } from './models/UserDto'; +export type { UserExtendedDto } from './models/UserExtendedDto'; +export type { UserRegistrationDto } from './models/UserRegistrationDto'; export type { UserRoleDto } from './models/UserRoleDto'; export type { UserTokenDto } from './models/UserTokenDto'; export type { WellCompositeDto } from './models/WellCompositeDto'; diff --git a/src/services/api/models/PermissionBaseDto.ts b/src/services/api/models/PermissionBaseDto.ts new file mode 100644 index 0000000..f6b16de --- /dev/null +++ b/src/services/api/models/PermissionBaseDto.ts @@ -0,0 +1,9 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type PermissionBaseDto = { + idPermissionInfo?: number; + permissionName?: string | null; + value?: number; +} diff --git a/src/services/api/models/PermissionDto.ts b/src/services/api/models/PermissionDto.ts index 8e68b66..955fb61 100644 --- a/src/services/api/models/PermissionDto.ts +++ b/src/services/api/models/PermissionDto.ts @@ -3,7 +3,8 @@ /* eslint-disable */ export type PermissionDto = { + idPermissionInfo?: number; + permissionName?: string | null; + value?: number; idUserRole?: number; - idPermission?: number; - permissionValue?: number; } diff --git a/src/services/api/models/UserDto.ts b/src/services/api/models/UserDto.ts index 627f214..4d9e6af 100644 --- a/src/services/api/models/UserDto.ts +++ b/src/services/api/models/UserDto.ts @@ -5,6 +5,7 @@ import type { CompanyDto } from './CompanyDto'; export type UserDto = { + id?: number; login?: string | null; name?: string | null; surname?: string | null; @@ -12,8 +13,6 @@ export type UserDto = { email?: string | null; phone?: string | null; position?: string | null; - id?: number; idCompany?: number | null; - password?: string | null; company?: CompanyDto; } diff --git a/src/services/api/models/UserExtendedDto.ts b/src/services/api/models/UserExtendedDto.ts new file mode 100644 index 0000000..cfd4158 --- /dev/null +++ b/src/services/api/models/UserExtendedDto.ts @@ -0,0 +1,19 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { CompanyDto } from './CompanyDto'; + +export type UserExtendedDto = { + id?: number; + login?: string | null; + name?: string | null; + surname?: string | null; + patronymic?: string | null; + email?: string | null; + phone?: string | null; + position?: string | null; + idCompany?: number | null; + company?: CompanyDto; + roleNames?: Array | null; +} diff --git a/src/services/api/models/UserRegistrationDto.ts b/src/services/api/models/UserRegistrationDto.ts new file mode 100644 index 0000000..cc952e4 --- /dev/null +++ b/src/services/api/models/UserRegistrationDto.ts @@ -0,0 +1,19 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { CompanyDto } from './CompanyDto'; + +export type UserRegistrationDto = { + id?: number; + login?: string | null; + name?: string | null; + surname?: string | null; + patronymic?: string | null; + email?: string | null; + phone?: string | null; + position?: string | null; + idCompany?: number | null; + company?: CompanyDto; + password?: string | null; +} diff --git a/src/services/api/models/UserRoleDto.ts b/src/services/api/models/UserRoleDto.ts index 7fb6dbb..6efd298 100644 --- a/src/services/api/models/UserRoleDto.ts +++ b/src/services/api/models/UserRoleDto.ts @@ -2,12 +2,12 @@ /* tslint:disable */ /* eslint-disable */ -import type { PermissionDto } from './PermissionDto'; +import type { PermissionBaseDto } from './PermissionBaseDto'; export type UserRoleDto = { id?: number; caption?: string | null; idParent?: number | null; idType?: number; - permissions?: Array | null; + permissions?: Array | null; } diff --git a/src/services/api/models/UserTokenDto.ts b/src/services/api/models/UserTokenDto.ts index 2a0957d..ef33f2c 100644 --- a/src/services/api/models/UserTokenDto.ts +++ b/src/services/api/models/UserTokenDto.ts @@ -2,7 +2,11 @@ /* tslint:disable */ /* eslint-disable */ +import type { CompanyDto } from './CompanyDto'; +import type { PermissionBaseDto } from './PermissionBaseDto'; + export type UserTokenDto = { + id?: number; login?: string | null; name?: string | null; surname?: string | null; @@ -10,9 +14,9 @@ export type UserTokenDto = { email?: string | null; phone?: string | null; position?: string | null; - id?: number; - companyName?: string | null; + idCompany?: number | null; + company?: CompanyDto; roleNames?: Array | null; - permissions?: Record | null; + permissions?: Array | null; token?: string | null; } diff --git a/src/services/api/services/AdminUserService.ts b/src/services/api/services/AdminUserService.ts index b2b6fc5..481c330 100644 --- a/src/services/api/services/AdminUserService.ts +++ b/src/services/api/services/AdminUserService.ts @@ -1,17 +1,17 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { UserDto } from '../models/UserDto'; +import type { UserExtendedDto } from '../models/UserExtendedDto'; import { request as __request } from '../core/request'; export class AdminUserService { /** * Получить все записи - * @returns UserDto Success + * @returns UserExtendedDto Success * @throws ApiError */ - public static async getAll(): Promise> { + public static async getAll(): Promise> { const result = await __request({ method: 'GET', path: `/api/admin/user/all`, @@ -22,12 +22,12 @@ export class AdminUserService { /** * Получить одну запись по Id * @param id id записи - * @returns UserDto Success + * @returns UserExtendedDto Success * @throws ApiError */ public static async get( id: number, - ): Promise { + ): Promise { const result = await __request({ method: 'GET', path: `/api/admin/user/${id}`, @@ -44,7 +44,7 @@ export class AdminUserService { */ public static async put( id: number, - requestBody?: UserDto, + requestBody?: UserExtendedDto, ): Promise { const result = await __request({ method: 'PUT', @@ -77,7 +77,7 @@ export class AdminUserService { * @throws ApiError */ public static async insert( - requestBody?: UserDto, + requestBody?: UserExtendedDto, ): Promise { const result = await __request({ method: 'POST', diff --git a/src/services/api/services/AuthService.ts b/src/services/api/services/AuthService.ts index 8a58e6a..bff4caf 100644 --- a/src/services/api/services/AuthService.ts +++ b/src/services/api/services/AuthService.ts @@ -2,7 +2,7 @@ /* tslint:disable */ /* eslint-disable */ import type { AuthDto } from '../models/AuthDto'; -import type { UserDto } from '../models/UserDto'; +import type { UserRegistrationDto } from '../models/UserRegistrationDto'; import type { UserTokenDto } from '../models/UserTokenDto'; import { request as __request } from '../core/request'; @@ -48,7 +48,7 @@ export class AuthService { * @throws ApiError */ public static async register( - requestBody?: UserDto, + requestBody?: UserRegistrationDto, ): Promise { const result = await __request({ method: 'POST', diff --git a/src/services/api/services/ReportService.ts b/src/services/api/services/ReportService.ts index 343ea05..8c91b0d 100644 --- a/src/services/api/services/ReportService.ts +++ b/src/services/api/services/ReportService.ts @@ -52,38 +52,6 @@ export class ReportService { return result.body; } - /** - * @deprecated - * Возвращает имена отчетов, хранящихся на диске, - * которые подходят под указанные параметры - * @param idWell id скважины - * @param stepSeconds шаг интервала - * @param format формат отчета (0-PDF, 1-LAS) - * @param begin дата начала интервала - * @param end дата окончания интервала - * @returns string Success - * @throws ApiError - */ - public static async getSuitableReportsNames( - idWell: number, - stepSeconds?: number, - format?: number, - begin?: string, - end?: string, - ): Promise> { - const result = await __request({ - method: 'GET', - path: `/api/well/${idWell}/report/suitableReports`, - query: { - 'stepSeconds': stepSeconds, - 'format': format, - 'begin': begin, - 'end': end, - }, - }); - return result.body; - } - /** * Возвращает прогнозируемое количество страниц будущего отчета * @param idWell id скважины