52 changed files with 618 additions and 819 deletions
@ -1,56 +1,20 @@ |
|||
import { defAbpHttp } from '/@/utils/http/abp'; |
|||
import { defHttp } from '/@/utils/http/axios'; |
|||
import { OpenIddictAuthorizationDto, OpenIddictAuthorizationGetListInput, } from './model'; |
|||
|
|||
// export const DeleteAsyncById = (id: string) => {
|
|||
// return defAbpHttp.request<void>({
|
|||
// service: remoteServiceName,
|
|||
// controller: controllerName,
|
|||
// action: 'DeleteAsync',
|
|||
// uniqueName: 'DeleteAsyncById',
|
|||
// params: {
|
|||
// id: id,
|
|||
// },
|
|||
// });
|
|||
// };
|
|||
|
|||
export const deleteById = (id: string) => { |
|||
return defAbpHttp.delete<void>({ |
|||
return defHttp.delete<void>({ |
|||
url: `/api/openiddict/authorizations/${id}`, |
|||
}); |
|||
}; |
|||
|
|||
// export const GetAsyncById = (id: string) => {
|
|||
// return defAbpHttp.request<OpenIddictAuthorizationDto>({
|
|||
// service: remoteServiceName,
|
|||
// controller: controllerName,
|
|||
// action: 'GetAsync',
|
|||
// uniqueName: 'GetAsyncById',
|
|||
// params: {
|
|||
// id: id,
|
|||
// },
|
|||
// });
|
|||
// };
|
|||
|
|||
export const get = (id: string) => { |
|||
return defAbpHttp.get<OpenIddictAuthorizationDto>({ |
|||
return defHttp.get<OpenIddictAuthorizationDto>({ |
|||
url: `/api/openiddict/authorizations/${id}`, |
|||
}); |
|||
}; |
|||
|
|||
// export const GetListAsyncByInput = (input: OpenIddictAuthorizationGetListInput) => {
|
|||
// return defAbpHttp.pagedRequest<OpenIddictAuthorizationDto>({
|
|||
// service: remoteServiceName,
|
|||
// controller: controllerName,
|
|||
// action: 'GetListAsync',
|
|||
// uniqueName: 'GetListAsyncByInput',
|
|||
// params: {
|
|||
// input: input,
|
|||
// },
|
|||
// });
|
|||
// };
|
|||
|
|||
export const getList = (input: OpenIddictAuthorizationGetListInput) => { |
|||
return defAbpHttp.get<PagedResultDto<OpenIddictAuthorizationDto>>({ |
|||
return defHttp.get<PagedResultDto<OpenIddictAuthorizationDto>>({ |
|||
url: '/api/openiddict/authorizations', |
|||
params: input, |
|||
}); |
|||
|
|||
@ -1,56 +1,20 @@ |
|||
import { defAbpHttp } from '/@/utils/http/abp'; |
|||
import { defHttp } from '/@/utils/http/axios'; |
|||
import { OpenIddictTokenDto, OpenIddictTokenGetListInput, } from './model'; |
|||
|
|||
// export const DeleteAsyncById = (id: string) => {
|
|||
// return defAbpHttp.request<void>({
|
|||
// service: remoteServiceName,
|
|||
// controller: controllerName,
|
|||
// action: 'DeleteAsync',
|
|||
// uniqueName: 'DeleteAsyncById',
|
|||
// params: {
|
|||
// id: id,
|
|||
// },
|
|||
// });
|
|||
// };
|
|||
|
|||
export const deleteById = (id: string) => { |
|||
return defAbpHttp.delete<void>({ |
|||
return defHttp.delete<void>({ |
|||
url: `/api/openiddict/tokens/${id}`, |
|||
}); |
|||
}; |
|||
|
|||
// export const GetAsyncById = (id: string) => {
|
|||
// return defAbpHttp.request<OpenIddictTokenDto>({
|
|||
// service: remoteServiceName,
|
|||
// controller: controllerName,
|
|||
// action: 'GetAsync',
|
|||
// uniqueName: 'GetAsyncById',
|
|||
// params: {
|
|||
// id: id,
|
|||
// },
|
|||
// });
|
|||
// };
|
|||
|
|||
export const get = (id: string) => { |
|||
return defAbpHttp.get<OpenIddictTokenDto>({ |
|||
return defHttp.get<OpenIddictTokenDto>({ |
|||
url: `/api/openiddict/tokens/${id}`, |
|||
}); |
|||
}; |
|||
|
|||
// export const GetListAsyncByInput = (input: OpenIddictTokenGetListInput) => {
|
|||
// return defAbpHttp.pagedRequest<OpenIddictTokenDto>({
|
|||
// service: remoteServiceName,
|
|||
// controller: controllerName,
|
|||
// action: 'GetListAsync',
|
|||
// uniqueName: 'GetListAsyncByInput',
|
|||
// params: {
|
|||
// input: input,
|
|||
// },
|
|||
// });
|
|||
// };
|
|||
|
|||
export const getList = (input: OpenIddictTokenGetListInput) => { |
|||
return defAbpHttp.get<PagedResultDto<OpenIddictTokenDto>>({ |
|||
return defHttp.get<PagedResultDto<OpenIddictTokenDto>>({ |
|||
url: '/api/openiddict/tokens', |
|||
params: input, |
|||
}); |
|||
|
|||
@ -1,104 +1,56 @@ |
|||
import { defAbpHttp } from '/@/utils/http/abp'; |
|||
import { defHttp } from '/@/utils/http/axios'; |
|||
import { UserFavoriteMenuDto, UserFavoriteMenuCreateDto, UserFavoriteMenuUpdateDto } from './model'; |
|||
|
|||
const remoteService = { |
|||
name: 'Platform', |
|||
controller: 'UserFavoriteMenu', |
|||
replace: { |
|||
framework: 'Vue Vben Admin', |
|||
} |
|||
}; |
|||
|
|||
export const create = (userId: string, input: UserFavoriteMenuCreateDto) => { |
|||
input.framework = remoteService.replace.framework; |
|||
return defAbpHttp.request<UserFavoriteMenuDto>({ |
|||
service: remoteService.name, |
|||
controller: remoteService.controller, |
|||
action: 'CreateAsync', |
|||
params: { |
|||
userId: userId, |
|||
}, |
|||
input.framework = 'Vue Vben Admin'; |
|||
return defHttp.post<UserFavoriteMenuDto>({ |
|||
url: `/api/platform/menus/favorites/${userId}`, |
|||
data: input, |
|||
}); |
|||
}; |
|||
|
|||
export const createMyFavoriteMenu = (input: UserFavoriteMenuCreateDto) => { |
|||
input.framework = remoteService.replace.framework; |
|||
return defAbpHttp.request<UserFavoriteMenuDto>({ |
|||
service: remoteService.name, |
|||
controller: remoteService.controller, |
|||
action: 'CreateMyFavoriteMenuAsync', |
|||
input.framework = 'Vue Vben Admin'; |
|||
return defHttp.post<UserFavoriteMenuDto>({ |
|||
url: `/api/platform/menus/favorites/my-favorite-menus`, |
|||
data: input, |
|||
}); |
|||
}; |
|||
|
|||
export const del = (userId: string, menuId: string) => { |
|||
return defAbpHttp.request<void>({ |
|||
service: remoteService.name, |
|||
controller: remoteService.controller, |
|||
action: 'DeleteAsync', |
|||
params: { |
|||
userId: userId, |
|||
input: { |
|||
MenuId: menuId, |
|||
}, |
|||
}, |
|||
return defHttp.delete<void>({ |
|||
url: `/api/platform/menus/favorites/${userId}/${menuId}`, |
|||
}); |
|||
}; |
|||
|
|||
export const delMyFavoriteMenu = (menuId: string) => { |
|||
return defAbpHttp.request<void>({ |
|||
service: remoteService.name, |
|||
controller: remoteService.controller, |
|||
action: 'DeleteMyFavoriteMenuAsync', |
|||
params: { |
|||
input: { |
|||
MenuId: menuId, |
|||
}, |
|||
}, |
|||
return defHttp.delete<void>({ |
|||
url: `/api/platform/menus/favorites/my-favorite-menus/${menuId}`, |
|||
}); |
|||
}; |
|||
|
|||
export const update = (userId: string, input: UserFavoriteMenuUpdateDto) => { |
|||
return defAbpHttp.request<UserFavoriteMenuDto>({ |
|||
service: remoteService.name, |
|||
controller: remoteService.controller, |
|||
action: 'UpdateAsync', |
|||
params: { |
|||
userId: userId, |
|||
}, |
|||
return defHttp.put<UserFavoriteMenuDto>({ |
|||
url: `/api/platform/menus/favorites/${userId}`, |
|||
data: input, |
|||
}); |
|||
}; |
|||
|
|||
export const updateMyFavoriteMenu = (input: UserFavoriteMenuUpdateDto) => { |
|||
return defAbpHttp.request<UserFavoriteMenuDto>({ |
|||
service: remoteService.name, |
|||
controller: remoteService.controller, |
|||
action: 'UpdateMyFavoriteMenuAsync', |
|||
return defHttp.put<UserFavoriteMenuDto>({ |
|||
url: `/api/platform/menus/favorites/my-favorite-menus`, |
|||
data: input, |
|||
}); |
|||
}; |
|||
|
|||
export const getList = (userId: string) => { |
|||
return defAbpHttp.listRequest<UserFavoriteMenuDto>({ |
|||
service: remoteService.name, |
|||
controller: remoteService.controller, |
|||
action: 'GetListAsync', |
|||
params: { |
|||
userId: userId, |
|||
framework: remoteService.replace.framework, |
|||
}, |
|||
return defHttp.get<ListResultDto<UserFavoriteMenuDto>>({ |
|||
url: `/api/platform/menus/favorites/${userId}?framework=Vue Vben Admin`, |
|||
}); |
|||
}; |
|||
|
|||
export const getMyFavoriteMenuList = () => { |
|||
return defAbpHttp.listRequest<UserFavoriteMenuDto>({ |
|||
service: remoteService.name, |
|||
controller: remoteService.controller, |
|||
action: 'GetMyFavoriteMenuListAsync', |
|||
params: { |
|||
framework: remoteService.replace.framework, |
|||
}, |
|||
return defHttp.get<ListResultDto<UserFavoriteMenuDto>>({ |
|||
url: `/api/platform/menus/favorites/my-favorite-menus?framework=Vue Vben Admin`, |
|||
}); |
|||
}; |
|||
|
|||
@ -1,64 +1,35 @@ |
|||
import { defAbpHttp } from '/@/utils/http/abp'; |
|||
import { defHttp } from '/@/utils/http/axios'; |
|||
import { EditionCreateDto, EditionDto,EditionGetListInput, EditionUpdateDto, } from './model'; |
|||
|
|||
const remoteServiceName = 'AbpSaas'; |
|||
const controllerName = 'Edition'; |
|||
|
|||
export const CreateAsyncByInput = (input: EditionCreateDto) => { |
|||
return defAbpHttp.request<EditionDto>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'CreateAsync', |
|||
uniqueName: 'CreateAsyncByInput', |
|||
return defHttp.post<EditionDto>({ |
|||
url: `/api/saas/editions`, |
|||
data: input, |
|||
}); |
|||
}; |
|||
|
|||
export const DeleteAsyncById = (id: string) => { |
|||
return defAbpHttp.request<void>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'DeleteAsync', |
|||
uniqueName: 'DeleteAsyncById', |
|||
params: { |
|||
id: id, |
|||
}, |
|||
return defHttp.delete<void>({ |
|||
url: `/api/saas/editions/${id}`, |
|||
}); |
|||
}; |
|||
|
|||
export const GetAsyncById = (id: string) => { |
|||
return defAbpHttp.request<EditionDto>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'GetAsync', |
|||
uniqueName: 'GetAsyncById', |
|||
params: { |
|||
id: id, |
|||
}, |
|||
return defHttp.get<EditionDto>({ |
|||
url: `/api/saas/editions/${id}`, |
|||
}); |
|||
}; |
|||
|
|||
export const GetListAsyncByInput = (input: EditionGetListInput) => { |
|||
return defAbpHttp.pagedRequest<EditionDto>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'GetListAsync', |
|||
uniqueName: 'GetListAsyncByInput', |
|||
params: { |
|||
input: input, |
|||
}, |
|||
return defHttp.get<PagedResultDto<EditionDto>>({ |
|||
url: `/api/saas/editions`, |
|||
params: input, |
|||
}); |
|||
}; |
|||
|
|||
export const UpdateAsyncByIdAndInput = (id: string, input: EditionUpdateDto) => { |
|||
return defAbpHttp.request<EditionDto>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'UpdateAsync', |
|||
uniqueName: 'UpdateAsyncByIdAndInput', |
|||
params: { |
|||
id: id, |
|||
}, |
|||
return defHttp.put<EditionDto>({ |
|||
url: `/api/saas/editions/${id}`, |
|||
data: input, |
|||
}); |
|||
}; |
|||
|
|||
@ -1,127 +1,66 @@ |
|||
import { defAbpHttp } from '/@/utils/http/abp'; |
|||
import { defHttp } from '/@/utils/http/axios'; |
|||
import { TenantDto,TenantGetListInput, TenantCreateDto, TenantUpdateDto, TenantConnectionStringDto,TenantConnectionStringCreateOrUpdate, } from './model'; |
|||
|
|||
const remoteServiceName = 'AbpSaas'; |
|||
const controllerName = 'Tenant'; |
|||
|
|||
export const GetAsyncById = (id: string) => { |
|||
return defAbpHttp.request<TenantDto>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'GetAsync', |
|||
uniqueName: 'GetAsyncById', |
|||
params: { |
|||
id: id, |
|||
}, |
|||
return defHttp.get<TenantDto>({ |
|||
url: `/api/saas/tenants/${id}`, |
|||
}); |
|||
}; |
|||
|
|||
export const GetAsyncByName = (name: string) => { |
|||
return defAbpHttp.request<TenantDto>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'GetAsync', |
|||
uniqueName: 'GetAsyncByName', |
|||
params: { |
|||
name: name, |
|||
}, |
|||
return defHttp.get<TenantDto>({ |
|||
url: `/api/saas/tenants/by-name/${name}`, |
|||
}); |
|||
}; |
|||
|
|||
export const GetListAsyncByInput = (input: TenantGetListInput) => { |
|||
return defAbpHttp.pagedRequest<TenantDto>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'GetListAsync', |
|||
uniqueName: 'GetListAsyncByInput', |
|||
params: { |
|||
input: input, |
|||
}, |
|||
return defHttp.get<PagedResultDto<TenantDto>>({ |
|||
url: `/api/saas/tenants`, |
|||
params: input, |
|||
}); |
|||
}; |
|||
|
|||
export const CreateAsyncByInput = (input: TenantCreateDto) => { |
|||
return defAbpHttp.request<TenantDto>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'CreateAsync', |
|||
uniqueName: 'CreateAsyncByInput', |
|||
return defHttp.post<TenantDto>({ |
|||
url: `/api/saas/tenants`, |
|||
data: input, |
|||
}); |
|||
}; |
|||
|
|||
export const UpdateAsyncByIdAndInput = (id: string, input: TenantUpdateDto) => { |
|||
return defAbpHttp.request<TenantDto>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'UpdateAsync', |
|||
uniqueName: 'UpdateAsyncByIdAndInput', |
|||
params: { |
|||
id: id, |
|||
}, |
|||
return defHttp.put<TenantDto>({ |
|||
url: `/api/saas/tenants/${id}`, |
|||
data: input, |
|||
}); |
|||
}; |
|||
|
|||
export const DeleteAsyncById = (id: string) => { |
|||
return defAbpHttp.request<void>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'DeleteAsync', |
|||
uniqueName: 'DeleteAsyncById', |
|||
params: { |
|||
id: id, |
|||
}, |
|||
return defHttp.delete<void>({ |
|||
url: `/api/saas/tenants/${id}`, |
|||
}); |
|||
}; |
|||
|
|||
export const GetConnectionStringAsyncByIdAndName = (id: string, name: string) => { |
|||
return defAbpHttp.request<TenantConnectionStringDto>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'GetConnectionStringAsync', |
|||
uniqueName: 'GetConnectionStringAsyncByIdAndName', |
|||
params: { |
|||
id: id, |
|||
name: name, |
|||
}, |
|||
return defHttp.get<TenantConnectionStringDto>({ |
|||
url: `/api/saas/tenants/${id}/connection-string/${name}`, |
|||
}); |
|||
}; |
|||
|
|||
export const GetConnectionStringAsyncById = (id: string) => { |
|||
return defAbpHttp.listRequest<TenantConnectionStringDto>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'GetConnectionStringAsync', |
|||
uniqueName: 'GetConnectionStringAsyncById', |
|||
params: { |
|||
id: id, |
|||
}, |
|||
return defHttp.get<ListResultDto<TenantConnectionStringDto>>({ |
|||
url: `/api/saas/tenants/${id}/connection-string`, |
|||
}); |
|||
}; |
|||
|
|||
export const SetConnectionStringAsyncByIdAndInput = (id: string, input: TenantConnectionStringCreateOrUpdate) => { |
|||
return defAbpHttp.request<TenantConnectionStringDto>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'SetConnectionStringAsync', |
|||
uniqueName: 'SetConnectionStringAsyncByIdAndInput', |
|||
params: { |
|||
id: id, |
|||
}, |
|||
return defHttp.put<TenantConnectionStringDto>({ |
|||
url: `/api/saas/tenants/${id}/connection-string`, |
|||
data: input, |
|||
}); |
|||
}; |
|||
|
|||
export const DeleteConnectionStringAsyncByIdAndName = (id: string, name: string) => { |
|||
return defAbpHttp.request<void>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'DeleteConnectionStringAsync', |
|||
uniqueName: 'DeleteConnectionStringAsyncByIdAndName', |
|||
params: { |
|||
id: id, |
|||
name: name, |
|||
}, |
|||
return defHttp.delete<void>({ |
|||
url: `/api/saas/tenants/${id}/connection-string/${name}`, |
|||
}); |
|||
}; |
|||
|
|||
@ -0,0 +1,62 @@ |
|||
|
|||
import { useLocalization } from '/@/hooks/abp/useLocalization'; |
|||
import { NotificationInfo } from '/@/api/messages/notifications/model'; |
|||
import { NotificationContentType, NotificationLifetime, NotificationSeverity, NotificationType } from '/@/api/realtime/notifications/types'; |
|||
|
|||
interface Notification { |
|||
name: string; |
|||
title: string; |
|||
message: string; |
|||
description?: string; |
|||
creationTime: Date; |
|||
lifetime: NotificationLifetime; |
|||
type: NotificationType; |
|||
severity: NotificationSeverity; |
|||
contentType: NotificationContentType; |
|||
data: Recordable<string>; |
|||
} |
|||
|
|||
export function useNotificationSerializer() { |
|||
function deserialize(notificationInfo: NotificationInfo): Notification { |
|||
const { data } = notificationInfo; |
|||
let title = data.extraProperties.title; |
|||
let message = data.extraProperties.message; |
|||
let description = data.extraProperties.description; |
|||
if (data.extraProperties.L === true || data.extraProperties.L === 'true') { |
|||
const { L } = useLocalization( |
|||
[data.extraProperties.title.resourceName ?? data.extraProperties.title.ResourceName, |
|||
data.extraProperties.message.resourceName ?? data.extraProperties.message.ResourceName, |
|||
data.extraProperties.description?.resourceName ?? data.extraProperties.description?.ResourceName ?? "AbpUi"]); |
|||
title = L( |
|||
data.extraProperties.title.name ?? data.extraProperties.title.Name, |
|||
data.extraProperties.title.values ?? data.extraProperties.title.Values, |
|||
); |
|||
message = L( |
|||
data.extraProperties.message.name ?? data.extraProperties.message.Name, |
|||
data.extraProperties.message.values ?? data.extraProperties.message.Values, |
|||
); |
|||
if (description) { |
|||
description = L( |
|||
data.extraProperties.description.name ?? data.extraProperties.description.Name, |
|||
data.extraProperties.description.values ?? data.extraProperties.description.Values, |
|||
); |
|||
} |
|||
} |
|||
return { |
|||
title, |
|||
message, |
|||
description, |
|||
creationTime: notificationInfo.creationTime, |
|||
contentType: notificationInfo.contentType, |
|||
lifetime: notificationInfo.lifetime, |
|||
severity: notificationInfo.severity, |
|||
type: notificationInfo.type, |
|||
data: data.extraProperties, |
|||
name: notificationInfo.name, |
|||
}; |
|||
}; |
|||
|
|||
return { |
|||
deserialize, |
|||
}; |
|||
} |
|||
Loading…
Reference in new issue