mirror of https://github.com/abpframework/abp.git
5 changed files with 4308 additions and 0 deletions
File diff suppressed because it is too large
@ -0,0 +1,2 @@ |
|||||
|
export * from './models'; |
||||
|
export * from './tenant.service'; |
||||
@ -0,0 +1,22 @@ |
|||||
|
import type { ExtensibleEntityDto, ExtensibleObject, PagedAndSortedResultRequestDto } from '@abp/ng.core'; |
||||
|
|
||||
|
export interface GetTenantsInput extends PagedAndSortedResultRequestDto { |
||||
|
filter: string; |
||||
|
} |
||||
|
|
||||
|
export interface TenantCreateDto extends TenantCreateOrUpdateDtoBase { |
||||
|
adminEmailAddress: string; |
||||
|
adminPassword: string; |
||||
|
} |
||||
|
|
||||
|
export interface TenantCreateOrUpdateDtoBase extends ExtensibleObject { |
||||
|
name: string; |
||||
|
} |
||||
|
|
||||
|
export interface TenantDto extends ExtensibleEntityDto<string> { |
||||
|
name: string; |
||||
|
} |
||||
|
|
||||
|
// tslint:disable-next-line: no-empty-interface
|
||||
|
export interface TenantUpdateDto extends TenantCreateOrUpdateDtoBase { |
||||
|
} |
||||
@ -0,0 +1,73 @@ |
|||||
|
import type { PagedResultDto } from '@abp/ng.core'; |
||||
|
import type { GetTenantsInput, TenantCreateDto, TenantDto, TenantUpdateDto } from './models'; |
||||
|
import { RestService } from '@abp/ng.core'; |
||||
|
import { Injectable } from '@angular/core'; |
||||
|
|
||||
|
@Injectable({ |
||||
|
providedIn: 'root', |
||||
|
}) |
||||
|
export class TenantService { |
||||
|
apiName = 'AbpTenantManagement'; |
||||
|
|
||||
|
create = (input: TenantCreateDto) => |
||||
|
this.restService.request<any, TenantDto>({ |
||||
|
method: 'POST', |
||||
|
url: '/api/multi-tenancy/tenants', |
||||
|
body: input, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
delete = (id: string) => |
||||
|
this.restService.request<any, void>({ |
||||
|
method: 'DELETE', |
||||
|
url: `/api/multi-tenancy/tenants/${id}`, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
deleteDefaultConnectionString = (id: string) => |
||||
|
this.restService.request<any, void>({ |
||||
|
method: 'DELETE', |
||||
|
url: `/api/multi-tenancy/tenants/${id}/default-connection-string`, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
get = (id: string) => |
||||
|
this.restService.request<any, TenantDto>({ |
||||
|
method: 'GET', |
||||
|
url: `/api/multi-tenancy/tenants/${id}`, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
getDefaultConnectionString = (id: string) => |
||||
|
this.restService.request<any, string>({ |
||||
|
method: 'GET', |
||||
|
url: `/api/multi-tenancy/tenants/${id}/default-connection-string`, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
getList = (input: GetTenantsInput) => |
||||
|
this.restService.request<any, PagedResultDto<TenantDto>>({ |
||||
|
method: 'GET', |
||||
|
url: '/api/multi-tenancy/tenants', |
||||
|
params: { filter: input.filter, sorting: input.sorting, skipCount: input.skipCount, maxResultCount: input.maxResultCount }, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
update = (id: string, input: TenantUpdateDto) => |
||||
|
this.restService.request<any, TenantDto>({ |
||||
|
method: 'PUT', |
||||
|
url: `/api/multi-tenancy/tenants/${id}`, |
||||
|
body: input, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
updateDefaultConnectionString = (id: string, defaultConnectionString: string) => |
||||
|
this.restService.request<any, void>({ |
||||
|
method: 'PUT', |
||||
|
url: `/api/multi-tenancy/tenants/${id}/default-connection-string`, |
||||
|
params: { defaultConnectionString }, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
constructor(private restService: RestService) {} |
||||
|
} |
||||
Loading…
Reference in new issue