From 99febfbb62d031bf41a859b319ad174f9169a5b3 Mon Sep 17 00:00:00 2001 From: cKey <35512826+colinin@users.noreply.github.com> Date: Thu, 15 Dec 2022 17:48:33 +0800 Subject: [PATCH] use uniqueName to find multiple actions with the same name --- .../index.ts | 126 ++++++++--------- .../model/index.ts | 95 ++++++------- .../index.ts | 83 ++++++------ .../model/index.ts | 41 +++--- .../{scopes => open-iddict-scope}/index.ts | 126 ++++++++--------- .../open-iddict-scope/model/index.ts | 30 +++++ .../{tokens => open-iddict-token}/index.ts | 83 ++++++------ .../model/index.ts | 57 ++++---- .../src/api/openiddict/scopes/model/index.ts | 29 ---- apps/vue/src/api/saas/edition/index.ts | 64 +++++++++ apps/vue/src/api/saas/edition/model/index.ts | 20 +++ apps/vue/src/api/saas/editions.ts | 50 ------- apps/vue/src/api/saas/model/editionsModel.ts | 23 ---- apps/vue/src/api/saas/model/tenantModel.ts | 48 ------- apps/vue/src/api/saas/tenant.ts | 75 ----------- apps/vue/src/api/saas/tenant/index.ts | 127 ++++++++++++++++++ apps/vue/src/api/saas/tenant/model/index.ts | 43 ++++++ apps/vue/src/utils/http/abp/abp.ts | 17 ++- .../components/ApplicationTable.vue | 6 +- .../components/AuthorizationModal.vue | 4 +- .../components/AuthorizationTable.vue | 6 +- .../authorizations/datas/ModalData.ts | 2 +- .../tokens/components/TokenModal.vue | 4 +- .../tokens/components/TokenTable.vue | 6 +- .../saas/editions/components/EditionModal.vue | 6 +- .../saas/editions/components/EditionTable.vue | 6 +- .../tenant/components/ConnectionEditModal.vue | 4 +- .../components/ConnectionTableModal.vue | 6 +- .../saas/tenant/components/TenantModal.vue | 6 +- .../src/views/saas/tenant/datas/ModalData.ts | 2 +- .../views/saas/tenant/hooks/useTenantTable.ts | 6 +- .../webhooks/send-attempts/datas/ModalData.ts | 2 +- .../components/SubscriptionModal.vue | 2 +- .../webhooks/subscriptions/datas/ModalData.ts | 4 +- apps/vue/types/abp.type.d.ts | 115 ++++++++++++++++ .../LINGYUN.Abp.Cli/LINGYUN.Abp.Cli.csproj | 2 +- .../TypeScript/TypeScriptProxyGenerator.cs | 3 +- .../LY.MicroService.AuthServer.csproj | 4 + 38 files changed, 765 insertions(+), 568 deletions(-) rename apps/vue/src/api/openiddict/{applications => open-iddict-application}/index.ts (57%) rename apps/vue/src/api/openiddict/{applications => open-iddict-application}/model/index.ts (59%) rename apps/vue/src/api/openiddict/{authorizations => open-iddict-authorization}/index.ts (62%) rename apps/vue/src/api/openiddict/{authorizations => open-iddict-authorization}/model/index.ts (64%) rename apps/vue/src/api/openiddict/{scopes => open-iddict-scope}/index.ts (57%) create mode 100644 apps/vue/src/api/openiddict/open-iddict-scope/model/index.ts rename apps/vue/src/api/openiddict/{tokens => open-iddict-token}/index.ts (63%) rename apps/vue/src/api/openiddict/{tokens => open-iddict-token}/model/index.ts (65%) delete mode 100644 apps/vue/src/api/openiddict/scopes/model/index.ts create mode 100644 apps/vue/src/api/saas/edition/index.ts create mode 100644 apps/vue/src/api/saas/edition/model/index.ts delete mode 100644 apps/vue/src/api/saas/editions.ts delete mode 100644 apps/vue/src/api/saas/model/editionsModel.ts delete mode 100644 apps/vue/src/api/saas/model/tenantModel.ts delete mode 100644 apps/vue/src/api/saas/tenant.ts create mode 100644 apps/vue/src/api/saas/tenant/index.ts create mode 100644 apps/vue/src/api/saas/tenant/model/index.ts create mode 100644 apps/vue/types/abp.type.d.ts diff --git a/apps/vue/src/api/openiddict/applications/index.ts b/apps/vue/src/api/openiddict/open-iddict-application/index.ts similarity index 57% rename from apps/vue/src/api/openiddict/applications/index.ts rename to apps/vue/src/api/openiddict/open-iddict-application/index.ts index 7d404b286..fb302641c 100644 --- a/apps/vue/src/api/openiddict/applications/index.ts +++ b/apps/vue/src/api/openiddict/open-iddict-application/index.ts @@ -1,61 +1,65 @@ -import { defAbpHttp } from '/@/utils/http/abp'; -import { - OpenIddictApplicationDto, - OpenIddictApplicationCreateDto, - OpenIddictApplicationUpdateDto, - OpenIddictApplicationGetListInput, -} from './model'; - -const remoteServiceName = 'AbpOpenIddict'; -const controllerName = 'OpenIddictApplication'; - -export const getById = (id: string) => { - return defAbpHttp.request({ - service: remoteServiceName, - controller: controllerName, - action: 'GetAsync', - params: { - id: id, - }, - }); -}; - -export const getList = (input: OpenIddictApplicationGetListInput) => { - return defAbpHttp.pagedRequest({ - service: remoteServiceName, - controller: controllerName, - action: 'GetListAsync', - params: { - input: input, - }, - }); -}; - -export const deleteById = (id: string) => { - return defAbpHttp.request({ - service: remoteServiceName, - controller: controllerName, - action: 'DeleteAsync', - params: { - id: id, - }, - }); -}; - -export const create = (input: OpenIddictApplicationCreateDto) => { - return defAbpHttp.request({ - service: remoteServiceName, - controller: controllerName, - action: 'CreateAsync', - data: input, - }); -}; - -export const update = (input: OpenIddictApplicationUpdateDto) => { - return defAbpHttp.request({ - service: remoteServiceName, - controller: controllerName, - action: 'UpdateAsync', - data: input, - }); -}; +import { defAbpHttp } from '/@/utils/http/abp'; +import { OpenIddictApplicationDto,OpenIddictApplicationGetListInput, OpenIddictApplicationCreateDto, OpenIddictApplicationUpdateDto, } from './model'; + +const remoteServiceName = 'AbpOpenIddict'; +const controllerName = 'OpenIddictApplication'; + +export const GetAsyncById = (id: string) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'GetAsync', + uniqueName: 'GetAsyncById', + params: { + id: id, + }, + }); +}; + +export const GetListAsyncByInput = (input: OpenIddictApplicationGetListInput) => { + return defAbpHttp.pagedRequest({ + service: remoteServiceName, + controller: controllerName, + action: 'GetListAsync', + uniqueName: 'GetListAsyncByInput', + params: { + input: input, + }, + }); +}; + +export const CreateAsyncByInput = (input: OpenIddictApplicationCreateDto) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'CreateAsync', + uniqueName: 'CreateAsyncByInput', + data: input, + }); +}; + +export const UpdateAsyncByIdAndInput = (id: string, input: OpenIddictApplicationUpdateDto) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'UpdateAsync', + uniqueName: 'UpdateAsyncByIdAndInput', + params: { + id: id, + }, + data: input, + }); +}; + +export const DeleteAsyncById = (id: string) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'DeleteAsync', + uniqueName: 'DeleteAsyncById', + params: { + id: id, + }, + }); +}; + diff --git a/apps/vue/src/api/openiddict/applications/model/index.ts b/apps/vue/src/api/openiddict/open-iddict-application/model/index.ts similarity index 59% rename from apps/vue/src/api/openiddict/applications/model/index.ts rename to apps/vue/src/api/openiddict/open-iddict-application/model/index.ts index 9a1734089..34426c97e 100644 --- a/apps/vue/src/api/openiddict/applications/model/index.ts +++ b/apps/vue/src/api/openiddict/open-iddict-application/model/index.ts @@ -1,47 +1,48 @@ -import { ExtensibleObject, ExtensibleAuditedEntity, PagedAndSortedResultRequestDto } from '../../../model/baseModel'; - -export interface OpenIddictApplicationDto extends ExtensibleAuditedEntity { - clientId: string; - clientSecret?: string; - consentType?: string; - displayName?: string; - displayNames?: {[key: string]: string}; - endpoints?: string[]; - grantTypes?: string[]; - responseTypes?: string[]; - scopes?: string[]; - postLogoutRedirectUris?: string[]; - properties?: {[key: string]: string}; - redirectUris?: string[]; - requirements?: string[]; - type?: string; - clientUri?: string; - logoUri?: string; -} - -export interface OpenIddictApplicationGetListInput extends PagedAndSortedResultRequestDto { - filter?: string; -} - -interface OpenIddictApplicationCreateOrUpdateDto extends ExtensibleObject { - clientId: string; - clientSecret?: string; - consentType?: string; - displayName?: string; - displayNames?: {[key: string]: string}; - endpoints?: string[]; - grantTypes?: string[]; - responseTypes?: string[]; - scopes?: string[]; - postLogoutRedirectUris?: string[]; - properties?: {[key: string]: string}; - redirectUris?: string[]; - requirements?: string[]; - type?: string; - clientUri?: string; - logoUri?: string; -} - -export type OpenIddictApplicationCreateDto = OpenIddictApplicationCreateOrUpdateDto; - -export type OpenIddictApplicationUpdateDto = OpenIddictApplicationCreateOrUpdateDto; +export interface OpenIddictApplicationGetListInput extends PagedAndSortedResultRequestDto { + filter?: string; +} + +export interface OpenIddictApplicationCreateDto extends OpenIddictApplicationCreateOrUpdateDto { +} + +export interface OpenIddictApplicationUpdateDto extends OpenIddictApplicationCreateOrUpdateDto { +} + +export interface OpenIddictApplicationDto extends ExtensibleAuditedEntityDto { + clientId?: string; + clientSecret?: string; + consentType?: string; + displayName?: string; + displayNames?: Dictionary; + endpoints?: string[]; + grantTypes?: string[]; + responseTypes?: string[]; + scopes?: string[]; + postLogoutRedirectUris?: string[]; + properties?: Dictionary; + redirectUris?: string[]; + requirements?: string[]; + type?: string; + clientUri?: string; + logoUri?: string; +} + +export interface OpenIddictApplicationCreateOrUpdateDto extends ExtensibleObject { + clientId: string; + clientSecret?: string; + consentType?: string; + displayName?: string; + displayNames?: Dictionary; + endpoints?: string[]; + grantTypes?: string[]; + responseTypes?: string[]; + scopes?: string[]; + postLogoutRedirectUris?: string[]; + properties?: Dictionary; + redirectUris?: string[]; + requirements?: string[]; + type?: string; + clientUri?: string; + logoUri?: string; +} + diff --git a/apps/vue/src/api/openiddict/authorizations/index.ts b/apps/vue/src/api/openiddict/open-iddict-authorization/index.ts similarity index 62% rename from apps/vue/src/api/openiddict/authorizations/index.ts rename to apps/vue/src/api/openiddict/open-iddict-authorization/index.ts index 297568c1e..545d2cff7 100644 --- a/apps/vue/src/api/openiddict/authorizations/index.ts +++ b/apps/vue/src/api/openiddict/open-iddict-authorization/index.ts @@ -1,41 +1,42 @@ -import { defAbpHttp } from '/@/utils/http/abp'; -import { - OpenIddictAuthorizationDto, - OpenIddictAuthorizationGetListInput, -} from './model'; - -const remoteServiceName = 'AbpOpenIddict'; -const controllerName = 'OpenIddictAuthorization'; - -export const getById = (id: string) => { - return defAbpHttp.request({ - service: remoteServiceName, - controller: controllerName, - action: 'GetAsync', - params: { - id: id, - }, - }); -}; - -export const getList = (input: OpenIddictAuthorizationGetListInput) => { - return defAbpHttp.pagedRequest({ - service: remoteServiceName, - controller: controllerName, - action: 'GetListAsync', - params: { - input: input, - }, - }); -}; - -export const deleteById = (id: string) => { - return defAbpHttp.request({ - service: remoteServiceName, - controller: controllerName, - action: 'DeleteAsync', - params: { - id: id, - }, - }); -}; +import { defAbpHttp } from '/@/utils/http/abp'; +import { OpenIddictAuthorizationDto,OpenIddictAuthorizationGetListInput, } from './model'; + +const remoteServiceName = 'AbpOpenIddict'; +const controllerName = 'OpenIddictAuthorization'; + +export const DeleteAsyncById = (id: string) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'DeleteAsync', + uniqueName: 'DeleteAsyncById', + params: { + id: id, + }, + }); +}; + +export const GetAsyncById = (id: string) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'GetAsync', + uniqueName: 'GetAsyncById', + params: { + id: id, + }, + }); +}; + +export const GetListAsyncByInput = (input: OpenIddictAuthorizationGetListInput) => { + return defAbpHttp.pagedRequest({ + service: remoteServiceName, + controller: controllerName, + action: 'GetListAsync', + uniqueName: 'GetListAsyncByInput', + params: { + input: input, + }, + }); +}; + diff --git a/apps/vue/src/api/openiddict/authorizations/model/index.ts b/apps/vue/src/api/openiddict/open-iddict-authorization/model/index.ts similarity index 64% rename from apps/vue/src/api/openiddict/authorizations/model/index.ts rename to apps/vue/src/api/openiddict/open-iddict-authorization/model/index.ts index 41a62d119..ca7bb95ec 100644 --- a/apps/vue/src/api/openiddict/authorizations/model/index.ts +++ b/apps/vue/src/api/openiddict/open-iddict-authorization/model/index.ts @@ -1,21 +1,20 @@ -import { ExtensibleAuditedEntity, PagedAndSortedResultRequestDto } from '../../../model/baseModel'; - -export interface OpenIddictAuthorizationDto extends ExtensibleAuditedEntity { - applicationId?: string; - creationDate?: Date; - properties?: {[key: string]: string}; - scopes?: string[]; - type?: string; - status?: string; - subject?: string; -} - -export interface OpenIddictAuthorizationGetListInput extends PagedAndSortedResultRequestDto { - filter?: string; - subject?: string; - clientId?: string; - status?: string; - type?: string; - beginCreationTime?: Date; - endCreationTime?: string; -} +export interface OpenIddictAuthorizationGetListInput extends PagedAndSortedResultRequestDto { + filter?: string; + subject?: string; + clientId?: string; + status?: string; + type?: string; + beginCreationTime?: string; + endCreationTime?: string; +} + +export interface OpenIddictAuthorizationDto extends ExtensibleAuditedEntityDto { + applicationId?: string; + creationDate?: string; + properties?: Dictionary; + scopes?: string[]; + status?: string; + subject?: string; + type?: string; +} + diff --git a/apps/vue/src/api/openiddict/scopes/index.ts b/apps/vue/src/api/openiddict/open-iddict-scope/index.ts similarity index 57% rename from apps/vue/src/api/openiddict/scopes/index.ts rename to apps/vue/src/api/openiddict/open-iddict-scope/index.ts index 2811f623a..24bcd9966 100644 --- a/apps/vue/src/api/openiddict/scopes/index.ts +++ b/apps/vue/src/api/openiddict/open-iddict-scope/index.ts @@ -1,61 +1,65 @@ -import { defAbpHttp } from '/@/utils/http/abp'; -import { - OpenIddictScopeDto, - OpenIddictScopeCreateDto, - OpenIddictScopeUpdateDto, - OpenIddictScopeGetListInput, -} from './model'; - -const remoteServiceName = 'AbpOpenIddict'; -const controllerName = 'OpenIddictScope'; - -export const getById = (id: string) => { - return defAbpHttp.request({ - service: remoteServiceName, - controller: controllerName, - action: 'GetAsync', - params: { - id: id, - }, - }); -}; - -export const getList = (input: OpenIddictScopeGetListInput) => { - return defAbpHttp.pagedRequest({ - service: remoteServiceName, - controller: controllerName, - action: 'GetListAsync', - params: { - input: input, - }, - }); -}; - -export const deleteById = (id: string) => { - return defAbpHttp.request({ - service: remoteServiceName, - controller: controllerName, - action: 'DeleteAsync', - params: { - id: id, - }, - }); -}; - -export const create = (input: OpenIddictScopeCreateDto) => { - return defAbpHttp.request({ - service: remoteServiceName, - controller: controllerName, - action: 'CreateAsync', - data: input, - }); -}; - -export const update = (input: OpenIddictScopeUpdateDto) => { - return defAbpHttp.request({ - service: remoteServiceName, - controller: controllerName, - action: 'UpdateAsync', - data: input, - }); -}; +import { defAbpHttp } from '/@/utils/http/abp'; +import { OpenIddictScopeCreateDto, OpenIddictScopeDto,OpenIddictScopeGetListInput, OpenIddictScopeUpdateDto, } from './model'; + +const remoteServiceName = 'AbpOpenIddict'; +const controllerName = 'OpenIddictScope'; + +export const CreateAsyncByInput = (input: OpenIddictScopeCreateDto) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'CreateAsync', + uniqueName: 'CreateAsyncByInput', + data: input, + }); +}; + +export const DeleteAsyncById = (id: string) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'DeleteAsync', + uniqueName: 'DeleteAsyncById', + params: { + id: id, + }, + }); +}; + +export const GetAsyncById = (id: string) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'GetAsync', + uniqueName: 'GetAsyncById', + params: { + id: id, + }, + }); +}; + +export const GetListAsyncByInput = (input: OpenIddictScopeGetListInput) => { + return defAbpHttp.pagedRequest({ + service: remoteServiceName, + controller: controllerName, + action: 'GetListAsync', + uniqueName: 'GetListAsyncByInput', + params: { + input: input, + }, + }); +}; + +export const UpdateAsyncByIdAndInput = (id: string, input: OpenIddictScopeUpdateDto) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'UpdateAsync', + uniqueName: 'UpdateAsyncByIdAndInput', + params: { + id: id, + }, + data: input, + }); +}; + diff --git a/apps/vue/src/api/openiddict/open-iddict-scope/model/index.ts b/apps/vue/src/api/openiddict/open-iddict-scope/model/index.ts new file mode 100644 index 000000000..0f0212462 --- /dev/null +++ b/apps/vue/src/api/openiddict/open-iddict-scope/model/index.ts @@ -0,0 +1,30 @@ +export interface OpenIddictScopeCreateDto extends OpenIddictScopeCreateOrUpdateDto { +} + +export interface OpenIddictScopeGetListInput extends PagedAndSortedResultRequestDto { + filter?: string; +} + +export interface OpenIddictScopeUpdateDto extends OpenIddictScopeCreateOrUpdateDto { +} + +export interface OpenIddictScopeCreateOrUpdateDto extends ExtensibleObject { + description?: string; + descriptions?: Dictionary; + displayName?: string; + displayNames?: Dictionary; + name: string; + properties?: Dictionary; + resources?: string[]; +} + +export interface OpenIddictScopeDto extends ExtensibleAuditedEntityDto { + description?: string; + descriptions?: Dictionary; + displayName?: string; + displayNames?: Dictionary; + name?: string; + properties?: Dictionary; + resources?: string[]; +} + diff --git a/apps/vue/src/api/openiddict/tokens/index.ts b/apps/vue/src/api/openiddict/open-iddict-token/index.ts similarity index 63% rename from apps/vue/src/api/openiddict/tokens/index.ts rename to apps/vue/src/api/openiddict/open-iddict-token/index.ts index 3f0e40621..5e3a11218 100644 --- a/apps/vue/src/api/openiddict/tokens/index.ts +++ b/apps/vue/src/api/openiddict/open-iddict-token/index.ts @@ -1,41 +1,42 @@ -import { defAbpHttp } from '/@/utils/http/abp'; -import { - OpenIddictTokenDto, - OpenIddictTokenGetListInput, -} from './model'; - -const remoteServiceName = 'AbpOpenIddict'; -const controllerName = 'OpenIddictToken'; - -export const getById = (id: string) => { - return defAbpHttp.request({ - service: remoteServiceName, - controller: controllerName, - action: 'GetAsync', - params: { - id: id, - }, - }); -}; - -export const getList = (input: OpenIddictTokenGetListInput) => { - return defAbpHttp.pagedRequest({ - service: remoteServiceName, - controller: controllerName, - action: 'GetListAsync', - params: { - input: input, - }, - }); -}; - -export const deleteById = (id: string) => { - return defAbpHttp.request({ - service: remoteServiceName, - controller: controllerName, - action: 'DeleteAsync', - params: { - id: id, - }, - }); -}; +import { defAbpHttp } from '/@/utils/http/abp'; +import { OpenIddictTokenDto,OpenIddictTokenGetListInput, } from './model'; + +const remoteServiceName = 'AbpOpenIddict'; +const controllerName = 'OpenIddictToken'; + +export const DeleteAsyncById = (id: string) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'DeleteAsync', + uniqueName: 'DeleteAsyncById', + params: { + id: id, + }, + }); +}; + +export const GetAsyncById = (id: string) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'GetAsync', + uniqueName: 'GetAsyncById', + params: { + id: id, + }, + }); +}; + +export const GetListAsyncByInput = (input: OpenIddictTokenGetListInput) => { + return defAbpHttp.pagedRequest({ + service: remoteServiceName, + controller: controllerName, + action: 'GetListAsync', + uniqueName: 'GetListAsyncByInput', + params: { + input: input, + }, + }); +}; + diff --git a/apps/vue/src/api/openiddict/tokens/model/index.ts b/apps/vue/src/api/openiddict/open-iddict-token/model/index.ts similarity index 65% rename from apps/vue/src/api/openiddict/tokens/model/index.ts rename to apps/vue/src/api/openiddict/open-iddict-token/model/index.ts index 273740fac..81dcfc3e3 100644 --- a/apps/vue/src/api/openiddict/tokens/model/index.ts +++ b/apps/vue/src/api/openiddict/open-iddict-token/model/index.ts @@ -1,29 +1,28 @@ -import { ExtensibleAuditedEntity, PagedAndSortedResultRequestDto } from '../../../model/baseModel'; - -export interface OpenIddictTokenDto extends ExtensibleAuditedEntity { - applicationId?: string; - authorizationId?: string; - creationDate?: Date; - expirationDate?: Date; - payload?: string; - properties?: string; - redemptionDate?: Date; - referenceId?: string; - type?: string; - status?: string; - subject?: string; -} - -export interface OpenIddictTokenGetListInput extends PagedAndSortedResultRequestDto { - filter?: string; - clientId?: string; - authorizationId?: string; - subject?: string; - status?: string; - type?: string; - referenceId?: string; - beginCreationTime?: Date; - endCreationTime?: string; - beginExpirationDate?: Date; - endExpirationDate?: Date; -} +export interface OpenIddictTokenGetListInput extends PagedAndSortedResultRequestDto { + filter?: string; + clientId?: string; + authorizationId?: string; + subject?: string; + status?: string; + type?: string; + referenceId?: string; + beginExpirationDate?: string; + endExpirationDate?: string; + beginCreationTime?: string; + endCreationTime?: string; +} + +export interface OpenIddictTokenDto extends ExtensibleAuditedEntityDto { + applicationId?: string; + authorizationId?: string; + creationDate?: string; + expirationDate?: string; + payload?: string; + properties?: string; + redemptionDate?: string; + referenceId?: string; + status?: string; + subject?: string; + type?: string; +} + diff --git a/apps/vue/src/api/openiddict/scopes/model/index.ts b/apps/vue/src/api/openiddict/scopes/model/index.ts deleted file mode 100644 index 9b8de3ef7..000000000 --- a/apps/vue/src/api/openiddict/scopes/model/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { ExtensibleObject, ExtensibleAuditedEntity, PagedAndSortedResultRequestDto } from '../../../model/baseModel'; - -export interface OpenIddictScopeDto extends ExtensibleAuditedEntity { - name: string; - displayName?: string; - displayNames?: {[key: string]: string}; - description?: string; - descriptions?: {[key: string]: string}; - properties?: {[key: string]: string}; - resources?: {[key: string]: string}; -} - -export interface OpenIddictScopeGetListInput extends PagedAndSortedResultRequestDto { - filter?: string; -} - -interface OpenIddictScopeCreateOrUpdateDto extends ExtensibleObject { - name: string; - displayName?: string; - displayNames?: {[key: string]: string}; - description?: string; - descriptions?: {[key: string]: string}; - properties?: {[key: string]: string}; - resources?: {[key: string]: string}; -} - -export type OpenIddictScopeCreateDto = OpenIddictScopeCreateOrUpdateDto; - -export type OpenIddictScopeUpdateDto = OpenIddictScopeCreateOrUpdateDto; diff --git a/apps/vue/src/api/saas/edition/index.ts b/apps/vue/src/api/saas/edition/index.ts new file mode 100644 index 000000000..d2db7f995 --- /dev/null +++ b/apps/vue/src/api/saas/edition/index.ts @@ -0,0 +1,64 @@ +import { defAbpHttp } from '/@/utils/http/abp'; +import { EditionCreateDto, EditionDto,EditionGetListInput, EditionUpdateDto, } from './model'; + +const remoteServiceName = 'AbpSaas'; +const controllerName = 'Edition'; + +export const CreateAsyncByInput = (input: EditionCreateDto) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'CreateAsync', + uniqueName: 'CreateAsyncByInput', + data: input, + }); +}; + +export const DeleteAsyncById = (id: string) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'DeleteAsync', + uniqueName: 'DeleteAsyncById', + params: { + id: id, + }, + }); +}; + +export const GetAsyncById = (id: string) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'GetAsync', + uniqueName: 'GetAsyncById', + params: { + id: id, + }, + }); +}; + +export const GetListAsyncByInput = (input: EditionGetListInput) => { + return defAbpHttp.pagedRequest({ + service: remoteServiceName, + controller: controllerName, + action: 'GetListAsync', + uniqueName: 'GetListAsyncByInput', + params: { + input: input, + }, + }); +}; + +export const UpdateAsyncByIdAndInput = (id: string, input: EditionUpdateDto) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'UpdateAsync', + uniqueName: 'UpdateAsyncByIdAndInput', + params: { + id: id, + }, + data: input, + }); +}; diff --git a/apps/vue/src/api/saas/edition/model/index.ts b/apps/vue/src/api/saas/edition/model/index.ts new file mode 100644 index 000000000..e6f205b59 --- /dev/null +++ b/apps/vue/src/api/saas/edition/model/index.ts @@ -0,0 +1,20 @@ +export interface EditionCreateDto extends EditionCreateOrUpdateBase { +} + +export interface EditionGetListInput extends PagedAndSortedResultRequestDto { + filter?: string; +} + +export interface EditionUpdateDto extends EditionCreateOrUpdateBase { + concurrencyStamp?: string; +} + +export interface EditionCreateOrUpdateBase extends ExtensibleObject { + displayName: string; +} + +export interface EditionDto extends ExtensibleAuditedEntityDto { + displayName?: string; + concurrencyStamp?: string; +} + diff --git a/apps/vue/src/api/saas/editions.ts b/apps/vue/src/api/saas/editions.ts deleted file mode 100644 index 8d4aae1b6..000000000 --- a/apps/vue/src/api/saas/editions.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { defAbpHttp } from '/@/utils/http/abp'; -import { - Edition, - EditionCreate, - EditionUpdate, - EditionGetListInput, -} from './model/editionsModel'; -import { format } from '/@/utils/strings'; -import { PagedResultDto } from '../model/baseModel'; - -enum Api { - Create = '/api/saas/editions', - DeleteById = '/api/saas/editions/{id}', - GetById = '/api/saas/editions/{id}', - GetList = '/api/saas/editions', - Update = '/api/saas/editions/{id}', -} - -export const getById = (id: string) => { - return defAbpHttp.get({ - url: format(Api.GetById, { id: id }), - }); -}; - -export const getList = (input: EditionGetListInput) => { - return defAbpHttp.get>({ - url: Api.GetList, - params: input, - }); -}; - -export const create = (input: EditionCreate) => { - return defAbpHttp.post({ - url: Api.Create, - data: input, - }); -}; - -export const deleteById = (id: string) => { - return defAbpHttp.delete({ - url: format(Api.GetById, { id: id }), - }); -}; - -export const update = (id: string, input: EditionUpdate) => { - return defAbpHttp.put({ - url: format(Api.Update, { id: id }), - data: input, - }); -}; diff --git a/apps/vue/src/api/saas/model/editionsModel.ts b/apps/vue/src/api/saas/model/editionsModel.ts deleted file mode 100644 index 2001d7299..000000000 --- a/apps/vue/src/api/saas/model/editionsModel.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { - IHasConcurrencyStamp, - AuditedEntityDto, - PagedAndSortedResultRequestDto, -} from '../../model/baseModel'; - -export interface Edition extends AuditedEntityDto { - id: string; - displayName: string; -} - -interface EditionCreateOrUpdate { - displayName: string; -} - -export type EditionCreate = EditionCreateOrUpdate; - -export interface EditionUpdate extends EditionCreateOrUpdate, IHasConcurrencyStamp { -} - -export interface EditionGetListInput extends PagedAndSortedResultRequestDto { - filter?: string; -} diff --git a/apps/vue/src/api/saas/model/tenantModel.ts b/apps/vue/src/api/saas/model/tenantModel.ts deleted file mode 100644 index cf709a8d4..000000000 --- a/apps/vue/src/api/saas/model/tenantModel.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { - AuditedEntityDto, - ListResultDto, - PagedAndSortedResultRequestDto, - PagedResultDto, -} from '../../model/baseModel'; - -/** 与 multi-tenancy中不同,此为管理tenant api */ -export interface Tenant extends AuditedEntityDto { - id: string; - name: string; - editionId?: string; - editionName?: string; - isActive: boolean; - enableTime?: Date; - disableTime?: Date; -} - -export interface TenantConnectionString { - name: string; - value: string; -} - -export interface CreateTenant { - name: string; - adminEmailAddress: string; - adminPassword: string; - editionId?: string; - isActive: boolean; - enableTime?: Date; - disableTime?: Date; -} - -export interface UpdateTenant { - name: string; - editionId?: string; - isActive: boolean; - enableTime?: Date; - disableTime?: Date; -} - -export interface GetTenantPagedRequest extends PagedAndSortedResultRequestDto { - filter?: string; -} - -export type TenantPagedResult = PagedResultDto; - -export type TenantConnectionStringListResult = ListResultDto; diff --git a/apps/vue/src/api/saas/tenant.ts b/apps/vue/src/api/saas/tenant.ts deleted file mode 100644 index 74d3821bb..000000000 --- a/apps/vue/src/api/saas/tenant.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { defAbpHttp } from '/@/utils/http/abp'; -import { - Tenant, - CreateTenant, - UpdateTenant, - GetTenantPagedRequest, - TenantPagedResult, - TenantConnectionString, - TenantConnectionStringListResult, -} from './model/tenantModel'; -import { format } from '/@/utils/strings'; - -/** 与 multi-tenancy中不同,此为管理tenant api */ -enum Api { - Create = '/api/saas/tenants', - DeleteById = '/api/saas/tenants/{id}', - GetById = '/api/saas/tenants/{id}', - GetList = '/api/saas/tenants', - Update = '/api/saas/tenants/{id}', - GetConnectionStrings = '/api/saas/tenants/{id}/connection-string', - SetConnectionString = '/api/saas/tenants/{id}/connection-string', - DeleteConnectionString = '/api/saas/tenants/{id}/connection-string/{name}', -} - -export const getById = (id: string) => { - return defAbpHttp.get({ - url: format(Api.GetById, { id: id }), - }); -}; - -export const getList = (input: GetTenantPagedRequest) => { - return defAbpHttp.get({ - url: Api.GetList, - params: input, - }); -}; - -export const create = (input: CreateTenant) => { - return defAbpHttp.post({ - url: Api.Create, - data: input, - }); -}; - -export const deleteById = (id: string) => { - return defAbpHttp.delete({ - url: format(Api.GetById, { id: id }), - }); -}; - -export const update = (id: string, input: UpdateTenant) => { - return defAbpHttp.put({ - url: format(Api.Update, { id: id }), - data: input, - }); -}; - -export const getConnectionStrings = (id: string) => { - return defAbpHttp.get({ - url: format(Api.GetConnectionStrings, { id: id }), - }); -}; - -export const setConnectionString = (id: string, input: TenantConnectionString) => { - return defAbpHttp.put({ - url: format(Api.SetConnectionString, { id: id }), - data: input, - }); -}; - -export const deleteConnectionString = (id: string, name: string) => { - return defAbpHttp.delete({ - url: format(Api.DeleteConnectionString, { id: id, name: name }), - }); -}; diff --git a/apps/vue/src/api/saas/tenant/index.ts b/apps/vue/src/api/saas/tenant/index.ts new file mode 100644 index 000000000..8b65d95e8 --- /dev/null +++ b/apps/vue/src/api/saas/tenant/index.ts @@ -0,0 +1,127 @@ +import { defAbpHttp } from '/@/utils/http/abp'; +import { TenantDto,TenantGetListInput, TenantCreateDto, TenantUpdateDto, TenantConnectionStringDto,TenantConnectionStringCreateOrUpdate, } from './model'; + +const remoteServiceName = 'AbpSaas'; +const controllerName = 'Tenant'; + +export const GetAsyncById = (id: string) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'GetAsync', + uniqueName: 'GetAsyncById', + params: { + id: id, + }, + }); +}; + +export const GetAsyncByName = (name: string) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'GetAsync', + uniqueName: 'GetAsyncByName', + params: { + name: name, + }, + }); +}; + +export const GetListAsyncByInput = (input: TenantGetListInput) => { + return defAbpHttp.pagedRequest({ + service: remoteServiceName, + controller: controllerName, + action: 'GetListAsync', + uniqueName: 'GetListAsyncByInput', + params: { + input: input, + }, + }); +}; + +export const CreateAsyncByInput = (input: TenantCreateDto) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'CreateAsync', + uniqueName: 'CreateAsyncByInput', + data: input, + }); +}; + +export const UpdateAsyncByIdAndInput = (id: string, input: TenantUpdateDto) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'UpdateAsync', + uniqueName: 'UpdateAsyncByIdAndInput', + params: { + id: id, + }, + data: input, + }); +}; + +export const DeleteAsyncById = (id: string) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'DeleteAsync', + uniqueName: 'DeleteAsyncById', + params: { + id: id, + }, + }); +}; + +export const GetConnectionStringAsyncByIdAndName = (id: string, name: string) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'GetConnectionStringAsync', + uniqueName: 'GetConnectionStringAsyncByIdAndName', + params: { + id: id, + name: name, + }, + }); +}; + +export const GetConnectionStringAsyncById = (id: string) => { + return defAbpHttp.listRequest({ + service: remoteServiceName, + controller: controllerName, + action: 'GetConnectionStringAsync', + uniqueName: 'GetConnectionStringAsyncById', + params: { + id: id, + }, + }); +}; + +export const SetConnectionStringAsyncByIdAndInput = (id: string, input: TenantConnectionStringCreateOrUpdate) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'SetConnectionStringAsync', + uniqueName: 'SetConnectionStringAsyncByIdAndInput', + params: { + id: id, + }, + data: input, + }); +}; + +export const DeleteConnectionStringAsyncByIdAndName = (id: string, name: string) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'DeleteConnectionStringAsync', + uniqueName: 'DeleteConnectionStringAsyncByIdAndName', + params: { + id: id, + name: name, + }, + }); +}; diff --git a/apps/vue/src/api/saas/tenant/model/index.ts b/apps/vue/src/api/saas/tenant/model/index.ts new file mode 100644 index 000000000..0281abfa6 --- /dev/null +++ b/apps/vue/src/api/saas/tenant/model/index.ts @@ -0,0 +1,43 @@ +export interface TenantGetListInput extends PagedAndSortedResultRequestDto { + filter?: string; +} + +export interface TenantCreateDto extends TenantCreateOrUpdateBase { + adminEmailAddress: string; + adminPassword: string; + useSharedDatabase?: boolean; + defaultConnectionString?: string; +} + +export interface TenantUpdateDto extends TenantCreateOrUpdateBase { + concurrencyStamp?: string; +} + +export interface TenantConnectionStringCreateOrUpdate { + name: string; + value: string; +} + +export interface TenantDto extends ExtensibleAuditedEntityDto { + name?: string; + editionId?: string; + editionName?: string; + isActive?: boolean; + enableTime?: string; + disableTime?: string; + concurrencyStamp?: string; +} + +export interface TenantCreateOrUpdateBase extends ExtensibleObject { + name: string; + isActive?: boolean; + editionId?: string; + enableTime?: string; + disableTime?: string; +} + +export interface TenantConnectionStringDto { + name?: string; + value?: string; +} + diff --git a/apps/vue/src/utils/http/abp/abp.ts b/apps/vue/src/utils/http/abp/abp.ts index 4ae87f2d0..fb7b04ed2 100644 --- a/apps/vue/src/utils/http/abp/abp.ts +++ b/apps/vue/src/utils/http/abp/abp.ts @@ -23,6 +23,7 @@ export class abpRequest { service: string; controller: string; action: string; + uniqueName?: string; data?: any; params?: any; }) { @@ -33,6 +34,7 @@ export class abpRequest { service: string; controller: string; action: string; + uniqueName?: string; data?: any; params?: any; }) { @@ -63,6 +65,7 @@ export class abpRequest { service: string; controller: string; action: string; + uniqueName?: string; data?: any; params?: any; }, requestOptions?: RequestOptions) { @@ -75,7 +78,7 @@ export class abpRequest { const abpStore = useAbpStoreWithOut(); const module = this.getModule(options.service, abpStore.apidefinition.modules); const controller = this.getController(options.controller, module.controllers); - const action = this.getAction(options.action, controller.actions); + const action = this.getAction(options.action, controller.actions, options.uniqueName); method = action.httpMethod; const apiVersion = this.getApiVersionInfo(action); @@ -140,12 +143,18 @@ export class abpRequest { return controllers[controllerKeys[index]]; } - private getAction(actionName: string, actions: { [key: string]: ActionApiDescriptionModel }) { + private getAction(actionName: string, actions: { [key: string]: ActionApiDescriptionModel }, uniqueName?: string) { const actionKeys = Object.keys(actions); const index = actionKeys.findIndex((key) => { const a = actions[key]; - if (a.name.toLowerCase() === actionName.toLowerCase()) { - return a; + if (uniqueName) { + if (a.uniqueName.toLowerCase() === uniqueName.toLowerCase()) { + return a; + } + } else { + if (a.name.toLowerCase() === actionName.toLowerCase()) { + return a; + } } }); if (index < 0) { diff --git a/apps/vue/src/views/openiddict/applications/components/ApplicationTable.vue b/apps/vue/src/views/openiddict/applications/components/ApplicationTable.vue index e644e72d0..dbf1bb3f8 100644 --- a/apps/vue/src/views/openiddict/applications/components/ApplicationTable.vue +++ b/apps/vue/src/views/openiddict/applications/components/ApplicationTable.vue @@ -35,7 +35,7 @@ import { useModal } from '/@/components/Modal'; import { useMessage } from '/@/hooks/web/useMessage'; import { useLocalization } from '/@/hooks/abp/useLocalization'; - import { getList, deleteById } from '/@/api/openiddict/applications'; + import { GetListAsyncByInput, DeleteAsyncById } from '/@/api/openiddict/open-iddict-application'; import { formatPagedRequest } from '/@/utils/http/abp/helper'; import ApplicationModal from './ApplicationModal.vue'; @@ -45,7 +45,7 @@ const [registerTable, { reload }] = useTable({ rowKey: 'id', title: L('Applications'), - api: getList, + api: GetListAsyncByInput, columns: getDataColumns(), beforeFetch: formatPagedRequest, pagination: true, @@ -74,7 +74,7 @@ title: L('AreYouSure'), content: L('ItemWillBeDeletedMessage'), onOk: () => { - return deleteById(record.key).then(() => { + return DeleteAsyncById(record.key).then(() => { createMessage.success(L('SuccessfullyDeleted')); reload(); }); diff --git a/apps/vue/src/views/openiddict/authorizations/components/AuthorizationModal.vue b/apps/vue/src/views/openiddict/authorizations/components/AuthorizationModal.vue index ad841b6a2..4a4129986 100644 --- a/apps/vue/src/views/openiddict/authorizations/components/AuthorizationModal.vue +++ b/apps/vue/src/views/openiddict/authorizations/components/AuthorizationModal.vue @@ -18,7 +18,7 @@ import { useLocalization } from '/@/hooks/abp/useLocalization'; import { getModalFormSchemas } from '../datas/ModalData'; import { formatToDateTime } from '/@/utils/dateUtil'; - import { getById } from '/@/api/openiddict/authorizations'; + import { GetAsyncById } from '/@/api/openiddict/open-iddict-authorization'; const { L } = useLocalization('AbpOpenIddict'); const [registerForm, { setFieldsValue, resetFields }] = useForm({ @@ -37,7 +37,7 @@ }); function fetchToken(id: string) { - getById(id).then((token) => { + GetAsyncById(id).then((token) => { setFieldsValue(token); }); } diff --git a/apps/vue/src/views/openiddict/authorizations/components/AuthorizationTable.vue b/apps/vue/src/views/openiddict/authorizations/components/AuthorizationTable.vue index 625a23aee..b66f460c1 100644 --- a/apps/vue/src/views/openiddict/authorizations/components/AuthorizationTable.vue +++ b/apps/vue/src/views/openiddict/authorizations/components/AuthorizationTable.vue @@ -35,7 +35,7 @@ import { useModal } from '/@/components/Modal'; import { useMessage } from '/@/hooks/web/useMessage'; import { useLocalization } from '/@/hooks/abp/useLocalization'; - import { getList, deleteById } from '/@/api/openiddict/authorizations'; + import { GetListAsyncByInput, DeleteAsyncById } from '/@/api/openiddict/open-iddict-authorization'; import { formatPagedRequest } from '/@/utils/http/abp/helper'; import AuthorizationModal from './AuthorizationModal.vue'; @@ -45,7 +45,7 @@ const [registerTable, { reload }] = useTable({ rowKey: 'id', title: L('Authorizations'), - api: getList, + api: GetListAsyncByInput, columns: getDataColumns(), beforeFetch: formatPagedRequest, pagination: true, @@ -74,7 +74,7 @@ title: L('AreYouSure'), content: L('ItemWillBeDeletedMessage'), onOk: () => { - return deleteById(record.key).then(() => { + return DeleteAsyncById(record.key).then(() => { createMessage.success(L('SuccessfullyDeleted')); reload(); }); diff --git a/apps/vue/src/views/openiddict/authorizations/datas/ModalData.ts b/apps/vue/src/views/openiddict/authorizations/datas/ModalData.ts index 007a03d1a..fb038d8c9 100644 --- a/apps/vue/src/views/openiddict/authorizations/datas/ModalData.ts +++ b/apps/vue/src/views/openiddict/authorizations/datas/ModalData.ts @@ -1,6 +1,6 @@ import { useLocalization } from '/@/hooks/abp/useLocalization'; import { FormProps, FormSchema } from '/@/components/Form'; -import { getList as getApplications } from '/@/api/openiddict/applications'; +import { GetListAsyncByInput as getApplications } from '/@/api/openiddict/open-iddict-application'; const { L } = useLocalization(['AbpOpenIddict']); diff --git a/apps/vue/src/views/openiddict/tokens/components/TokenModal.vue b/apps/vue/src/views/openiddict/tokens/components/TokenModal.vue index ddf811ff5..adfb8011a 100644 --- a/apps/vue/src/views/openiddict/tokens/components/TokenModal.vue +++ b/apps/vue/src/views/openiddict/tokens/components/TokenModal.vue @@ -18,7 +18,7 @@ import { useLocalization } from '/@/hooks/abp/useLocalization'; import { getModalFormSchemas } from '../datas/ModalData'; import { formatToDateTime } from '/@/utils/dateUtil'; - import { getById } from '/@/api/openiddict/tokens'; + import { GetAsyncById } from '/@/api/openiddict/open-iddict-token'; const { L } = useLocalization('AbpOpenIddict'); const [registerForm, { setFieldsValue, resetFields }] = useForm({ @@ -37,7 +37,7 @@ }); function fetchToken(id: string) { - getById(id).then((token) => { + GetAsyncById(id).then((token) => { setFieldsValue(token); }); } diff --git a/apps/vue/src/views/openiddict/tokens/components/TokenTable.vue b/apps/vue/src/views/openiddict/tokens/components/TokenTable.vue index 107ee795e..a16e6c586 100644 --- a/apps/vue/src/views/openiddict/tokens/components/TokenTable.vue +++ b/apps/vue/src/views/openiddict/tokens/components/TokenTable.vue @@ -35,7 +35,7 @@ import { useModal } from '/@/components/Modal'; import { useMessage } from '/@/hooks/web/useMessage'; import { useLocalization } from '/@/hooks/abp/useLocalization'; - import { getList, deleteById } from '/@/api/openiddict/tokens'; + import { GetListAsyncByInput, DeleteAsyncById } from '/@/api/openiddict/open-iddict-token'; import { formatPagedRequest } from '/@/utils/http/abp/helper'; import TokenModal from './TokenModal.vue'; @@ -45,7 +45,7 @@ const [registerTable, { reload }] = useTable({ rowKey: 'id', title: L('Tokens'), - api: getList, + api: GetListAsyncByInput, columns: getDataColumns(), beforeFetch: formatPagedRequest, pagination: true, @@ -74,7 +74,7 @@ title: L('AreYouSure'), content: L('ItemWillBeDeletedMessage'), onOk: () => { - return deleteById(record.id).then(() => { + return DeleteAsyncById(record.id).then(() => { createMessage.success(L('SuccessfullyDeleted')); reload(); }); diff --git a/apps/vue/src/views/saas/editions/components/EditionModal.vue b/apps/vue/src/views/saas/editions/components/EditionModal.vue index 6b857f958..115c43932 100644 --- a/apps/vue/src/views/saas/editions/components/EditionModal.vue +++ b/apps/vue/src/views/saas/editions/components/EditionModal.vue @@ -23,7 +23,7 @@ import { BasicForm, useForm } from '/@/components/Form'; import { BasicModal, useModalInner } from '/@/components/Modal'; import { getModalFormSchemas } from '../datas//ModalData'; - import { getById, create, update } from '/@/api/saas/editions'; + import { GetAsyncById, CreateAsyncByInput, UpdateAsyncByIdAndInput } from '/@/api/saas/edition'; const emits = defineEmits(['change', 'register']); const { createMessage } = useMessage(); @@ -51,7 +51,7 @@ }); return; } - getById(editionId).then((edition) => { + GetAsyncById(editionId).then((edition) => { nextTick(() => { setFieldsValue(edition); }); @@ -61,7 +61,7 @@ function handleSubmit() { validate().then((input) => { changeOkLoading(true); - const api = input.id ? update(input.id, input) : create(input); + const api = input.id ? UpdateAsyncByIdAndInput(input.id, input) : CreateAsyncByInput(input); api.then((edition) => { createMessage.success(L('Successful')); emits('change', edition); diff --git a/apps/vue/src/views/saas/editions/components/EditionTable.vue b/apps/vue/src/views/saas/editions/components/EditionTable.vue index 85a72640c..e655f6899 100644 --- a/apps/vue/src/views/saas/editions/components/EditionTable.vue +++ b/apps/vue/src/views/saas/editions/components/EditionTable.vue @@ -51,7 +51,7 @@ import { BasicTable, TableAction, useTable } from '/@/components/Table'; import { useFeatureModal } from '../hooks/useFeatureModal'; import { FeatureModal } from '../../../feature'; - import { deleteById, getList } from '../../../../api/saas/editions'; + import { DeleteAsyncById, GetListAsyncByInput } from '/@/api/saas/edition'; import { getDataColumns } from '../datas/TableData'; import { getSearchFormSchemas } from '../datas//ModalData'; import { formatPagedRequest } from '/@/utils/http/abp/helper'; @@ -66,7 +66,7 @@ rowKey: 'id', title: L('Editions'), columns: getDataColumns(), - api: getList, + api: GetListAsyncByInput, beforeFetch: formatPagedRequest, pagination: true, striped: false, @@ -100,7 +100,7 @@ content: L('ItemWillBeDeletedMessageWithFormat', record.displayName), okCancel: true, onOk: () => { - return deleteById(record.id).then(() => { + return DeleteAsyncById(record.id).then(() => { createMessage.success(L('SuccessfullyDeleted')); reload(); }); diff --git a/apps/vue/src/views/saas/tenant/components/ConnectionEditModal.vue b/apps/vue/src/views/saas/tenant/components/ConnectionEditModal.vue index 5e19ef868..fe8a7d868 100644 --- a/apps/vue/src/views/saas/tenant/components/ConnectionEditModal.vue +++ b/apps/vue/src/views/saas/tenant/components/ConnectionEditModal.vue @@ -14,7 +14,7 @@ import { useLocalization } from '/@/hooks/abp/useLocalization'; import { BasicForm, useForm } from '/@/components/Form'; import { BasicModal, useModalInner } from '/@/components/Modal'; - import { setConnectionString } from '/@/api/saas/tenant'; + import { SetConnectionStringAsyncByIdAndInput } from '/@/api/saas/tenant'; import { getConnectionFormSchemas } from '../datas//ModalData'; const emits = defineEmits(['change', 'register']); @@ -39,7 +39,7 @@ function handleSubmit() { validate().then((input) => { changeOkLoading(true); - setConnectionString(input.id, input).then(() => { + SetConnectionStringAsyncByIdAndInput(input.id, input).then(() => { createMessage.success(L('Successful')); closeModal(); emits('change'); diff --git a/apps/vue/src/views/saas/tenant/components/ConnectionTableModal.vue b/apps/vue/src/views/saas/tenant/components/ConnectionTableModal.vue index 45525cbba..4a4588f84 100644 --- a/apps/vue/src/views/saas/tenant/components/ConnectionTableModal.vue +++ b/apps/vue/src/views/saas/tenant/components/ConnectionTableModal.vue @@ -44,7 +44,7 @@ import { BasicTable, TableAction, useTable } from '/@/components/Table'; import { BasicModal, useModal, useModalInner } from '/@/components/Modal'; import { getConnectionStringsColumns } from '../datas/TableData'; - import { deleteConnectionString, getConnectionStrings } from '/@/api/saas/tenant'; + import { DeleteConnectionStringAsyncByIdAndName, GetConnectionStringAsyncById } from '/@/api/saas/tenant'; import ConnectionEditModal from './ConnectionEditModal.vue'; defineEmits(['register']); @@ -86,7 +86,7 @@ content: L('TenantDeletionConfirmationMessage', [record.name]), okCancel: true, onOk: () => { - return deleteConnectionString(unref(tenantIdRef), record.name).then(() => { + return DeleteConnectionStringAsyncByIdAndName(unref(tenantIdRef), record.name).then(() => { createMessage.success(L('SuccessfullyDeleted')); handleReloadTable(); }); @@ -97,7 +97,7 @@ function handleReloadTable() { const tenantId = unref(tenantIdRef); if (tenantId) { - getConnectionStrings(tenantId).then((res) => { + GetConnectionStringAsyncById(tenantId).then((res) => { connectionsRef.value = res.items; }); } diff --git a/apps/vue/src/views/saas/tenant/components/TenantModal.vue b/apps/vue/src/views/saas/tenant/components/TenantModal.vue index c6c8cad55..7ec09a3a4 100644 --- a/apps/vue/src/views/saas/tenant/components/TenantModal.vue +++ b/apps/vue/src/views/saas/tenant/components/TenantModal.vue @@ -23,7 +23,7 @@ import { BasicForm, useForm } from '/@/components/Form'; import { BasicModal, useModalInner } from '/@/components/Modal'; import { getModalFormSchemas } from '../datas//ModalData'; - import { getById, create, update } from '/@/api/saas/tenant'; + import { GetAsyncById, CreateAsyncByInput, UpdateAsyncByIdAndInput } from '/@/api/saas/tenant'; const emits = defineEmits(['change', 'register']); @@ -46,7 +46,7 @@ title.value = L('Edit'); resetFields(); if (id) { - getById(id).then((res) => { + GetAsyncById(id).then((res) => { setFieldsValue(res); title.value = L('NewTenant'); }); @@ -56,7 +56,7 @@ function handleSubmit() { validate().then((input) => { loading.value = true; - const api = input.id ? update(input.id, input) : create(input); + const api = input.id ? UpdateAsyncByIdAndInput(input.id, input) : CreateAsyncByInput(input); api.then(() => { createMessage.success(L('Successful')); emits('change'); diff --git a/apps/vue/src/views/saas/tenant/datas/ModalData.ts b/apps/vue/src/views/saas/tenant/datas/ModalData.ts index f2440a223..62d7a6323 100644 --- a/apps/vue/src/views/saas/tenant/datas/ModalData.ts +++ b/apps/vue/src/views/saas/tenant/datas/ModalData.ts @@ -2,7 +2,7 @@ import { useLocalization } from '/@/hooks/abp/useLocalization'; import { useValidation } from '/@/hooks/abp/useValidation'; import { usePasswordValidator } from '/@/hooks/security/usePasswordValidator'; import { FormProps, FormSchema } from '/@/components/Form'; -import { getList as getEditions } from '/@/api/saas/editions'; +import { GetListAsyncByInput as getEditions } from '/@/api/saas/edition'; const { L } = useLocalization('AbpSaas'); const { ruleCreator } = useValidation(); diff --git a/apps/vue/src/views/saas/tenant/hooks/useTenantTable.ts b/apps/vue/src/views/saas/tenant/hooks/useTenantTable.ts index 7995b4c96..55eb7ce9f 100644 --- a/apps/vue/src/views/saas/tenant/hooks/useTenantTable.ts +++ b/apps/vue/src/views/saas/tenant/hooks/useTenantTable.ts @@ -6,7 +6,7 @@ import { useLocalization } from '/@/hooks/abp/useLocalization'; import { TableActionType, useTable } from '/@/components/Table'; import { getDataColumns } from '../datas/TableData'; import { getSearchFormSchemas } from '../datas//ModalData'; -import { deleteById, getList } from '/@/api/saas/tenant'; +import { DeleteAsyncById, GetListAsyncByInput } from '/@/api/saas/tenant'; import { formatPagedRequest } from '/@/utils/http/abp/helper'; interface UseTenantTable { @@ -20,7 +20,7 @@ export function useTenantTable({ tableElRef }: UseTenantTable) { rowKey: 'id', title: L('Tenants'), columns: getDataColumns(), - api: getList, + api: GetListAsyncByInput, beforeFetch: formatPagedRequest, pagination: true, striped: false, @@ -46,7 +46,7 @@ export function useTenantTable({ tableElRef }: UseTenantTable) { content: L('ItemWillBeDeletedMessageWithFormat', [record.name]), okCancel: true, onOk: () => { - return deleteById(record.id).then(() => { + return DeleteAsyncById(record.id).then(() => { createMessage.success(L('SuccessfullyDeleted')); handleReload(); }); diff --git a/apps/vue/src/views/webhooks/send-attempts/datas/ModalData.ts b/apps/vue/src/views/webhooks/send-attempts/datas/ModalData.ts index 17c02fdc4..4d007bf8a 100644 --- a/apps/vue/src/views/webhooks/send-attempts/datas/ModalData.ts +++ b/apps/vue/src/views/webhooks/send-attempts/datas/ModalData.ts @@ -1,6 +1,6 @@ import { useLocalization } from '/@/hooks/abp/useLocalization'; import { FormProps } from '/@/components/Form'; -import { getList as getTenants } from '/@/api/saas/tenant'; +import { GetListAsyncByInput as getTenants } from '/@/api/saas/tenant'; import { getList as getSubscriptions } from '/@/api/webhooks/subscriptions'; import { httpStatusOptions } from '../../typing'; diff --git a/apps/vue/src/views/webhooks/subscriptions/components/SubscriptionModal.vue b/apps/vue/src/views/webhooks/subscriptions/components/SubscriptionModal.vue index fb7fed400..16b10c66c 100644 --- a/apps/vue/src/views/webhooks/subscriptions/components/SubscriptionModal.vue +++ b/apps/vue/src/views/webhooks/subscriptions/components/SubscriptionModal.vue @@ -71,7 +71,7 @@ import { CodeEditorX, MODE } from '/@/components/CodeEditor'; import { BasicModal, useModalInner } from '/@/components/Modal'; import { Tenant } from '/@/api/saas/model/tenantModel'; - import { getList as getTenants } from '/@/api/saas/tenant'; + import { GetListAsyncByInput as getTenants } from '/@/api/saas/tenant'; import { getById, create, update, getAllAvailableWebhooks } from '/@/api/webhooks/subscriptions'; import { WebhookSubscription, diff --git a/apps/vue/src/views/webhooks/subscriptions/datas/ModalData.ts b/apps/vue/src/views/webhooks/subscriptions/datas/ModalData.ts index c3b540118..3d5d293be 100644 --- a/apps/vue/src/views/webhooks/subscriptions/datas/ModalData.ts +++ b/apps/vue/src/views/webhooks/subscriptions/datas/ModalData.ts @@ -1,6 +1,6 @@ import { useLocalization } from '/@/hooks/abp/useLocalization'; import { FormProps } from '/@/components/Form'; -import { getList } from '/@/api/saas/tenant'; +import { GetListAsyncByInput } from '/@/api/saas/tenant'; import { getAllAvailableWebhooks } from '/@/api/webhooks/subscriptions'; const { L } = useLocalization(['WebhooksManagement', 'AbpUi']); @@ -32,7 +32,7 @@ export function getSearchFormSchemas(): Partial { label: L('DisplayName:TenantId'), colProps: { span: 6 }, componentProps: { - api: getList, + api: GetListAsyncByInput, params: { skipCount: 0, maxResultCount: 1000, diff --git a/apps/vue/types/abp.type.d.ts b/apps/vue/types/abp.type.d.ts new file mode 100644 index 000000000..8843fb470 --- /dev/null +++ b/apps/vue/types/abp.type.d.ts @@ -0,0 +1,115 @@ +declare interface ExtensibleObject { + extraProperties: ExtraPropertyDictionary; +} + +declare interface EntityDto { + id: TPrimaryKey; +} + +declare interface CreationAuditedEntityDto extends EntityDto { + creationTime: Date; + creatorId?: string; +} + +declare interface CreationAuditedEntityWithUserDto + extends CreationAuditedEntityDto { + creator: TUserDto; +} + +declare interface AuditedEntityDto extends CreationAuditedEntityDto { + lastModificationTime?: Date; + lastModifierId?: string; +} + +declare interface AuditedEntityWithUserDto + extends AuditedEntityDto { + creator: TUserDto; + lastModifier: TUserDto; +} + +declare interface ExtensibleEntityDto extends ExtensibleObject { + id: TKey; +} + +declare interface ExtensibleCreationAuditedEntityDto + extends ExtensibleEntityDto { + creationTime: Date; + creatorId?: string; +} + +declare interface ExtensibleCreationAuditedEntityWithUserDto + extends ExtensibleCreationAuditedEntityDto { + creator: TUserDto; +} + +declare interface ExtensibleAuditedEntityDto + extends ExtensibleCreationAuditedEntityDto { + lastModificationTime?: Date; + lastModifierId?: string; +} + +declare interface ExtensibleAuditedEntityWithUserDto + extends ExtensibleAuditedEntityDto { + creator: TUserDto; + lastModifier: TUserDto; +} + +declare interface ExtensibleFullAuditedEntityDto + extends ExtensibleAuditedEntityDto { + isDeleted: boolean; + deleterId?: string; + deletionTime?: Date; +} + +declare interface ExtensibleFullAuditedEntityWithUserDto + extends ExtensibleFullAuditedEntityDto { + creator: TUserDto; + lastModifier: TUserDto; + deleter: TUserDto; +} + +declare interface FullAuditedEntityDto extends AuditedEntityDto { + isDeleted: boolean; + deleterId?: string; + deletionTime?: Date; +} + +declare interface FullAuditedEntityWithUserDto extends FullAuditedEntityDto { + creator: TUserDto; + lastModifier: TUserDto; + deleter: TUserDto; +} + +declare interface LimitedResultRequestDto { + maxResultCount?: number; +} + +declare interface ExtensibleLimitedResultRequestDto + extends LimitedResultRequestDto, + ExtensibleObject {} + +declare interface ListResultDto { + items: T[]; +} + +declare interface ExtensibleListResultDto extends ListResultDto, ExtensibleObject {} + +declare interface PagedResultDto extends ListResultDto { + totalCount: number; +} + +declare interface ExtensiblePagedResultDto extends PagedResultDto, ExtensibleObject {} + +declare interface PagedAndSortedResultRequestDto extends PagedResultRequestDto { + sorting?: string; +} + +declare interface ExtensiblePagedAndSortedResultRequestDto + extends PagedAndSortedResultRequestDto, + ExtensibleObject {} + +declare interface PagedResultRequestDto extends LimitedResultRequestDto { + skipCount?: number; +} + +declare interface ExtensiblePagedResultRequestDto extends PagedResultRequestDto, ExtensibleObject {} diff --git a/aspnet-core/modules/cli/LINGYUN.Abp.Cli/LINGYUN.Abp.Cli.csproj b/aspnet-core/modules/cli/LINGYUN.Abp.Cli/LINGYUN.Abp.Cli.csproj index 5a2843516..ddb1652d1 100644 --- a/aspnet-core/modules/cli/LINGYUN.Abp.Cli/LINGYUN.Abp.Cli.csproj +++ b/aspnet-core/modules/cli/LINGYUN.Abp.Cli/LINGYUN.Abp.Cli.csproj @@ -5,7 +5,7 @@ Exe net6.0 - 6.0.1 + 6.0.2 colin Use LINGYUN.MicroService.Templates command line true diff --git a/aspnet-core/modules/cli/LINGYUN.Abp.Cli/LINGYUN/Abp/Cli/ServiceProxying/TypeScript/TypeScriptProxyGenerator.cs b/aspnet-core/modules/cli/LINGYUN.Abp.Cli/LINGYUN/Abp/Cli/ServiceProxying/TypeScript/TypeScriptProxyGenerator.cs index b90522db8..318ab40ef 100644 --- a/aspnet-core/modules/cli/LINGYUN.Abp.Cli/LINGYUN/Abp/Cli/ServiceProxying/TypeScript/TypeScriptProxyGenerator.cs +++ b/aspnet-core/modules/cli/LINGYUN.Abp.Cli/LINGYUN/Abp/Cli/ServiceProxying/TypeScript/TypeScriptProxyGenerator.cs @@ -268,6 +268,8 @@ public class TypeScriptProxyGenerator : ITypeScriptProxyGenerator, ITransientDep apiScriptBuilder.AppendLine(" controller: controllerName,"); apiScriptBuilder.AppendFormat(" action: '{0}',", action.Value.Name); apiScriptBuilder.AppendLine(""); + apiScriptBuilder.AppendFormat(" uniqueName: '{0}',", action.Value.UniqueName); + apiScriptBuilder.AppendLine(""); if (DataInParamMethods.Contains(action.Value.HttpMethod)) { @@ -321,7 +323,6 @@ public class TypeScriptProxyGenerator : ITypeScriptProxyGenerator, ITransientDep apiScriptBuilder.AppendLine(" });"); apiScriptBuilder.AppendLine("};"); - apiScriptBuilder.AppendLine(""); } return apiScriptBuilder.ToString(); diff --git a/aspnet-core/services/LY.MicroService.AuthServer/LY.MicroService.AuthServer.csproj b/aspnet-core/services/LY.MicroService.AuthServer/LY.MicroService.AuthServer.csproj index 15b005c07..c448e0cef 100644 --- a/aspnet-core/services/LY.MicroService.AuthServer/LY.MicroService.AuthServer.csproj +++ b/aspnet-core/services/LY.MicroService.AuthServer/LY.MicroService.AuthServer.csproj @@ -67,4 +67,8 @@ + + + +