committed by
GitHub
566 changed files with 8967 additions and 6801 deletions
@ -1,78 +0,0 @@ |
|||||
import { defAbpHttp } from '/@/utils/http/abp'; |
|
||||
import { Register, PhoneRegister, PhoneResetPassword } from './model/accountsModel'; |
|
||||
import { User } from '/@/api/identity/model/userModel'; |
|
||||
import { format } from '/@/utils/strings'; |
|
||||
|
|
||||
enum Api { |
|
||||
Register = '/api/account/register', |
|
||||
RegisterByPhone = '/api/account/phone/register', |
|
||||
ResetPassword = '/api/account/phone/reset-password', |
|
||||
SendEmailSignCode = '/api/account/email/send-signin-code', |
|
||||
SendPhoneSignCode = '/api/account/phone/send-signin-code', |
|
||||
SendPhoneRegisterCode = '/api/account/phone/send-register-code', |
|
||||
SendPhoneResetPasswordCode = '/api/account/phone/send-password-reset-code', |
|
||||
GetTwoFactorProviders = '/api/account/two-factor-providers?userId={userId}', |
|
||||
} |
|
||||
|
|
||||
export const register = (input: Register) => { |
|
||||
return defAbpHttp.post<User>({ |
|
||||
url: Api.Register, |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const registerByPhone = (input: PhoneRegister) => { |
|
||||
return defAbpHttp.post<void>({ |
|
||||
url: Api.RegisterByPhone, |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const resetPassword = (input: PhoneResetPassword) => { |
|
||||
return defAbpHttp.put<void>({ |
|
||||
url: Api.ResetPassword, |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const sendPhoneSignCode = (phoneNumber: string) => { |
|
||||
return defAbpHttp.post<void>({ |
|
||||
url: Api.SendPhoneSignCode, |
|
||||
data: { |
|
||||
phoneNumber: phoneNumber, |
|
||||
}, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const sendEmailSignCode = (emailAddress: string) => { |
|
||||
return defAbpHttp.post<void>({ |
|
||||
url: Api.SendEmailSignCode, |
|
||||
data: { |
|
||||
emailAddress: emailAddress, |
|
||||
}, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const sendPhoneRegisterCode = (phoneNumber: string) => { |
|
||||
return defAbpHttp.post<void>({ |
|
||||
url: Api.SendPhoneRegisterCode, |
|
||||
data: { |
|
||||
phoneNumber: phoneNumber, |
|
||||
}, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const sendPhoneResetPasswordCode = (phoneNumber: string) => { |
|
||||
return defAbpHttp.post<void>({ |
|
||||
url: Api.SendPhoneResetPasswordCode, |
|
||||
data: { |
|
||||
phoneNumber: phoneNumber, |
|
||||
}, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getTwoFactorProviders = (userId: string) => { |
|
||||
return defAbpHttp.get<ListResultDto<NameValue<String>>>({ |
|
||||
url: format(Api.GetTwoFactorProviders, { userId: userId }), |
|
||||
}); |
|
||||
} |
|
||||
@ -0,0 +1,67 @@ |
|||||
|
import { defHttp } from '/@/utils/http/axios'; |
||||
|
import { |
||||
|
Register, |
||||
|
PhoneRegister, |
||||
|
PhoneResetPassword, |
||||
|
SendPhoneSigninCodeInput, |
||||
|
SendEmailSigninCodeInput, |
||||
|
SendPhoneRegisterCodeInput, |
||||
|
SendPhoneResetPasswordCodeInput, |
||||
|
GetTwoFactorProvidersInput, |
||||
|
} from './model'; |
||||
|
import { User } from '/@/api/identity/model/userModel'; |
||||
|
|
||||
|
export const passwordRegister = (input: Register) => { |
||||
|
return defHttp.post<User>({ |
||||
|
url: '/api/account/register', |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const phoneRegister = (input: PhoneRegister) => { |
||||
|
return defHttp.post<void>({ |
||||
|
url: '/api/account/phone/register', |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const resetPassword = (input: PhoneResetPassword) => { |
||||
|
return defHttp.put<void>({ |
||||
|
url: '/api/account/phone/reset-password', |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const sendPhoneSigninCode = (input: SendPhoneSigninCodeInput) => { |
||||
|
return defHttp.post<void>({ |
||||
|
url: '/api/account/phone/send-signin-code', |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const sendEmailSigninCode = (input: SendEmailSigninCodeInput) => { |
||||
|
return defHttp.post<void>({ |
||||
|
url: '/api/account/email/send-signin-code', |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const sendPhoneRegisterCode = (input: SendPhoneRegisterCodeInput) => { |
||||
|
return defHttp.post<void>({ |
||||
|
url: '/api/account/phone/send-register-code', |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const sendPhoneResetPasswordCode = (input: SendPhoneResetPasswordCodeInput) => { |
||||
|
return defHttp.post<void>({ |
||||
|
url: '/api/account/phone/send-password-reset-code', |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getTwoFactorProviders = (input: GetTwoFactorProvidersInput) => { |
||||
|
return defHttp.get<ListResultDto<NameValue<string>>>({ |
||||
|
url: `/api/account/two-factor-providers?userId=${input.userId}`, |
||||
|
}); |
||||
|
} |
||||
@ -0,0 +1,46 @@ |
|||||
|
export interface Register { |
||||
|
userName: string; |
||||
|
emailAddress: string; |
||||
|
password: string; |
||||
|
appName: string; |
||||
|
} |
||||
|
|
||||
|
export interface PhoneRegister { |
||||
|
phoneNumber: string; |
||||
|
password: string; |
||||
|
code: string; |
||||
|
name?: string; |
||||
|
userName?: string; |
||||
|
emailAddress?: string; |
||||
|
} |
||||
|
|
||||
|
export interface PhoneResetPassword { |
||||
|
phoneNumber: string; |
||||
|
newPassword: string; |
||||
|
code: string; |
||||
|
} |
||||
|
|
||||
|
export interface SendPhoneSecurityCode { |
||||
|
phoneNumber: string; |
||||
|
} |
||||
|
|
||||
|
export interface SendPhoneRegisterCodeInput { |
||||
|
phoneNumber: string; |
||||
|
} |
||||
|
|
||||
|
export interface SendPhoneSigninCodeInput { |
||||
|
phoneNumber: string; |
||||
|
} |
||||
|
|
||||
|
export interface SendPhoneResetPasswordCodeInput { |
||||
|
phoneNumber: string; |
||||
|
} |
||||
|
|
||||
|
export interface SendEmailSigninCodeInput { |
||||
|
emailAddress: string; |
||||
|
} |
||||
|
|
||||
|
export interface GetTwoFactorProvidersInput { |
||||
|
userId: string; |
||||
|
} |
||||
|
|
||||
@ -1,13 +0,0 @@ |
|||||
import { defAbpHttp } from '/@/utils/http/abp'; |
|
||||
import { ChangeAvatar } from './model/claimsModel'; |
|
||||
|
|
||||
enum Api { |
|
||||
ChangeAvatar = '/api/account/my-claim/change-avatar', |
|
||||
} |
|
||||
|
|
||||
export const changeAvatar = (input: ChangeAvatar) => { |
|
||||
return defAbpHttp.post<void>({ |
|
||||
url: Api.ChangeAvatar, |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
@ -0,0 +1,9 @@ |
|||||
|
import { defHttp } from '/@/utils/http/axios'; |
||||
|
import { ChangeAvatarInput } from './model'; |
||||
|
|
||||
|
export const changeAvatar = (input: ChangeAvatarInput) => { |
||||
|
return defHttp.post<void>({ |
||||
|
url: '/api/account/my-claim/change-avatar', |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
@ -0,0 +1,4 @@ |
|||||
|
export interface ChangeAvatarInput { |
||||
|
avatarUrl: string; |
||||
|
} |
||||
|
|
||||
@ -1,25 +0,0 @@ |
|||||
export interface Register { |
|
||||
userName: string; |
|
||||
emailAddress: string; |
|
||||
password: string; |
|
||||
appName: string; |
|
||||
} |
|
||||
|
|
||||
export interface PhoneRegister { |
|
||||
phoneNumber: string; |
|
||||
password: string; |
|
||||
code: string; |
|
||||
name?: string; |
|
||||
userName?: string; |
|
||||
emailAddress?: string; |
|
||||
} |
|
||||
|
|
||||
export interface PhoneResetPassword { |
|
||||
phoneNumber: string; |
|
||||
newPassword: string; |
|
||||
code: string; |
|
||||
} |
|
||||
|
|
||||
export interface SendPhoneSecurityCode { |
|
||||
phoneNumber: string; |
|
||||
} |
|
||||
@ -1,3 +0,0 @@ |
|||||
export interface ChangeAvatar { |
|
||||
avatarUrl: string; |
|
||||
} |
|
||||
@ -1,40 +0,0 @@ |
|||||
interface Profile extends ExtensibleObject, IHasConcurrencyStamp { |
|
||||
userName: string; |
|
||||
email: string; |
|
||||
name?: string; |
|
||||
surname?: string; |
|
||||
phoneNumber?: string; |
|
||||
} |
|
||||
|
|
||||
export interface MyProfile extends Profile { |
|
||||
isExternal: boolean; |
|
||||
hasPassword: boolean; |
|
||||
} |
|
||||
|
|
||||
export type UpdateMyProfile = Profile; |
|
||||
|
|
||||
export interface ChangePassword { |
|
||||
currentPassword: string; |
|
||||
newPassword: string; |
|
||||
} |
|
||||
|
|
||||
export interface ChangePhoneNumber { |
|
||||
newPhoneNumber: string; |
|
||||
code: string; |
|
||||
} |
|
||||
|
|
||||
export interface TwoFactorEnabled { |
|
||||
enabled: boolean; |
|
||||
} |
|
||||
|
|
||||
export interface SendEmailConfirmCode { |
|
||||
email: string; |
|
||||
appName: string; |
|
||||
returnUrl?: string; |
|
||||
returnUrlHash?: string; |
|
||||
} |
|
||||
|
|
||||
export interface ConfirmEmailInput { |
|
||||
userId?: string; |
|
||||
confirmToken: string; |
|
||||
} |
|
||||
@ -1,87 +0,0 @@ |
|||||
import { defAbpHttp } from '/@/utils/http/abp'; |
|
||||
import { |
|
||||
MyProfile, |
|
||||
UpdateMyProfile, |
|
||||
ChangePassword, |
|
||||
ChangePhoneNumber, |
|
||||
TwoFactorEnabled, |
|
||||
SendEmailConfirmCode, |
|
||||
ConfirmEmailInput, |
|
||||
} from './model/profilesModel'; |
|
||||
|
|
||||
enum Api { |
|
||||
Get = '/api/account/my-profile', |
|
||||
Update = '/api/account/my-profile', |
|
||||
ChangePassword = '/api/account/my-profile/change-password', |
|
||||
SendChangePhoneNumberCode = '/api/account/my-profile/send-phone-number-change-code', |
|
||||
ChangePhoneNumber = '/api/account/my-profile/change-phone-number', |
|
||||
GetTwoFactorEnabled = '/api/account/my-profile/two-factor', |
|
||||
ChangeTwoFactorEnabled = '/api/account/my-profile/change-two-factor', |
|
||||
SendEmailConfirmLink = '/api/account/my-profile/send-email-confirm-link', |
|
||||
ConfirmEmail = '/api/account/my-profile/confirm-email', |
|
||||
} |
|
||||
|
|
||||
export const get = () => { |
|
||||
return defAbpHttp.get<MyProfile>({ |
|
||||
url: Api.Get, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const update = (input: UpdateMyProfile) => { |
|
||||
return defAbpHttp.put<MyProfile>({ |
|
||||
url: Api.Update, |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const changePassword = (input: ChangePassword) => { |
|
||||
return defAbpHttp.post<void>({ |
|
||||
url: Api.ChangePassword, |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const sendEmailConfirmLink = (input: SendEmailConfirmCode) => { |
|
||||
return defAbpHttp.post<void>({ |
|
||||
url: Api.SendEmailConfirmLink, |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const confirmEmail = (input: ConfirmEmailInput) => { |
|
||||
return defAbpHttp.put<void>({ |
|
||||
url: Api.ConfirmEmail, |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const sendChangePhoneNumberCode = (phoneNumber: string) => { |
|
||||
return defAbpHttp.post<void>({ |
|
||||
url: Api.SendChangePhoneNumberCode, |
|
||||
data: { |
|
||||
newPhoneNumber: phoneNumber, |
|
||||
}, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const changePhoneNumber = (input: ChangePhoneNumber) => { |
|
||||
return defAbpHttp.put<void>({ |
|
||||
url: Api.ChangePhoneNumber, |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getTwoFactorEnabled = () => { |
|
||||
return defAbpHttp.get<TwoFactorEnabled>({ |
|
||||
url: Api.GetTwoFactorEnabled, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const changeTwoFactorEnabled = (enabled: boolean) => { |
|
||||
return defAbpHttp.put<void>({ |
|
||||
url: Api.ChangeTwoFactorEnabled, |
|
||||
data: { |
|
||||
enabled: enabled, |
|
||||
}, |
|
||||
}); |
|
||||
}; |
|
||||
@ -0,0 +1,95 @@ |
|||||
|
import { defHttp } from '/@/utils/http/axios'; |
||||
|
import { |
||||
|
MyProfile, |
||||
|
UpdateMyProfile, |
||||
|
ChangePassword, |
||||
|
ChangePhoneNumber, |
||||
|
TwoFactorEnabled, |
||||
|
SendEmailConfirmCode, |
||||
|
ConfirmEmailInput, |
||||
|
TwoFactorEnabledInput, |
||||
|
SendChangePhoneNumberCodeInput, |
||||
|
AuthenticatorDto, |
||||
|
VerifyAuthenticatorCodeInput, |
||||
|
AuthenticatorRecoveryCodeDto, |
||||
|
} from './model'; |
||||
|
|
||||
|
export const get = () => { |
||||
|
return defHttp.get<MyProfile>({ |
||||
|
url: '/api/account/my-profile', |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const update = (input: UpdateMyProfile) => { |
||||
|
return defHttp.put<MyProfile>({ |
||||
|
url:'/api/account/my-profile', |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const changePassword = (input: ChangePassword) => { |
||||
|
return defHttp.post<void>({ |
||||
|
url: '/api/account/my-profile/change-password', |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const sendEmailConfirmLink = (input: SendEmailConfirmCode) => { |
||||
|
return defHttp.post<void>({ |
||||
|
url: '/api/account/my-profile/send-email-confirm-link', |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const confirmEmail = (input: ConfirmEmailInput) => { |
||||
|
return defHttp.put<void>({ |
||||
|
url: '/api/account/my-profile/confirm-email', |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const sendChangePhoneNumberCode = (input: SendChangePhoneNumberCodeInput) => { |
||||
|
return defHttp.post<void>({ |
||||
|
url: '/api/account/my-profile/send-phone-number-change-code', |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const changePhoneNumber = (input: ChangePhoneNumber) => { |
||||
|
return defHttp.put<void>({ |
||||
|
url: '/api/account/my-profile/change-phone-number', |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getTwoFactorEnabled = () => { |
||||
|
return defHttp.get<TwoFactorEnabled>({ |
||||
|
url: '/api/account/my-profile/two-factor', |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const changeTwoFactorEnabled = (input: TwoFactorEnabledInput) => { |
||||
|
return defHttp.put<void>({ |
||||
|
url: '/api/account/my-profile/change-two-factor', |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getAuthenticator = () => { |
||||
|
return defHttp.get<AuthenticatorDto>({ |
||||
|
url: '/api/account/my-profile/authenticator', |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
export const verifyAuthenticatorCode = (input: VerifyAuthenticatorCodeInput) => { |
||||
|
return defHttp.post<AuthenticatorRecoveryCodeDto>({ |
||||
|
url: '/api/account/my-profile/verify-authenticator-code', |
||||
|
data: input, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
export const resetAuthenticator = () => { |
||||
|
return defHttp.post<void>({ |
||||
|
url: '/api/account/my-profile/reset-authenticator', |
||||
|
}); |
||||
|
} |
||||
@ -0,0 +1,63 @@ |
|||||
|
interface Profile extends ExtensibleObject, IHasConcurrencyStamp { |
||||
|
userName: string; |
||||
|
email: string; |
||||
|
name?: string; |
||||
|
surname?: string; |
||||
|
phoneNumber?: string; |
||||
|
} |
||||
|
|
||||
|
export interface MyProfile extends Profile { |
||||
|
isExternal: boolean; |
||||
|
hasPassword: boolean; |
||||
|
} |
||||
|
|
||||
|
export type UpdateMyProfile = Profile; |
||||
|
|
||||
|
export interface ChangePassword { |
||||
|
currentPassword: string; |
||||
|
newPassword: string; |
||||
|
} |
||||
|
|
||||
|
export interface ChangePhoneNumber { |
||||
|
newPhoneNumber: string; |
||||
|
code: string; |
||||
|
} |
||||
|
|
||||
|
export interface TwoFactorEnabled { |
||||
|
enabled: boolean; |
||||
|
} |
||||
|
|
||||
|
export interface SendEmailConfirmCode { |
||||
|
email: string; |
||||
|
appName: string; |
||||
|
returnUrl?: string; |
||||
|
returnUrlHash?: string; |
||||
|
} |
||||
|
|
||||
|
export interface ConfirmEmailInput { |
||||
|
userId?: string; |
||||
|
confirmToken: string; |
||||
|
} |
||||
|
|
||||
|
export interface SendChangePhoneNumberCodeInput { |
||||
|
newPhoneNumber: string; |
||||
|
} |
||||
|
|
||||
|
export interface TwoFactorEnabledInput { |
||||
|
enabled: boolean; |
||||
|
} |
||||
|
|
||||
|
export interface AuthenticatorDto { |
||||
|
isAuthenticated?: boolean; |
||||
|
sharedKey?: string; |
||||
|
authenticatorUri?: string; |
||||
|
} |
||||
|
|
||||
|
export interface AuthenticatorRecoveryCodeDto { |
||||
|
recoveryCodes: string[]; |
||||
|
} |
||||
|
|
||||
|
export interface VerifyAuthenticatorCodeInput { |
||||
|
authenticatorCode: string; |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,24 @@ |
|||||
|
import { defHttp } from '/@/utils/http/axios'; |
||||
|
import { |
||||
|
AuditLogDto, |
||||
|
AuditLogGetByPagedDto, |
||||
|
} from './model'; |
||||
|
|
||||
|
export const deleteById = (id: string) => { |
||||
|
return defHttp.delete<void>({ |
||||
|
url: `/api/auditing/audit-log/${id}` |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const get = (id: string) => { |
||||
|
return defHttp.get<AuditLogDto>({ |
||||
|
url: `/api/auditing/audit-log/${id}` |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getList = (input: AuditLogGetByPagedDto) => { |
||||
|
return defHttp.get<PagedResultDto<AuditLogDto>>({ |
||||
|
url: `/api/auditing/audit-log`, |
||||
|
params: input, |
||||
|
}); |
||||
|
}; |
||||
@ -0,0 +1,55 @@ |
|||||
|
import { EntityChangeDto } from "/@/api/auditing/entity-changes/model"; |
||||
|
|
||||
|
export interface Action { |
||||
|
id: string; |
||||
|
serviceName?: string; |
||||
|
methodName?: string; |
||||
|
parameters?: string; |
||||
|
executionTime: Date; |
||||
|
executionDuration?: number; |
||||
|
extraProperties?: ExtraPropertyDictionary; |
||||
|
} |
||||
|
|
||||
|
export interface AuditLogDto { |
||||
|
id: string; |
||||
|
applicationName?: string; |
||||
|
userId?: string; |
||||
|
userName?: string; |
||||
|
tenantId?: string; |
||||
|
tenantName?: string; |
||||
|
impersonatorUserId?: string; |
||||
|
impersonatorTenantId?: string; |
||||
|
executionTime?: Date; |
||||
|
executionDuration?: number; |
||||
|
clientIpAddress?: string; |
||||
|
clientName?: string; |
||||
|
clientId?: string; |
||||
|
correlationId?: string; |
||||
|
browserInfo?: string; |
||||
|
httpMethod?: string; |
||||
|
url?: string; |
||||
|
exceptions?: string; |
||||
|
comments?: string; |
||||
|
httpStatusCode?: number; |
||||
|
entityChanges?: EntityChangeDto[]; |
||||
|
actions?: Action[]; |
||||
|
extraProperties?: ExtraPropertyDictionary; |
||||
|
} |
||||
|
|
||||
|
export interface AuditLogGetByPagedDto extends PagedAndSortedResultRequestDto { |
||||
|
startTime?: Date; |
||||
|
endTime?: Date; |
||||
|
httpMethod?: string; |
||||
|
url?: string; |
||||
|
userId?: string; |
||||
|
userName?: string; |
||||
|
applicationName?: string; |
||||
|
correlationId?: string; |
||||
|
clientId?: string; |
||||
|
clientIpAddress?: string; |
||||
|
maxExecutionDuration?: number; |
||||
|
minExecutionDuration?: number; |
||||
|
hasException?: boolean; |
||||
|
httpStatusCode?: number; |
||||
|
} |
||||
|
|
||||
@ -1,65 +0,0 @@ |
|||||
import { defAbpHttp } from '/@/utils/http/abp'; |
|
||||
import { |
|
||||
AuditLog, |
|
||||
EntityChange, |
|
||||
EntityChangeWithUsername, |
|
||||
GetAuditLogPagedRequest, |
|
||||
EntityChangeGetByPagedRequest, |
|
||||
EntityChangeGetWithUsernameInput |
|
||||
} from './model/auditLogModel'; |
|
||||
|
|
||||
enum Api { |
|
||||
RemoteService = 'AbpAuditing', |
|
||||
Controller = 'AuditLog', |
|
||||
} |
|
||||
|
|
||||
export const deleteById = (id: string) => { |
|
||||
return defAbpHttp.pagedRequest<void>({ |
|
||||
service: Api.RemoteService, |
|
||||
controller: Api.Controller, |
|
||||
action: 'DeleteAsync', |
|
||||
params: { |
|
||||
id: id, |
|
||||
}, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getById = (id: string) => { |
|
||||
return defAbpHttp.request<AuditLog>({ |
|
||||
service: Api.RemoteService, |
|
||||
controller: Api.Controller, |
|
||||
action: 'GetAsync', |
|
||||
params: { |
|
||||
id: id, |
|
||||
}, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getList = (input: GetAuditLogPagedRequest) => { |
|
||||
return defAbpHttp.pagedRequest<AuditLog>({ |
|
||||
service: Api.RemoteService, |
|
||||
controller: Api.Controller, |
|
||||
action: 'GetListAsync', |
|
||||
params: { |
|
||||
input: input, |
|
||||
}, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getEntityChanges = (input: EntityChangeGetByPagedRequest) => { |
|
||||
return defAbpHttp.pagedRequest<EntityChange>({ |
|
||||
service: Api.RemoteService, |
|
||||
controller: 'EntityChanges', |
|
||||
action: 'GetListAsync', |
|
||||
params: { |
|
||||
input: input, |
|
||||
}, |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
export const getEntityChangesWithUsername = (input: EntityChangeGetWithUsernameInput) => { |
|
||||
return defAbpHttp.get<ListResultDto<EntityChangeWithUsername>>({ |
|
||||
url: '/api/auditing/entity-changes/with-username', |
|
||||
params: input, |
|
||||
}); |
|
||||
} |
|
||||
@ -0,0 +1,33 @@ |
|||||
|
import { defHttp } from '/@/utils/http/axios'; |
||||
|
import { |
||||
|
EntityChangeDto, |
||||
|
EntityChangeGetByPagedDto, |
||||
|
EntityChangeWithUsernameDto, |
||||
|
EntityChangeGetWithUsernameInput |
||||
|
} from './model'; |
||||
|
|
||||
|
export const GetAsyncById = (id: string) => { |
||||
|
return defHttp.get<EntityChangeDto>({ |
||||
|
url: `/api/auditing/entity-changes/${id}` |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const GetListAsyncByInput = (input: EntityChangeGetByPagedDto) => { |
||||
|
return defHttp.get<PagedResultDto<EntityChangeDto>>({ |
||||
|
url: `/api/auditing/entity-changes`, |
||||
|
params: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const GetWithUsernameAsyncById = (id: string) => { |
||||
|
return defHttp.get<EntityChangeWithUsernameDto>({ |
||||
|
url: `/api/auditing/entity-changes/with-username/${id}` |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const GetWithUsernameAsyncByInput = (input: EntityChangeGetWithUsernameInput) => { |
||||
|
return defHttp.get<ListResultDto<EntityChangeWithUsernameDto>>({ |
||||
|
url: `/api/auditing/entity-changes/with-username`, |
||||
|
params: input, |
||||
|
}); |
||||
|
}; |
||||
@ -0,0 +1,49 @@ |
|||||
|
export enum ChangeType { |
||||
|
Created = 0, |
||||
|
Updated = 1, |
||||
|
Deleted = 2, |
||||
|
} |
||||
|
|
||||
|
export interface PropertyChange { |
||||
|
id: string; |
||||
|
newValue?: string; |
||||
|
originalValue?: string; |
||||
|
propertyName?: string; |
||||
|
propertyTypeFullName?: string; |
||||
|
} |
||||
|
|
||||
|
export interface EntityChangeDto { |
||||
|
id: string; |
||||
|
changeTime?: Date; |
||||
|
changeType: ChangeType; |
||||
|
entityTenantId?: string; |
||||
|
entityId?: string; |
||||
|
entityTypeFullName?: string; |
||||
|
propertyChanges?: PropertyChange[]; |
||||
|
extraProperties?: ExtraPropertyDictionary; |
||||
|
} |
||||
|
|
||||
|
export interface EntityChangeWithUsernameDto { |
||||
|
entityChange: EntityChangeDto; |
||||
|
userName?: string; |
||||
|
} |
||||
|
|
||||
|
export interface EntityChangeGetByPagedDto extends PagedAndSortedResultRequestDto { |
||||
|
auditLogId?: string; |
||||
|
startTime?: Date; |
||||
|
endTime?: Date; |
||||
|
changeType?: ChangeType; |
||||
|
entityId?: string; |
||||
|
entityTypeFullName?: string; |
||||
|
} |
||||
|
|
||||
|
export interface EntityChangeGetWithUsernameInput { |
||||
|
entityId?: string; |
||||
|
entityTypeFullName?: string; |
||||
|
} |
||||
|
|
||||
|
export interface RestoreEntityInput { |
||||
|
entityId: string; |
||||
|
entityChangeId?: string; |
||||
|
} |
||||
|
|
||||
@ -1,100 +0,0 @@ |
|||||
export enum ChangeType { |
|
||||
Created = 0, |
|
||||
Updated = 1, |
|
||||
Deleted = 2, |
|
||||
} |
|
||||
|
|
||||
export interface PropertyChange { |
|
||||
id: string; |
|
||||
newValue?: string; |
|
||||
originalValue?: string; |
|
||||
propertyName?: string; |
|
||||
propertyTypeFullName?: string; |
|
||||
} |
|
||||
|
|
||||
export interface EntityChange { |
|
||||
id: string; |
|
||||
changeTime?: Date; |
|
||||
changeType: ChangeType; |
|
||||
entityTenantId?: string; |
|
||||
entityId?: string; |
|
||||
entityTypeFullName?: string; |
|
||||
propertyChanges?: PropertyChange[]; |
|
||||
extraProperties?: ExtraPropertyDictionary; |
|
||||
} |
|
||||
|
|
||||
export interface EntityChangeWithUsername { |
|
||||
entityChange: EntityChange; |
|
||||
userName?: string; |
|
||||
} |
|
||||
|
|
||||
export interface Action { |
|
||||
id: string; |
|
||||
serviceName?: string; |
|
||||
methodName?: string; |
|
||||
parameters?: string; |
|
||||
executionTime: Date; |
|
||||
executionDuration?: number; |
|
||||
extraProperties?: ExtraPropertyDictionary; |
|
||||
} |
|
||||
|
|
||||
export interface AuditLog { |
|
||||
id: string; |
|
||||
applicationName?: string; |
|
||||
userId?: string; |
|
||||
userName?: string; |
|
||||
tenantId?: string; |
|
||||
tenantName?: string; |
|
||||
impersonatorUserId?: string; |
|
||||
impersonatorTenantId?: string; |
|
||||
executionTime?: Date; |
|
||||
executionDuration?: number; |
|
||||
clientIpAddress?: string; |
|
||||
clientName?: string; |
|
||||
clientId?: string; |
|
||||
correlationId?: string; |
|
||||
browserInfo?: string; |
|
||||
httpMethod?: string; |
|
||||
url?: string; |
|
||||
exceptions?: string; |
|
||||
comments?: string; |
|
||||
httpStatusCode?: number; |
|
||||
entityChanges?: EntityChange[]; |
|
||||
actions?: Action[]; |
|
||||
extraProperties?: ExtraPropertyDictionary; |
|
||||
} |
|
||||
|
|
||||
export interface GetAuditLogPagedRequest extends PagedAndSortedResultRequestDto { |
|
||||
startTime?: Date; |
|
||||
endTime?: Date; |
|
||||
httpMethod?: string; |
|
||||
url?: string; |
|
||||
userName?: string; |
|
||||
correlationId?: string; |
|
||||
clientId?: string; |
|
||||
clientIpAddress?: string; |
|
||||
applicationName?: string; |
|
||||
maxExecutionDuration?: number; |
|
||||
minExecutionDuration?: number; |
|
||||
hasException?: boolean; |
|
||||
httpStatusCode?: number; |
|
||||
} |
|
||||
|
|
||||
export interface EntityChangeGetByPagedRequest extends PagedAndSortedResultRequestDto { |
|
||||
auditLogId?: string; |
|
||||
startTime?: Date; |
|
||||
endTime?: Date; |
|
||||
changeType?: ChangeType; |
|
||||
entityId?: string; |
|
||||
entityTypeFullName?: string; |
|
||||
} |
|
||||
|
|
||||
export interface EntityChangeGetWithUsernameInput { |
|
||||
entityId?: string; |
|
||||
entityTypeFullName?: string; |
|
||||
} |
|
||||
|
|
||||
export interface RestoreEntityInput { |
|
||||
entityId: string; |
|
||||
entityChangeId?: string; |
|
||||
} |
|
||||
@ -0,0 +1,21 @@ |
|||||
|
import { defHttp } from '/@/utils/http/axios'; |
||||
|
import { SecurityLog, GetSecurityLogPagedRequest } from './model'; |
||||
|
|
||||
|
export const deleteById = (id: string) => { |
||||
|
return defHttp.delete<void>({ |
||||
|
url: `/api/auditing/security-log/${id}`, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getById = (id: string) => { |
||||
|
return defHttp.get<SecurityLog>({ |
||||
|
url: `/api/auditing/security-log/${id}`, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getList = (input: GetSecurityLogPagedRequest) => { |
||||
|
return defHttp.get<PagedResultDto<SecurityLog>>({ |
||||
|
url: 'api/auditing/security-log', |
||||
|
params: input, |
||||
|
}); |
||||
|
}; |
||||
@ -0,0 +1,27 @@ |
|||||
|
export interface SecurityLog extends ExtensibleObject { |
||||
|
id: string; |
||||
|
applicationName?: string; |
||||
|
identity?: string; |
||||
|
action?: string; |
||||
|
userId?: string; |
||||
|
userName?: string; |
||||
|
tenantName?: string; |
||||
|
clientId?: string; |
||||
|
correlationId?: string; |
||||
|
clientIpAddress?: string; |
||||
|
browserInfo?: string; |
||||
|
creationTime?: Date; |
||||
|
} |
||||
|
|
||||
|
export interface GetSecurityLogPagedRequest extends PagedAndSortedResultRequestDto { |
||||
|
startTime?: Date; |
||||
|
endTime?: Date; |
||||
|
applicationName?: string; |
||||
|
identity?: string; |
||||
|
actionName?: string; |
||||
|
userId?: string; |
||||
|
userName?: string; |
||||
|
clientId?: string; |
||||
|
correlationId?: string; |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,40 @@ |
|||||
|
import { defHttp } from '/@/utils/http/axios'; |
||||
|
import { |
||||
|
ApiResource, |
||||
|
ApiResourceCreate, |
||||
|
ApiResourceUpdate, |
||||
|
GetApiResourcePagedRequest, |
||||
|
} from './model'; |
||||
|
|
||||
|
export const create = (input: ApiResourceCreate) => { |
||||
|
return defHttp.post<ApiResource>({ |
||||
|
url: '/api/identity-server/api-resources', |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const update = (id: string, input: ApiResourceUpdate) => { |
||||
|
return defHttp.put<ApiResource>({ |
||||
|
url: `/api/identity-server/api-resources/${id}`, |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const deleteById = (id: string) => { |
||||
|
return defHttp.delete<void>({ |
||||
|
url: `/api/identity-server/api-resources/${id}`, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const get = (id: string) => { |
||||
|
return defHttp.get<ApiResource>({ |
||||
|
url: `/api/identity-server/api-resources/${id}`, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getList = (input: GetApiResourcePagedRequest) => { |
||||
|
return defHttp.get<PagedResultDto<ApiResource>>({ |
||||
|
url: '/api/identity-server/api-resources', |
||||
|
params: input, |
||||
|
}); |
||||
|
}; |
||||
@ -0,0 +1,40 @@ |
|||||
|
import { defHttp } from '/@/utils/http/axios'; |
||||
|
import { |
||||
|
ApiScope, |
||||
|
ApiScopeCreate, |
||||
|
ApiScopeUpdate, |
||||
|
GetApiScopePagedRequest, |
||||
|
} from './model'; |
||||
|
|
||||
|
export const create = (input: ApiScopeCreate) => { |
||||
|
return defHttp.post<ApiScope>({ |
||||
|
url: '/api/identity-server/api-scopes', |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const update = (id: string, input: ApiScopeUpdate) => { |
||||
|
return defHttp.put<ApiScope>({ |
||||
|
url: `/api/identity-server/api-scopes/${id}`, |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const deleteById = (id: string) => { |
||||
|
return defHttp.delete<void>({ |
||||
|
url: `/api/identity-server/api-scopes/${id}`, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const get = (id: string) => { |
||||
|
return defHttp.get<ApiScope>({ |
||||
|
url: `/api/identity-server/api-scopes/${id}`, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getList = (input: GetApiScopePagedRequest) => { |
||||
|
return defHttp.get<PagedResultDto<ApiScope>>({ |
||||
|
url: '/api/identity-server/api-scopes', |
||||
|
params: input, |
||||
|
}); |
||||
|
}; |
||||
@ -1,49 +0,0 @@ |
|||||
import { defAbpHttp } from '/@/utils/http/abp'; |
|
||||
import { |
|
||||
ApiResource, |
|
||||
ApiResourceCreate, |
|
||||
ApiResourceUpdate, |
|
||||
GetApiResourcePagedRequest, |
|
||||
ApiResourcePagedResult, |
|
||||
} from './model/apiResourcesModel'; |
|
||||
import { format } from '/@/utils/strings'; |
|
||||
|
|
||||
enum Api { |
|
||||
Create = '/api/identity-server/api-resources', |
|
||||
DeleteById = '/api/identity-server/api-resources/{id}', |
|
||||
GetById = '/api/identity-server/api-resources/{id}', |
|
||||
GetList = '/api/identity-server/api-resources', |
|
||||
} |
|
||||
|
|
||||
export const create = (input: ApiResourceCreate) => { |
|
||||
return defAbpHttp.post<ApiResource>({ |
|
||||
url: Api.Create, |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const update = (id: string, input: ApiResourceUpdate) => { |
|
||||
return defAbpHttp.put<ApiResource>({ |
|
||||
url: format(Api.GetById, { id: id }), |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const deleteById = (id: string) => { |
|
||||
return defAbpHttp.delete<void>({ |
|
||||
url: format(Api.GetById, { id: id }), |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const get = (id: string) => { |
|
||||
return defAbpHttp.get<ApiResource>({ |
|
||||
url: format(Api.GetById, { id: id }), |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getList = (input: GetApiResourcePagedRequest) => { |
|
||||
return defAbpHttp.get<ApiResourcePagedResult>({ |
|
||||
url: Api.GetList, |
|
||||
params: input, |
|
||||
}); |
|
||||
}; |
|
||||
@ -1,49 +0,0 @@ |
|||||
import { defAbpHttp } from '/@/utils/http/abp'; |
|
||||
import { |
|
||||
ApiScope, |
|
||||
ApiScopeCreate, |
|
||||
ApiScopeUpdate, |
|
||||
GetApiScopePagedRequest, |
|
||||
ApiScopePagedResult, |
|
||||
} from './model/apiScopesModel'; |
|
||||
import { format } from '/@/utils/strings'; |
|
||||
|
|
||||
enum Api { |
|
||||
Create = '/api/identity-server/api-scopes', |
|
||||
DeleteById = '/api/identity-server/api-scopes/{id}', |
|
||||
GetById = '/api/identity-server/api-scopes/{id}', |
|
||||
GetList = '/api/identity-server/api-scopes', |
|
||||
} |
|
||||
|
|
||||
export const create = (input: ApiScopeCreate) => { |
|
||||
return defAbpHttp.post<ApiScope>({ |
|
||||
url: Api.Create, |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const update = (id: string, input: ApiScopeUpdate) => { |
|
||||
return defAbpHttp.put<ApiScope>({ |
|
||||
url: format(Api.GetById, { id: id }), |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const deleteById = (id: string) => { |
|
||||
return defAbpHttp.delete<void>({ |
|
||||
url: format(Api.GetById, { id: id }), |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const get = (id: string) => { |
|
||||
return defAbpHttp.get<ApiScope>({ |
|
||||
url: format(Api.GetById, { id: id }), |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getList = (input: GetApiScopePagedRequest) => { |
|
||||
return defAbpHttp.get<ApiScopePagedResult>({ |
|
||||
url: Api.GetList, |
|
||||
params: input, |
|
||||
}); |
|
||||
}; |
|
||||
@ -1,79 +0,0 @@ |
|||||
import { defAbpHttp } from '/@/utils/http/abp'; |
|
||||
import { |
|
||||
Client, |
|
||||
ClientClone, |
|
||||
ClientCreate, |
|
||||
ClientUpdate, |
|
||||
GetClientPagedRequest, |
|
||||
ClientPagedResult, |
|
||||
} from './model/clientsModel'; |
|
||||
import { format } from '/@/utils/strings'; |
|
||||
|
|
||||
enum Api { |
|
||||
Clone = '/api/identity-server/clients/{id}/clone', |
|
||||
Create = '/api/identity-server/clients', |
|
||||
DeleteById = '/api/identity-server/clients/{id}', |
|
||||
GetById = '/api/identity-server/clients/{id}', |
|
||||
GetList = '/api/identity-server/clients', |
|
||||
GetAssignableApiResources = '/api/identity-server/clients/assignable-api-resources', |
|
||||
GetAssignableIdentityResources = '/api/identity-server/clients/assignable-identity-resources', |
|
||||
GetAllDistinctAllowedCorsOrigins = '/api/identity-server/clients/distinct-cors-origins', |
|
||||
} |
|
||||
|
|
||||
export const clone = (id: string, input: ClientClone) => { |
|
||||
return defAbpHttp.post<Client>({ |
|
||||
url: format(Api.Clone, { id: id }), |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const create = (input: ClientCreate) => { |
|
||||
return defAbpHttp.post<Client>({ |
|
||||
url: Api.Create, |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const update = (id: string, input: ClientUpdate) => { |
|
||||
return defAbpHttp.put<Client>({ |
|
||||
url: format(Api.GetById, { id: id }), |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const deleteById = (id: string) => { |
|
||||
return defAbpHttp.delete<void>({ |
|
||||
url: format(Api.GetById, { id: id }), |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const get = (id: string) => { |
|
||||
return defAbpHttp.get<Client>({ |
|
||||
url: format(Api.GetById, { id: id }), |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getList = (input: GetClientPagedRequest) => { |
|
||||
return defAbpHttp.get<ClientPagedResult>({ |
|
||||
url: Api.GetList, |
|
||||
params: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getAssignableApiResources = () => { |
|
||||
return defAbpHttp.get<ListResultDto<string>>({ |
|
||||
url: Api.GetAssignableApiResources, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getAssignableIdentityResources = () => { |
|
||||
return defAbpHttp.get<ListResultDto<string>>({ |
|
||||
url: Api.GetAssignableIdentityResources, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getAllDistinctAllowedCorsOrigins = () => { |
|
||||
return defAbpHttp.get<ListResultDto<string>>({ |
|
||||
url: Api.GetAllDistinctAllowedCorsOrigins, |
|
||||
}); |
|
||||
}; |
|
||||
@ -0,0 +1,66 @@ |
|||||
|
import { defHttp } from '/@/utils/http/axios'; |
||||
|
import { |
||||
|
Client, |
||||
|
ClientClone, |
||||
|
ClientCreate, |
||||
|
ClientUpdate, |
||||
|
GetClientPagedRequest, |
||||
|
} from './model'; |
||||
|
|
||||
|
export const clone = (id: string, input: ClientClone) => { |
||||
|
return defHttp.post<Client>({ |
||||
|
url: `/api/identity-server/clients/${id}/clone`, |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const create = (input: ClientCreate) => { |
||||
|
return defHttp.post<Client>({ |
||||
|
url: '/api/identity-server/clients', |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const update = (id: string, input: ClientUpdate) => { |
||||
|
return defHttp.put<Client>({ |
||||
|
url: `/api/identity-server/clients/${id}`, |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const deleteById = (id: string) => { |
||||
|
return defHttp.delete<void>({ |
||||
|
url: `/api/identity-server/clients/${id}`, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const get = (id: string) => { |
||||
|
return defHttp.get<Client>({ |
||||
|
url: `/api/identity-server/clients/${id}`, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getList = (input: GetClientPagedRequest) => { |
||||
|
return defHttp.get<PagedResultDto<Client>>({ |
||||
|
url: '/api/identity-server/clients', |
||||
|
params: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getAssignableApiResources = () => { |
||||
|
return defHttp.get<ListResultDto<string>>({ |
||||
|
url: '/api/identity-server/clients/assignable-api-resources', |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getAssignableIdentityResources = () => { |
||||
|
return defHttp.get<ListResultDto<string>>({ |
||||
|
url: '/api/identity-server/clients/assignable-identity-resources', |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getAllDistinctAllowedCorsOrigins = () => { |
||||
|
return defHttp.get<ListResultDto<string>>({ |
||||
|
url: '/api/identity-server/clients/distinct-cors-origins', |
||||
|
}); |
||||
|
}; |
||||
@ -0,0 +1,8 @@ |
|||||
|
import { defHttp } from '/@/utils/http/axios'; |
||||
|
import { OpenIdConfiguration } from './model'; |
||||
|
|
||||
|
export const discovery = () => { |
||||
|
return defHttp.get<OpenIdConfiguration>({ |
||||
|
url: '/.well-known/openid-configuration', |
||||
|
}); |
||||
|
}; |
||||
@ -0,0 +1,26 @@ |
|||||
|
export interface OpenIdConfiguration { |
||||
|
issuer: string; |
||||
|
jwks_uri: string; |
||||
|
authorization_endpoint: string; |
||||
|
token_endpoint: string; |
||||
|
userinfo_endpoint: string; |
||||
|
end_session_endpoint: string; |
||||
|
check_session_iframe: string; |
||||
|
revocation_endpoint: string; |
||||
|
introspection_endpoint: string; |
||||
|
device_authorization_endpoint: string; |
||||
|
frontchannel_logout_supported: boolean; |
||||
|
frontchannel_logout_session_supported: boolean; |
||||
|
backchannel_logout_supported: boolean; |
||||
|
backchannel_logout_session_supported: boolean; |
||||
|
scopes_supported: string[]; |
||||
|
claims_supported: string[]; |
||||
|
grant_types_supported: string[]; |
||||
|
response_types_supported: string[]; |
||||
|
response_modes_supported: string[]; |
||||
|
token_endpoint_auth_methods_supported: string[]; |
||||
|
id_token_signing_alg_values_supported: string[]; |
||||
|
subject_types_supported: string[]; |
||||
|
code_challenge_methods_supported: string[]; |
||||
|
request_parameter_supported: boolean; |
||||
|
} |
||||
@ -0,0 +1,40 @@ |
|||||
|
import { defHttp } from '/@/utils/http/axios'; |
||||
|
import { |
||||
|
IdentityResource, |
||||
|
IdentityResourceCreate, |
||||
|
IdentityResourceUpdate, |
||||
|
GetIdentityResourcePagedRequest, |
||||
|
} from './model'; |
||||
|
|
||||
|
export const create = (input: IdentityResourceCreate) => { |
||||
|
return defHttp.post<IdentityResource>({ |
||||
|
url: '/api/identity-server/identity-resources', |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const update = (id: string, input: IdentityResourceUpdate) => { |
||||
|
return defHttp.put<IdentityResource>({ |
||||
|
url: `/api/identity-server/identity-resources/${id}`, |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const deleteById = (id: string) => { |
||||
|
return defHttp.delete<void>({ |
||||
|
url: `/api/identity-server/identity-resources/${id}`, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const get = (id: string) => { |
||||
|
return defHttp.get<IdentityResource>({ |
||||
|
url: `/api/identity-server/identity-resources/${id}`, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getList = (input: GetIdentityResourcePagedRequest) => { |
||||
|
return defHttp.get<PagedResultDto<IdentityResource>>({ |
||||
|
url: '/api/identity-server/identity-resources', |
||||
|
params: input, |
||||
|
}); |
||||
|
}; |
||||
@ -1,49 +0,0 @@ |
|||||
import { defAbpHttp } from '/@/utils/http/abp'; |
|
||||
import { |
|
||||
IdentityResource, |
|
||||
IdentityResourceCreate, |
|
||||
IdentityResourceUpdate, |
|
||||
GetIdentityResourcePagedRequest, |
|
||||
IdentityResourcePagedResult, |
|
||||
} from './model/identityResourcesModel'; |
|
||||
import { format } from '/@/utils/strings'; |
|
||||
|
|
||||
enum Api { |
|
||||
Create = '/api/identity-server/identity-resources', |
|
||||
DeleteById = '/api/identity-server/identity-resources/{id}', |
|
||||
GetById = '/api/identity-server/identity-resources/{id}', |
|
||||
GetList = '/api/identity-server/identity-resources', |
|
||||
} |
|
||||
|
|
||||
export const create = (input: IdentityResourceCreate) => { |
|
||||
return defAbpHttp.post<IdentityResource>({ |
|
||||
url: Api.Create, |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const update = (id: string, input: IdentityResourceUpdate) => { |
|
||||
return defAbpHttp.put<IdentityResource>({ |
|
||||
url: format(Api.GetById, { id: id }), |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const deleteById = (id: string) => { |
|
||||
return defAbpHttp.delete<void>({ |
|
||||
url: format(Api.GetById, { id: id }), |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const get = (id: string) => { |
|
||||
return defAbpHttp.get<IdentityResource>({ |
|
||||
url: format(Api.GetById, { id: id }), |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getList = (input: GetIdentityResourcePagedRequest) => { |
|
||||
return defAbpHttp.get<IdentityResourcePagedResult>({ |
|
||||
url: Api.GetList, |
|
||||
params: input, |
|
||||
}); |
|
||||
}; |
|
||||
@ -1,12 +0,0 @@ |
|||||
import { defAbpHttp } from '/@/utils/http/abp'; |
|
||||
import { OpenIdConfiguration } from './model/basicModel'; |
|
||||
|
|
||||
enum Api { |
|
||||
Discovery = '/.well-known/openid-configuration', |
|
||||
} |
|
||||
|
|
||||
export const discovery = () => { |
|
||||
return defAbpHttp.get<OpenIdConfiguration>({ |
|
||||
url: Api.Discovery, |
|
||||
}); |
|
||||
}; |
|
||||
@ -1,35 +0,0 @@ |
|||||
export interface UserClaim { |
|
||||
type: string; |
|
||||
} |
|
||||
|
|
||||
export interface Property { |
|
||||
key: string; |
|
||||
value: string; |
|
||||
} |
|
||||
|
|
||||
export interface OpenIdConfiguration { |
|
||||
issuer: string; |
|
||||
jwks_uri: string; |
|
||||
authorization_endpoint: string; |
|
||||
token_endpoint: string; |
|
||||
userinfo_endpoint: string; |
|
||||
end_session_endpoint: string; |
|
||||
check_session_iframe: string; |
|
||||
revocation_endpoint: string; |
|
||||
introspection_endpoint: string; |
|
||||
device_authorization_endpoint: string; |
|
||||
frontchannel_logout_supported: boolean; |
|
||||
frontchannel_logout_session_supported: boolean; |
|
||||
backchannel_logout_supported: boolean; |
|
||||
backchannel_logout_session_supported: boolean; |
|
||||
scopes_supported: string[]; |
|
||||
claims_supported: string[]; |
|
||||
grant_types_supported: string[]; |
|
||||
response_types_supported: string[]; |
|
||||
response_modes_supported: string[]; |
|
||||
token_endpoint_auth_methods_supported: string[]; |
|
||||
id_token_signing_alg_values_supported: string[]; |
|
||||
subject_types_supported: string[]; |
|
||||
code_challenge_methods_supported: string[]; |
|
||||
request_parameter_supported: boolean; |
|
||||
} |
|
||||
@ -0,0 +1,8 @@ |
|||||
|
export interface UserClaim { |
||||
|
type: string; |
||||
|
} |
||||
|
|
||||
|
export interface Property { |
||||
|
key: string; |
||||
|
value: string; |
||||
|
} |
||||
@ -1,19 +0,0 @@ |
|||||
export interface PersistedGrant extends ExtensibleEntityDto<string> { |
|
||||
key: string; |
|
||||
type: string; |
|
||||
subjectId: string; |
|
||||
sessionId: string; |
|
||||
description: string; |
|
||||
consumedTime?: Date; |
|
||||
clientId: string; |
|
||||
creationTime: Date; |
|
||||
expiration?: Date; |
|
||||
data: string; |
|
||||
} |
|
||||
|
|
||||
export interface PersistedGrantPagedResult extends PagedResultDto<PersistedGrant> {} |
|
||||
|
|
||||
export interface GetPersistedGrantPagedRequest extends PagedAndSortedResultRequestDto { |
|
||||
filter?: string; |
|
||||
subjectId?: string; |
|
||||
} |
|
||||
@ -0,0 +1,24 @@ |
|||||
|
import { defHttp } from '/@/utils/http/axios'; |
||||
|
import { |
||||
|
PersistedGrant, |
||||
|
GetPersistedGrantPagedRequest, |
||||
|
} from './model'; |
||||
|
|
||||
|
export const deleteById = (id: string) => { |
||||
|
return defHttp.delete<void>({ |
||||
|
url: `/api/identity-server/persisted-grants/${id}`, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const get = (id: string) => { |
||||
|
return defHttp.get<PersistedGrant>({ |
||||
|
url: `/api/identity-server/persisted-grants/${id}`, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getList = (input: GetPersistedGrantPagedRequest) => { |
||||
|
return defHttp.get<PagedResultDto<PersistedGrant>>({ |
||||
|
url: '/api/identity-server/persisted-grants', |
||||
|
params: input, |
||||
|
}); |
||||
|
}; |
||||
@ -0,0 +1,18 @@ |
|||||
|
export interface PersistedGrant extends ExtensibleEntityDto<string> { |
||||
|
key: string; |
||||
|
type: string; |
||||
|
subjectId: string; |
||||
|
sessionId: string; |
||||
|
description: string; |
||||
|
consumedTime?: Date; |
||||
|
clientId: string; |
||||
|
creationTime: Date; |
||||
|
expiration?: Date; |
||||
|
data: string; |
||||
|
} |
||||
|
|
||||
|
export interface GetPersistedGrantPagedRequest extends PagedAndSortedResultRequestDto { |
||||
|
filter?: string; |
||||
|
subjectId?: string; |
||||
|
} |
||||
|
|
||||
@ -1,32 +0,0 @@ |
|||||
import { defAbpHttp } from '/@/utils/http/abp'; |
|
||||
import { |
|
||||
PersistedGrant, |
|
||||
GetPersistedGrantPagedRequest, |
|
||||
PersistedGrantPagedResult, |
|
||||
} from './model/persistedGrantsModel'; |
|
||||
import { format } from '/@/utils/strings'; |
|
||||
|
|
||||
enum Api { |
|
||||
DeleteById = '/api/identity-server/persisted-grants/{id}', |
|
||||
GetById = '/api/identity-server/persisted-grants/{id}', |
|
||||
GetList = '/api/identity-server/persisted-grants', |
|
||||
} |
|
||||
|
|
||||
export const deleteById = (id: string) => { |
|
||||
return defAbpHttp.delete<void>({ |
|
||||
url: format(Api.GetById, { id: id }), |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const get = (id: string) => { |
|
||||
return defAbpHttp.get<PersistedGrant>({ |
|
||||
url: format(Api.GetById, { id: id }), |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getList = (input: GetPersistedGrantPagedRequest) => { |
|
||||
return defAbpHttp.get<PersistedGrantPagedResult>({ |
|
||||
url: Api.GetList, |
|
||||
params: input, |
|
||||
}); |
|
||||
}; |
|
||||
@ -1,57 +0,0 @@ |
|||||
import { defAbpHttp } from '/@/utils/http/abp'; |
|
||||
import { |
|
||||
IdentityClaimType, |
|
||||
CreateIdentityClaimType, |
|
||||
IdentityClaimTypeListResult, |
|
||||
UpdateIdentityClaimType, |
|
||||
GetIdentityClaimTypePagedRequest, |
|
||||
} from './model/claimModel'; |
|
||||
import { format } from '/@/utils/strings'; |
|
||||
|
|
||||
enum Api { |
|
||||
Create = '/api/identity/claim-types', |
|
||||
Delete = '/api/identity/claim-types/{id}', |
|
||||
Update = '/api/identity/claim-types/{id}', |
|
||||
GetById = '/api/identity/claim-types/{id}', |
|
||||
GetList = '/api/identity/claim-types', |
|
||||
GetActivedList = '/api/identity/claim-types/actived-list', |
|
||||
} |
|
||||
|
|
||||
export const create = (input: CreateIdentityClaimType) => { |
|
||||
return defAbpHttp.post<IdentityClaimType>({ |
|
||||
url: Api.Create, |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const deleteById = (id: string) => { |
|
||||
return defAbpHttp.delete<void>({ |
|
||||
url: format(Api.Delete, { id: id }), |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const update = (id: string, input: UpdateIdentityClaimType) => { |
|
||||
return defAbpHttp.put<IdentityClaimType>({ |
|
||||
url: format(Api.Update, { id: id }), |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getById = (id: string) => { |
|
||||
return defAbpHttp.get<IdentityClaimType>({ |
|
||||
url: format(Api.GetById, { id: id }), |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getList = (input: GetIdentityClaimTypePagedRequest) => { |
|
||||
return defAbpHttp.get<IdentityClaimType>({ |
|
||||
url: Api.GetList, |
|
||||
params: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getActivedList = () => { |
|
||||
return defAbpHttp.get<IdentityClaimTypeListResult>({ |
|
||||
url: Api.GetActivedList, |
|
||||
}); |
|
||||
}; |
|
||||
@ -0,0 +1,47 @@ |
|||||
|
import { defHttp } from '/@/utils/http/axios'; |
||||
|
import { |
||||
|
IdentityClaimType, |
||||
|
CreateIdentityClaimType, |
||||
|
IdentityClaimTypeListResult, |
||||
|
UpdateIdentityClaimType, |
||||
|
GetIdentityClaimTypePagedRequest, |
||||
|
} from './model'; |
||||
|
|
||||
|
export const create = (input: CreateIdentityClaimType) => { |
||||
|
return defHttp.post<IdentityClaimType>({ |
||||
|
url: '/api/identity/claim-types', |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const deleteById = (id: string) => { |
||||
|
return defHttp.delete<void>({ |
||||
|
url: `/api/identity/claim-types/${id}`, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const update = (id: string, input: UpdateIdentityClaimType) => { |
||||
|
return defHttp.put<IdentityClaimType>({ |
||||
|
url: `/api/identity/claim-types/${id}`, |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getById = (id: string) => { |
||||
|
return defHttp.get<IdentityClaimType>({ |
||||
|
url: `'/api/identity/claim-types/${id}'`, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getList = (input: GetIdentityClaimTypePagedRequest) => { |
||||
|
return defHttp.get<IdentityClaimType>({ |
||||
|
url: '/api/identity/claim-types', |
||||
|
params: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getActivedList = () => { |
||||
|
return defHttp.get<IdentityClaimTypeListResult>({ |
||||
|
url: '/api/identity/claim-types/actived-list', |
||||
|
}); |
||||
|
}; |
||||
@ -0,0 +1,56 @@ |
|||||
|
export enum ValueType { |
||||
|
String = 0, |
||||
|
Int = 1, |
||||
|
Boolean = 2, |
||||
|
DateTime = 3, |
||||
|
} |
||||
|
|
||||
|
export interface IdentityClaimType extends ExtensibleEntityDto<string> { |
||||
|
name: string; |
||||
|
required: boolean; |
||||
|
isStatic: boolean; |
||||
|
regex?: string; |
||||
|
regexDescription?: string; |
||||
|
description?: string; |
||||
|
valueType: ValueType; |
||||
|
} |
||||
|
|
||||
|
export interface CreateOrUpdateIdentityClaimType extends ExtensibleObject { |
||||
|
required: boolean; |
||||
|
regex?: string; |
||||
|
regexDescription?: string; |
||||
|
description?: string; |
||||
|
} |
||||
|
|
||||
|
export interface CreateIdentityClaimType extends CreateOrUpdateIdentityClaimType { |
||||
|
name: string; |
||||
|
isStatic: boolean; |
||||
|
valueType: ValueType; |
||||
|
} |
||||
|
|
||||
|
export interface UpdateIdentityClaimType extends CreateOrUpdateIdentityClaimType {} |
||||
|
|
||||
|
export interface GetIdentityClaimTypePagedRequest extends PagedAndSortedResultRequestDto { |
||||
|
filter?: string; |
||||
|
} |
||||
|
|
||||
|
export interface IdentityClaimTypeListResult extends ListResultDto<IdentityClaimType> {} |
||||
|
|
||||
|
export interface IdentityClaimTypePagedResult extends PagedResultDto<IdentityClaimType> {} |
||||
|
|
||||
|
export interface IdentityClaim { |
||||
|
claimType: string; |
||||
|
claimValue: string; |
||||
|
} |
||||
|
|
||||
|
export interface DeleteIdentityClaim { |
||||
|
claimType: string; |
||||
|
claimValue: string; |
||||
|
} |
||||
|
|
||||
|
export interface CreateIdentityClaim extends IdentityClaim {} |
||||
|
|
||||
|
export interface UpdateIdentityClaim extends IdentityClaim { |
||||
|
newClaimValue: string; |
||||
|
} |
||||
|
|
||||
@ -1,55 +0,0 @@ |
|||||
export enum ValueType { |
|
||||
String = 0, |
|
||||
Int = 1, |
|
||||
Boolean = 2, |
|
||||
DateTime = 3, |
|
||||
} |
|
||||
|
|
||||
export interface IdentityClaimType extends ExtensibleEntityDto<string> { |
|
||||
name: string; |
|
||||
required: boolean; |
|
||||
isStatic: boolean; |
|
||||
regex?: string; |
|
||||
regexDescription?: string; |
|
||||
description?: string; |
|
||||
valueType: ValueType; |
|
||||
} |
|
||||
|
|
||||
export interface CreateOrUpdateIdentityClaimType extends ExtensibleObject { |
|
||||
required: boolean; |
|
||||
regex?: string; |
|
||||
regexDescription?: string; |
|
||||
description?: string; |
|
||||
} |
|
||||
|
|
||||
export interface CreateIdentityClaimType extends CreateOrUpdateIdentityClaimType { |
|
||||
name: string; |
|
||||
isStatic: boolean; |
|
||||
valueType: ValueType; |
|
||||
} |
|
||||
|
|
||||
export interface UpdateIdentityClaimType extends CreateOrUpdateIdentityClaimType {} |
|
||||
|
|
||||
export interface GetIdentityClaimTypePagedRequest extends PagedAndSortedResultRequestDto { |
|
||||
filter?: string; |
|
||||
} |
|
||||
|
|
||||
export interface IdentityClaimTypeListResult extends ListResultDto<IdentityClaimType> {} |
|
||||
|
|
||||
export interface IdentityClaimTypePagedResult extends PagedResultDto<IdentityClaimType> {} |
|
||||
|
|
||||
export interface IdentityClaim { |
|
||||
claimType: string; |
|
||||
claimValue: string; |
|
||||
} |
|
||||
|
|
||||
export interface DeleteIdentityClaim { |
|
||||
claimType: string; |
|
||||
claimValue: string; |
|
||||
} |
|
||||
|
|
||||
export interface CreateIdentityClaim extends IdentityClaim {} |
|
||||
|
|
||||
export interface UpdateIdentityClaim extends IdentityClaim { |
|
||||
newClaimValue: string; |
|
||||
} |
|
||||
@ -1,47 +0,0 @@ |
|||||
/** 组织机构 */ |
|
||||
export interface OrganizationUnit extends AuditedEntityDto<string> { |
|
||||
/** 父节点标识 */ |
|
||||
parentId?: string; |
|
||||
/** 编号 */ |
|
||||
code: string; |
|
||||
/** 显示名称 */ |
|
||||
displayName: string; |
|
||||
} |
|
||||
|
|
||||
/** 组织机构分页查询对象 */ |
|
||||
export interface GetOrganizationUnitPagedRequest extends PagedAndSortedResultRequestDto { |
|
||||
/** 过滤字符 */ |
|
||||
filter?: string; |
|
||||
} |
|
||||
|
|
||||
/** 组织结构分页返回结果 */ |
|
||||
export interface OrganizationUnitPagedResult extends PagedResultDto<OrganizationUnit> {} |
|
||||
|
|
||||
/** 组织结构列表返回结果 */ |
|
||||
export interface OrganizationUnitListResult extends ListResultDto<OrganizationUnit> {} |
|
||||
|
|
||||
/** 组织机构创建对象 */ |
|
||||
export interface CreateOrganizationUnit { |
|
||||
/** 显示名称 */ |
|
||||
displayName: string; |
|
||||
/** 父节点标识 */ |
|
||||
parentId?: string; |
|
||||
} |
|
||||
|
|
||||
/** 组织机构变更对象 */ |
|
||||
export interface UpdateOrganizationUnit { |
|
||||
/** 显示名称 */ |
|
||||
displayName: string; |
|
||||
} |
|
||||
|
|
||||
/** 组织机构增加部门对象 */ |
|
||||
export interface OrganizationUnitAddRole { |
|
||||
/** 角色标识列表 */ |
|
||||
roleIds: string[]; |
|
||||
} |
|
||||
|
|
||||
/** 组织机构增加用户对象 */ |
|
||||
export interface OrganizationUnitAddUser { |
|
||||
/** 用户标识列表 */ |
|
||||
userIds: string[]; |
|
||||
} |
|
||||
@ -1,26 +0,0 @@ |
|||||
export interface SecurityLog extends ExtensibleObject { |
|
||||
id: string; |
|
||||
applicationName?: string; |
|
||||
identity?: string; |
|
||||
action?: string; |
|
||||
userId?: string; |
|
||||
userName?: string; |
|
||||
tenantName?: string; |
|
||||
clientId?: string; |
|
||||
correlationId?: string; |
|
||||
clientIpAddress?: string; |
|
||||
browserInfo?: string; |
|
||||
creationTime?: Date; |
|
||||
} |
|
||||
|
|
||||
export interface GetSecurityLogPagedRequest extends PagedAndSortedResultRequestDto { |
|
||||
startTime?: Date; |
|
||||
endTime?: Date; |
|
||||
applicationName?: string; |
|
||||
identity?: string; |
|
||||
actionName?: string; |
|
||||
userId?: string; |
|
||||
userName?: string; |
|
||||
clientId?: string; |
|
||||
correlationId?: string; |
|
||||
} |
|
||||
@ -1,21 +0,0 @@ |
|||||
export interface IUserData { |
|
||||
id: string; |
|
||||
tenantId?: string; |
|
||||
userName: string; |
|
||||
name: string; |
|
||||
surname: string; |
|
||||
email: string; |
|
||||
emailConfirmed: boolean; |
|
||||
phoneNumber: string; |
|
||||
phoneNumberConfirmed: boolean; |
|
||||
} |
|
||||
|
|
||||
export interface UserLookupSearchRequest extends PagedAndSortedResultRequestDto { |
|
||||
filter?: string; |
|
||||
} |
|
||||
|
|
||||
export interface UserLookupCountRequest extends PagedAndSortedResultRequestDto { |
|
||||
filter?: string; |
|
||||
} |
|
||||
|
|
||||
export interface UserLookupSearchResult extends ListResultDto<IUserData> {} |
|
||||
@ -1,128 +0,0 @@ |
|||||
import { defAbpHttp } from '/@/utils/http/abp'; |
|
||||
import { |
|
||||
OrganizationUnit, |
|
||||
CreateOrganizationUnit, |
|
||||
UpdateOrganizationUnit, |
|
||||
GetOrganizationUnitPagedRequest, |
|
||||
OrganizationUnitPagedResult, |
|
||||
OrganizationUnitListResult, |
|
||||
} from './model/organizationUnitsModel'; |
|
||||
import { UserPagedResult, GetUserPagedRequest } from './model/userModel'; |
|
||||
import { RolePagedResult, GetRolePagedRequest } from './model/roleModel'; |
|
||||
import { format } from '/@/utils/strings'; |
|
||||
|
|
||||
enum Api { |
|
||||
Create = '/api/identity/organization-units', |
|
||||
Delete = '/api/identity/organization-units/{id}', |
|
||||
Update = '/api/identity/organization-units/{id}', |
|
||||
GetById = '/api/identity/organization-units/{id}', |
|
||||
GetList = '/api/identity/organization-units', |
|
||||
GetAllList = '/api/identity/organization-units/all', |
|
||||
GetUnaddedMemberList = '/api/identity/organization-units/{id}/unadded-users', |
|
||||
GetMemberList = '/api/identity/organization-units/{id}/users', |
|
||||
GetUnaddedRoleList = '/api/identity/organization-units/{id}/unadded-roles', |
|
||||
GetRoleList = '/api/identity/organization-units/{id}/roles', |
|
||||
Move = 'api/identity/organization-units/{id}/move', |
|
||||
AddMembers = '/api/identity/organization-units/{id}/users', |
|
||||
AddRoles = '/api/identity/organization-units/{id}/roles', |
|
||||
} |
|
||||
|
|
||||
export const create = (input: CreateOrganizationUnit) => { |
|
||||
return defAbpHttp.post<OrganizationUnit>({ |
|
||||
url: Api.Create, |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const update = (id: string, input: UpdateOrganizationUnit) => { |
|
||||
return defAbpHttp.put<OrganizationUnit>({ |
|
||||
url: format(Api.Update, { id: id }), |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const deleteById = (id: string) => { |
|
||||
return defAbpHttp.delete<void>({ |
|
||||
url: format(Api.Delete, { id: id }), |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const get = (id: string) => { |
|
||||
return defAbpHttp.get<OrganizationUnit>({ |
|
||||
url: format(Api.GetById, { id: id }), |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
export const getList = (input: GetOrganizationUnitPagedRequest) => { |
|
||||
return defAbpHttp.get<OrganizationUnitPagedResult>({ |
|
||||
url: Api.GetList, |
|
||||
params: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getUnaddedMemberList = (input: { id: string } & GetUserPagedRequest) => { |
|
||||
return defAbpHttp.get<UserPagedResult>({ |
|
||||
url: format(Api.GetUnaddedMemberList, { id: input.id }), |
|
||||
params: { |
|
||||
filter: input.filter, |
|
||||
sorting: input.sorting, |
|
||||
skipCount: input.skipCount, |
|
||||
maxResultCount: input.maxResultCount, |
|
||||
}, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getMemberList = (id: string, input: GetUserPagedRequest) => { |
|
||||
return defAbpHttp.get<UserPagedResult>({ |
|
||||
url: format(Api.GetMemberList, { id: id }), |
|
||||
params: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getUnaddedRoleList = (input: { id: string } & GetRolePagedRequest) => { |
|
||||
return defAbpHttp.get<RolePagedResult>({ |
|
||||
url: format(Api.GetUnaddedRoleList, { id: input.id }), |
|
||||
params: { |
|
||||
filter: input.filter, |
|
||||
sorting: input.sorting, |
|
||||
skipCount: input.skipCount, |
|
||||
maxResultCount: input.maxResultCount, |
|
||||
}, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getRoleList = (id: string, input: GetRolePagedRequest) => { |
|
||||
return defAbpHttp.get<RolePagedResult>({ |
|
||||
url: format(Api.GetRoleList, { id: id }), |
|
||||
params: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getAll = () => { |
|
||||
return defAbpHttp.get<OrganizationUnitListResult>({ |
|
||||
url: Api.GetAllList, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const move = (id: string, parentId?: string) => { |
|
||||
return defAbpHttp.put<void>({ |
|
||||
url: format(Api.Move, { id: id }), |
|
||||
data: { |
|
||||
parentId: parentId, |
|
||||
}, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const addMembers = (id: string, userIdList: string[]) => { |
|
||||
return defAbpHttp.post<void>({ |
|
||||
url: format(Api.AddMembers, { id: id }), |
|
||||
data: { userIds: userIdList }, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const addRoles = (id: string, roleIdList: string[]) => { |
|
||||
return defAbpHttp.post<void>({ |
|
||||
url: format(Api.AddRoles, { id: id }), |
|
||||
data: { roleIds: roleIdList }, |
|
||||
}); |
|
||||
}; |
|
||||
@ -0,0 +1,110 @@ |
|||||
|
import { defHttp } from '/@/utils/http/axios'; |
||||
|
import { |
||||
|
OrganizationUnit, |
||||
|
CreateOrganizationUnit, |
||||
|
UpdateOrganizationUnit, |
||||
|
GetOrganizationUnitPagedRequest, |
||||
|
} from './model'; |
||||
|
import { GetUserPagedRequest, User } from '../users/model'; |
||||
|
import { GetRolePagedRequest, Role } from '../roles/model'; |
||||
|
|
||||
|
|
||||
|
export const create = (input: CreateOrganizationUnit) => { |
||||
|
return defHttp.post<OrganizationUnit>({ |
||||
|
url: '/api/identity/organization-units', |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const update = (id: string, input: UpdateOrganizationUnit) => { |
||||
|
return defHttp.put<OrganizationUnit>({ |
||||
|
url: `/api/identity/organization-units/${id}`, |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const deleteById = (id: string) => { |
||||
|
return defHttp.delete<void>({ |
||||
|
url: `/api/identity/organization-units/${id}`, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const get = (id: string) => { |
||||
|
return defHttp.get<OrganizationUnit>({ |
||||
|
url: `/api/identity/organization-units/${id}`, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
export const getList = (input: GetOrganizationUnitPagedRequest) => { |
||||
|
return defHttp.get<PagedResultDto<OrganizationUnit>>({ |
||||
|
url: '/api/identity/organization-units', |
||||
|
params: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getUnaddedMemberList = (input: { id: string } & GetUserPagedRequest) => { |
||||
|
return defHttp.get<PagedResultDto<User>>({ |
||||
|
url: `/api/identity/organization-units/${input.id}/unadded-users`, |
||||
|
params: { |
||||
|
filter: input.filter, |
||||
|
sorting: input.sorting, |
||||
|
skipCount: input.skipCount, |
||||
|
maxResultCount: input.maxResultCount, |
||||
|
}, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getMemberList = (id: string, input: GetUserPagedRequest) => { |
||||
|
return defHttp.get<PagedResultDto<User>>({ |
||||
|
url: `/api/identity/organization-units/${id}/users`, |
||||
|
params: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getUnaddedRoleList = (input: { id: string } & GetRolePagedRequest) => { |
||||
|
return defHttp.get<PagedResultDto<Role>>({ |
||||
|
url: `/api/identity/organization-units/${input.id}/unadded-roles`, |
||||
|
params: { |
||||
|
filter: input.filter, |
||||
|
sorting: input.sorting, |
||||
|
skipCount: input.skipCount, |
||||
|
maxResultCount: input.maxResultCount, |
||||
|
}, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getRoleList = (id: string, input: GetRolePagedRequest) => { |
||||
|
return defHttp.get<PagedResultDto<Role>>({ |
||||
|
url: `/api/identity/organization-units/${id}/roles`, |
||||
|
params: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getAll = () => { |
||||
|
return defHttp.get<ListResultDto<OrganizationUnit>>({ |
||||
|
url: '/api/identity/organization-units/all', |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const move = (id: string, parentId?: string) => { |
||||
|
return defHttp.put<void>({ |
||||
|
url: `api/identity/organization-units/${id}/move`, |
||||
|
data: { |
||||
|
parentId: parentId, |
||||
|
}, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const addMembers = (id: string, userIdList: string[]) => { |
||||
|
return defHttp.post<void>({ |
||||
|
url: `/api/identity/organization-units/${id}/users`, |
||||
|
data: { userIds: userIdList }, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const addRoles = (id: string, roleIdList: string[]) => { |
||||
|
return defHttp.post<void>({ |
||||
|
url: `/api/identity/organization-units/${id}/roles`, |
||||
|
data: { roleIds: roleIdList }, |
||||
|
}); |
||||
|
}; |
||||
@ -0,0 +1,42 @@ |
|||||
|
/** 组织机构 */ |
||||
|
export interface OrganizationUnit extends AuditedEntityDto<string> { |
||||
|
/** 父节点标识 */ |
||||
|
parentId?: string; |
||||
|
/** 编号 */ |
||||
|
code: string; |
||||
|
/** 显示名称 */ |
||||
|
displayName: string; |
||||
|
} |
||||
|
|
||||
|
/** 组织机构分页查询对象 */ |
||||
|
export interface GetOrganizationUnitPagedRequest extends PagedAndSortedResultRequestDto { |
||||
|
/** 过滤字符 */ |
||||
|
filter?: string; |
||||
|
} |
||||
|
|
||||
|
/** 组织机构创建对象 */ |
||||
|
export interface CreateOrganizationUnit { |
||||
|
/** 显示名称 */ |
||||
|
displayName: string; |
||||
|
/** 父节点标识 */ |
||||
|
parentId?: string; |
||||
|
} |
||||
|
|
||||
|
/** 组织机构变更对象 */ |
||||
|
export interface UpdateOrganizationUnit { |
||||
|
/** 显示名称 */ |
||||
|
displayName: string; |
||||
|
} |
||||
|
|
||||
|
/** 组织机构增加部门对象 */ |
||||
|
export interface OrganizationUnitAddRole { |
||||
|
/** 角色标识列表 */ |
||||
|
roleIds: string[]; |
||||
|
} |
||||
|
|
||||
|
/** 组织机构增加用户对象 */ |
||||
|
export interface OrganizationUnitAddUser { |
||||
|
/** 用户标识列表 */ |
||||
|
userIds: string[]; |
||||
|
} |
||||
|
|
||||
@ -1,109 +0,0 @@ |
|||||
import { defAbpHttp } from '/@/utils/http/abp'; |
|
||||
import { |
|
||||
Role, |
|
||||
RoleListResult, |
|
||||
GetRolePagedRequest, |
|
||||
RolePagedResult, |
|
||||
UpdateRole, |
|
||||
CreateRole, |
|
||||
RoleClaimListResult, |
|
||||
RoleClaim, |
|
||||
} from './model/roleModel'; |
|
||||
import { format } from '/@/utils/strings'; |
|
||||
import { CreateIdentityClaim, UpdateIdentityClaim } from './model/claimModel'; |
|
||||
|
|
||||
enum Api { |
|
||||
RemoteService = 'AbpIdentity', |
|
||||
Controller = 'IdentityRole', |
|
||||
Create = '/api/identity/roles', |
|
||||
CreateClaim = '/api/identity/roles/{id}/claims', |
|
||||
DeleteClaim = '/api/identity/roles/{id}/claims', |
|
||||
Update = '/api/identity/roles/{id}', |
|
||||
UpdateClaim = '/api/identity/roles/{id}/claims', |
|
||||
GetById = '/api/identity/roles/{id}', |
|
||||
GetAllList = '/api/identity/roles/all', |
|
||||
GetClaimList = '/api/identity/roles/{id}/claims', |
|
||||
GetList = '/api/identity/roles', |
|
||||
GetActivedList = '/api/ApiGateway/RouteGroups/Actived', |
|
||||
RemoveOrganizationUnit = '/api/identity/roles/{id}/organization-units/{ouId}', |
|
||||
} |
|
||||
|
|
||||
export const create = (input: CreateRole) => { |
|
||||
return defAbpHttp.post<Role>({ |
|
||||
url: Api.Create, |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const createClaim = (id: string, input: CreateIdentityClaim) => { |
|
||||
return defAbpHttp.post<void>({ |
|
||||
url: format(Api.CreateClaim, { id: id }), |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const update = (id: string, input: UpdateRole) => { |
|
||||
return defAbpHttp.put<Role>({ |
|
||||
url: format(Api.Update, { id: id }), |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const updateClaim = (id: string, input: UpdateIdentityClaim) => { |
|
||||
return defAbpHttp.put<void>({ |
|
||||
url: format(Api.UpdateClaim, { id: id }), |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const deleteById = (id: string) => { |
|
||||
return defAbpHttp.delete<void>({ |
|
||||
url: format(Api.GetById, { id: id }), |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const deleteClaim = (id: string, input: RoleClaim) => { |
|
||||
return defAbpHttp.delete<void>( |
|
||||
{ |
|
||||
url: format(Api.DeleteClaim, { id: id }), |
|
||||
params: { |
|
||||
claimType: input.claimType, |
|
||||
claimValue: input.claimValue, |
|
||||
}, |
|
||||
}, |
|
||||
{ |
|
||||
joinParamsToUrl: true, |
|
||||
} |
|
||||
); |
|
||||
}; |
|
||||
|
|
||||
export const getById = (id: string) => { |
|
||||
return defAbpHttp.get<Role>({ |
|
||||
url: format(Api.GetById, { id: id }), |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getAllList = () => { |
|
||||
return defAbpHttp.get<RoleListResult>({ |
|
||||
url: Api.GetAllList, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getClaimList = (request: { id: string }) => { |
|
||||
return defAbpHttp.get<RoleClaimListResult>({ |
|
||||
url: format(Api.GetClaimList, { id: request.id }), |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getList = (input: GetRolePagedRequest) => { |
|
||||
return defAbpHttp.get<RolePagedResult>({ |
|
||||
url: Api.GetList, |
|
||||
params: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const removeOrganizationUnit = (id: string, ouId: string) => { |
|
||||
return defAbpHttp.delete<void>({ |
|
||||
url: format(Api.RemoveOrganizationUnit, { id: id, ouId: ouId }), |
|
||||
}); |
|
||||
}; |
|
||||
@ -0,0 +1,89 @@ |
|||||
|
import { defHttp } from '/@/utils/http/axios'; |
||||
|
import { |
||||
|
Role, |
||||
|
GetRolePagedRequest, |
||||
|
UpdateRole, |
||||
|
CreateRole, |
||||
|
RoleClaim, |
||||
|
} from './model'; |
||||
|
import { CreateIdentityClaim, UpdateIdentityClaim } from '../claims/model'; |
||||
|
|
||||
|
export const create = (input: CreateRole) => { |
||||
|
return defHttp.post<Role>({ |
||||
|
url: '/api/identity/roles', |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const createClaim = (id: string, input: CreateIdentityClaim) => { |
||||
|
return defHttp.post<void>({ |
||||
|
url: `/api/identity/roles/${id}/claims`, |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const update = (id: string, input: UpdateRole) => { |
||||
|
return defHttp.put<Role>({ |
||||
|
url: `/api/identity/roles/${id}`, |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const updateClaim = (id: string, input: UpdateIdentityClaim) => { |
||||
|
return defHttp.put<void>({ |
||||
|
url: `/api/identity/roles/${id}/claims`, |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const deleteById = (id: string) => { |
||||
|
return defHttp.delete<void>({ |
||||
|
url: `/api/identity/roles/${id}`, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const deleteClaim = (id: string, input: RoleClaim) => { |
||||
|
return defHttp.delete<void>( |
||||
|
{ |
||||
|
url: `/api/identity/roles/${id}/claims`, |
||||
|
params: { |
||||
|
claimType: input.claimType, |
||||
|
claimValue: input.claimValue, |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
joinParamsToUrl: true, |
||||
|
} |
||||
|
); |
||||
|
}; |
||||
|
|
||||
|
export const getById = (id: string) => { |
||||
|
return defHttp.get<Role>({ |
||||
|
url: `/api/identity/roles/${id}`, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getAllList = () => { |
||||
|
return defHttp.get<ListResultDto<Role>>({ |
||||
|
url: '/api/identity/roles/all', |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getClaimList = (input: { id: string }) => { |
||||
|
return defHttp.get<ListResultDto<RoleClaim>>({ |
||||
|
url: `/api/identity/roles/${input.id}/claims`, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getList = (input: GetRolePagedRequest) => { |
||||
|
return defHttp.get<PagedResultDto<Role>>({ |
||||
|
url: '/api/identity/roles', |
||||
|
params: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const removeOrganizationUnit = (id: string, ouId: string) => { |
||||
|
return defHttp.delete<void>({ |
||||
|
url: `/api/identity/roles/${id}/organization-units/${ouId}`, |
||||
|
}); |
||||
|
}; |
||||
@ -1,40 +0,0 @@ |
|||||
import { defAbpHttp } from '/@/utils/http/abp'; |
|
||||
import { SecurityLog, GetSecurityLogPagedRequest } from './model/securityLogModel'; |
|
||||
|
|
||||
enum Api { |
|
||||
RemoteService = 'AbpAuditing', |
|
||||
Controller = 'SecurityLog', |
|
||||
} |
|
||||
|
|
||||
export const deleteById = (id: string) => { |
|
||||
return defAbpHttp.pagedRequest<SecurityLog>({ |
|
||||
service: Api.RemoteService, |
|
||||
controller: Api.Controller, |
|
||||
action: 'DeleteAsync', |
|
||||
params: { |
|
||||
id: id, |
|
||||
}, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getById = (id: string) => { |
|
||||
return defAbpHttp.pagedRequest<SecurityLog>({ |
|
||||
service: Api.RemoteService, |
|
||||
controller: Api.Controller, |
|
||||
action: 'GetAsync', |
|
||||
params: { |
|
||||
id: id, |
|
||||
}, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getList = (input: GetSecurityLogPagedRequest) => { |
|
||||
return defAbpHttp.pagedRequest<SecurityLog>({ |
|
||||
service: Api.RemoteService, |
|
||||
controller: Api.Controller, |
|
||||
action: 'GetListAsync', |
|
||||
params: { |
|
||||
input: input, |
|
||||
}, |
|
||||
}); |
|
||||
}; |
|
||||
@ -1,141 +0,0 @@ |
|||||
import { defAbpHttp } from '/@/utils/http/abp'; |
|
||||
import { |
|
||||
User, |
|
||||
UserClaimListResult, |
|
||||
CreateUser, |
|
||||
SetPassword, |
|
||||
UpdateUser, |
|
||||
GetUserPagedRequest, |
|
||||
UserPagedResult, |
|
||||
UserClaim, |
|
||||
} from './model/userModel'; |
|
||||
import { RoleListResult } from './model/roleModel'; |
|
||||
import { format } from '/@/utils/strings'; |
|
||||
import { CreateIdentityClaim, UpdateIdentityClaim } from './model/claimModel'; |
|
||||
|
|
||||
enum Api { |
|
||||
Create = '/api/identity/users', |
|
||||
CreateClaim = '/api/identity/users/{id}/claims', |
|
||||
DeleteClaim = '/api/identity/users/{id}/claims', |
|
||||
ChangePassword = '/api/identity/users/change-password', |
|
||||
Delete = '/api/identity/users/{id}', |
|
||||
GetById = '/api/identity/users/{id}', |
|
||||
GetList = '/api/identity/users', |
|
||||
GetClaimList = '/api/identity/users/{id}/claims', |
|
||||
GetRoleList = '/api/identity/users/{id}/roles', |
|
||||
GetActivedList = '/api/ApiGateway/RouteGroups/Actived', |
|
||||
GetAssignableRoles = '/api/identity/users/assignable-roles', |
|
||||
Update = '/api/identity/users/{id}', |
|
||||
UpdateClaim = '/api/identity/users/{id}/claims', |
|
||||
Lock = '/api/identity/users/{id}/lock/{seconds}', |
|
||||
UnLock = '/api/identity/users/{id}/unlock', |
|
||||
RemoveOrganizationUnit = '/api/identity/users/{id}/organization-units/{ouId}', |
|
||||
} |
|
||||
|
|
||||
export const create = (input: CreateUser) => { |
|
||||
return defAbpHttp.post<User>({ |
|
||||
url: Api.Create, |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const createClaim = (id: string, input: CreateIdentityClaim) => { |
|
||||
return defAbpHttp.post<void>({ |
|
||||
url: format(Api.CreateClaim, { id: id }), |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const changePassword = (id: string, input: SetPassword) => { |
|
||||
return defAbpHttp.put<void>({ |
|
||||
url: Api.ChangePassword, |
|
||||
data: input, |
|
||||
params: { |
|
||||
id: id, |
|
||||
}, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const deleteById = (id: string) => { |
|
||||
return defAbpHttp.delete<void>({ |
|
||||
url: format(Api.Delete, { id: id }), |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const deleteClaim = (id: string, input: UserClaim) => { |
|
||||
return defAbpHttp.delete<void>( |
|
||||
{ |
|
||||
url: format(Api.DeleteClaim, { id: id }), |
|
||||
params: { |
|
||||
claimType: input.claimType, |
|
||||
claimValue: input.claimValue, |
|
||||
}, |
|
||||
}, |
|
||||
{ |
|
||||
joinParamsToUrl: true, |
|
||||
} |
|
||||
); |
|
||||
}; |
|
||||
|
|
||||
export const getById = (id: string) => { |
|
||||
return defAbpHttp.get<User>({ |
|
||||
url: format(Api.GetById, { id: id }), |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getAssignableRoles = () => { |
|
||||
return defAbpHttp.get<RoleListResult>({ |
|
||||
url: Api.GetAssignableRoles, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getRoleList = (id: string) => { |
|
||||
return defAbpHttp.get<RoleListResult>({ |
|
||||
url: format(Api.GetRoleList, { id: id }), |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getClaimList = (request: { id: string }) => { |
|
||||
return defAbpHttp.get<UserClaimListResult>({ |
|
||||
url: format(Api.GetClaimList, { id: request.id }), |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getList = (input: GetUserPagedRequest) => { |
|
||||
return defAbpHttp.get<UserPagedResult>({ |
|
||||
url: Api.GetList, |
|
||||
params: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const update = (id: string, input: UpdateUser) => { |
|
||||
return defAbpHttp.put<User>({ |
|
||||
url: format(Api.Update, { id: id }), |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const updateClaim = (id: string, input: UpdateIdentityClaim) => { |
|
||||
return defAbpHttp.put<void>({ |
|
||||
url: format(Api.CreateClaim, { id: id }), |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const lock = (id: string, seconds: number) => { |
|
||||
return defAbpHttp.put<void>({ |
|
||||
url: format(Api.Lock, { id: id, seconds: seconds }), |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const unlock = (id: string) => { |
|
||||
return defAbpHttp.put<void>({ |
|
||||
url: format(Api.UnLock, { id: id }), |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const removeOrganizationUnit = (id: string, ouId: string) => { |
|
||||
return defAbpHttp.delete<void>({ |
|
||||
url: format(Api.RemoveOrganizationUnit, { id: id, ouId: ouId }), |
|
||||
}); |
|
||||
}; |
|
||||
@ -1,41 +0,0 @@ |
|||||
import { defAbpHttp } from '/@/utils/http/abp'; |
|
||||
import { |
|
||||
IUserData, |
|
||||
UserLookupSearchRequest, |
|
||||
UserLookupSearchResult, |
|
||||
UserLookupCountRequest, |
|
||||
} from './model/userLookupModel'; |
|
||||
import { format } from '/@/utils/strings'; |
|
||||
|
|
||||
enum Api { |
|
||||
Search = '/api/identity/users/lookup/search', |
|
||||
GetCount = '/api/identity/users/lookup/count', |
|
||||
FindById = '/api/identity/users/lookup/{id}', |
|
||||
FindByUserName = '/api/identity/users/lookup/by-username/{userName}', |
|
||||
} |
|
||||
|
|
||||
export const findById = (id: string) => { |
|
||||
return defAbpHttp.get<IUserData>({ |
|
||||
url: format(Api.FindById, { id: id }), |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const findByUserName = (userName: string) => { |
|
||||
return defAbpHttp.get<IUserData>({ |
|
||||
url: format(Api.FindByUserName, { userName: userName }), |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const search = (input: UserLookupSearchRequest) => { |
|
||||
return defAbpHttp.get<UserLookupSearchResult>({ |
|
||||
url: Api.Search, |
|
||||
params: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getCount = (input: UserLookupCountRequest) => { |
|
||||
return defAbpHttp.get<number>({ |
|
||||
url: Api.GetCount, |
|
||||
params: input, |
|
||||
}); |
|
||||
}; |
|
||||
@ -0,0 +1,32 @@ |
|||||
|
import { defHttp } from '/@/utils/http/axios'; |
||||
|
import { |
||||
|
IUserData, |
||||
|
UserLookupSearchRequest, |
||||
|
UserLookupCountRequest, |
||||
|
} from './model'; |
||||
|
|
||||
|
export const findById = (id: string) => { |
||||
|
return defHttp.get<IUserData>({ |
||||
|
url: `/api/identity/users/lookup/${id}`, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const findByUserName = (userName: string) => { |
||||
|
return defHttp.get<IUserData>({ |
||||
|
url: `/api/identity/users/lookup/by-username/${userName}`, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const search = (input: UserLookupSearchRequest) => { |
||||
|
return defHttp.get<ListResultDto<IUserData>>({ |
||||
|
url: '/api/identity/users/lookup/search', |
||||
|
params: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getCount = (input: UserLookupCountRequest) => { |
||||
|
return defHttp.get<number>({ |
||||
|
url: '/api/identity/users/lookup/count', |
||||
|
params: input, |
||||
|
}); |
||||
|
}; |
||||
@ -0,0 +1,21 @@ |
|||||
|
export interface IUserData { |
||||
|
id: string; |
||||
|
tenantId?: string; |
||||
|
userName: string; |
||||
|
name: string; |
||||
|
surname: string; |
||||
|
email: string; |
||||
|
emailConfirmed: boolean; |
||||
|
phoneNumber: string; |
||||
|
phoneNumberConfirmed: boolean; |
||||
|
} |
||||
|
|
||||
|
export interface UserLookupSearchRequest extends PagedAndSortedResultRequestDto { |
||||
|
filter?: string; |
||||
|
} |
||||
|
|
||||
|
export interface UserLookupCountRequest extends PagedAndSortedResultRequestDto { |
||||
|
filter?: string; |
||||
|
} |
||||
|
|
||||
|
|
||||
@ -0,0 +1,113 @@ |
|||||
|
import { defHttp } from '/@/utils/http/axios'; |
||||
|
import { |
||||
|
User, |
||||
|
CreateUser, |
||||
|
SetPassword, |
||||
|
UpdateUser, |
||||
|
GetUserPagedRequest, |
||||
|
UserClaim, |
||||
|
} from './model'; |
||||
|
import { CreateIdentityClaim, UpdateIdentityClaim } from '../claims/model'; |
||||
|
import { Role } from '../roles/model'; |
||||
|
|
||||
|
export const create = (input: CreateUser) => { |
||||
|
return defHttp.post<User>({ |
||||
|
url: '/api/identity/users', |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const createClaim = (id: string, input: CreateIdentityClaim) => { |
||||
|
return defHttp.post<void>({ |
||||
|
url: `/api/identity/users/${id}/claims`, |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const changePassword = (id: string, input: SetPassword) => { |
||||
|
return defHttp.put<void>({ |
||||
|
url: `/api/identity/users/change-password?id=${id}`, |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const deleteById = (id: string) => { |
||||
|
return defHttp.delete<void>({ |
||||
|
url: `/api/identity/users/${id}`, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const deleteClaim = (id: string, input: UserClaim) => { |
||||
|
return defHttp.delete<void>({ |
||||
|
url: `/api/identity/users/${id}/claims`, |
||||
|
params: { |
||||
|
claimType: input.claimType, |
||||
|
claimValue: input.claimValue, |
||||
|
}, |
||||
|
},{ |
||||
|
joinParamsToUrl: true, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getById = (id: string) => { |
||||
|
return defHttp.get<User>({ |
||||
|
url: `/api/identity/users/${id}`, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getAssignableRoles = () => { |
||||
|
return defHttp.get<ListResultDto<Role>>({ |
||||
|
url: '/api/identity/users/assignable-roles', |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getRoleList = (id: string) => { |
||||
|
return defHttp.get<ListResultDto<Role>>({ |
||||
|
url: `/api/identity/users/${id}/roles`, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getClaimList = (input: { id: string }) => { |
||||
|
return defHttp.get<ListResultDto<UserClaim>>({ |
||||
|
url: `/api/identity/users/${input.id}/claims`, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getList = (input: GetUserPagedRequest) => { |
||||
|
return defHttp.get<PagedResultDto<User>>({ |
||||
|
url: '/api/identity/users', |
||||
|
params: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const update = (id: string, input: UpdateUser) => { |
||||
|
return defHttp.put<User>({ |
||||
|
url: `/api/identity/users/${id}`, |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const updateClaim = (id: string, input: UpdateIdentityClaim) => { |
||||
|
return defHttp.put<void>({ |
||||
|
url: `/api/identity/users/${id}/claims`, |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const lock = (id: string, seconds: number) => { |
||||
|
return defHttp.put<void>({ |
||||
|
url: `/api/identity/users/${id}/lock/${seconds}`, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const unlock = (id: string) => { |
||||
|
return defHttp.put<void>({ |
||||
|
url: `/api/identity/users/${id}/unlock`, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const removeOrganizationUnit = (id: string, ouId: string) => { |
||||
|
return defHttp.delete<void>({ |
||||
|
url: `/api/identity/users/${id}/organization-units/${ouId}`, |
||||
|
}); |
||||
|
}; |
||||
@ -1,63 +0,0 @@ |
|||||
import { defAbpHttp } from '/@/utils/http/abp'; |
|
||||
import { LanguageListResult, LanguageCreate, LanguageUpdate, Language, GetLanguageWithFilter } from './model/languagesModel'; |
|
||||
|
|
||||
const remoteServiceName = 'LocalizationManagement'; |
|
||||
const controllerName = 'Language'; |
|
||||
|
|
||||
enum Api { |
|
||||
GetList = '/api/abp/localization/languages', |
|
||||
} |
|
||||
|
|
||||
export const getList = (input: GetLanguageWithFilter) => { |
|
||||
return defAbpHttp.get<LanguageListResult>({ |
|
||||
url: Api.GetList, |
|
||||
params: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const GetAsyncByName = (name: string) => { |
|
||||
return defAbpHttp.request<Language>({ |
|
||||
service: remoteServiceName, |
|
||||
controller: controllerName, |
|
||||
action: 'GetByNameAsync', |
|
||||
uniqueName: 'GetByNameAsyncByName', |
|
||||
params: { |
|
||||
name: name, |
|
||||
}, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const CreateAsyncByInput = (input: LanguageCreate) => { |
|
||||
return defAbpHttp.request<Language>({ |
|
||||
service: remoteServiceName, |
|
||||
controller: controllerName, |
|
||||
action: 'CreateAsync', |
|
||||
uniqueName: 'CreateAsyncByInput', |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const UpdateAsyncByNameAndInput = (name: string, input: LanguageUpdate) => { |
|
||||
return defAbpHttp.request<Language>({ |
|
||||
service: remoteServiceName, |
|
||||
controller: controllerName, |
|
||||
action: 'UpdateAsync', |
|
||||
uniqueName: 'UpdateAsyncByNameAndInput', |
|
||||
params: { |
|
||||
name: name, |
|
||||
}, |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const DeleteAsyncByName = (name: string) => { |
|
||||
return defAbpHttp.request<void>({ |
|
||||
service: remoteServiceName, |
|
||||
controller: controllerName, |
|
||||
action: 'DeleteAsync', |
|
||||
uniqueName: 'DeleteAsyncByName', |
|
||||
params: { |
|
||||
name: name, |
|
||||
}, |
|
||||
}); |
|
||||
}; |
|
||||
@ -0,0 +1,35 @@ |
|||||
|
import { defHttp } from '/@/utils/http/axios'; |
||||
|
import { LanguageCreate, LanguageUpdate, Language, GetLanguageWithFilter } from './model'; |
||||
|
|
||||
|
export const getList = (input: GetLanguageWithFilter) => { |
||||
|
return defHttp.get<ListResultDto<Language>>({ |
||||
|
url: '/api/abp/localization/languages', |
||||
|
params: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getByName = (name: string) => { |
||||
|
return defHttp.get<Language>({ |
||||
|
url: `/api/localization/languages/${name}`, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const create = (input: LanguageCreate) => { |
||||
|
return defHttp.post<Language>({ |
||||
|
url: '/api/abp/localization/languages', |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const update = (name: string, input: LanguageUpdate) => { |
||||
|
return defHttp.put<Language>({ |
||||
|
url: `/api/localization/languages/${name}`, |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const deleteByName = (name: string) => { |
||||
|
return defHttp.delete<void>({ |
||||
|
url: `/api/localization/languages/${name}`, |
||||
|
}); |
||||
|
}; |
||||
@ -0,0 +1,29 @@ |
|||||
|
export interface Language extends AuditedEntityDto<string> { |
||||
|
enable: boolean; |
||||
|
cultureName: string; |
||||
|
uiCultureName: string; |
||||
|
displayName: string; |
||||
|
flagIcon: string; |
||||
|
} |
||||
|
|
||||
|
export interface LanguageCreateOrUpdate { |
||||
|
enable: boolean; |
||||
|
displayName: string; |
||||
|
flagIcon: string; |
||||
|
} |
||||
|
|
||||
|
export interface LanguageCreate extends LanguageCreateOrUpdate { |
||||
|
cultureName: string; |
||||
|
uiCultureName: string; |
||||
|
} |
||||
|
|
||||
|
export interface LanguageUpdate extends LanguageCreateOrUpdate {} |
||||
|
|
||||
|
export interface GetLanguagePagedRequest extends PagedAndSortedResultRequestDto { |
||||
|
filter?: string; |
||||
|
} |
||||
|
|
||||
|
export interface GetLanguageWithFilter { |
||||
|
filter?: string; |
||||
|
} |
||||
|
|
||||
@ -1,32 +0,0 @@ |
|||||
export interface Language extends AuditedEntityDto<string> { |
|
||||
enable: boolean; |
|
||||
cultureName: string; |
|
||||
uiCultureName: string; |
|
||||
displayName: string; |
|
||||
flagIcon: string; |
|
||||
} |
|
||||
|
|
||||
export interface LanguageCreateOrUpdate { |
|
||||
enable: boolean; |
|
||||
displayName: string; |
|
||||
flagIcon: string; |
|
||||
} |
|
||||
|
|
||||
export interface LanguageCreate extends LanguageCreateOrUpdate { |
|
||||
cultureName: string; |
|
||||
uiCultureName: string; |
|
||||
} |
|
||||
|
|
||||
export interface LanguageUpdate extends LanguageCreateOrUpdate {} |
|
||||
|
|
||||
export interface LanguageListResult extends ListResultDto<Language> {} |
|
||||
|
|
||||
export interface LanguagePagedResult extends PagedResultDto<Language> {} |
|
||||
|
|
||||
export interface GetLanguagePagedRequest extends PagedAndSortedResultRequestDto { |
|
||||
filter?: string; |
|
||||
} |
|
||||
|
|
||||
export interface GetLanguageWithFilter { |
|
||||
filter?: string; |
|
||||
} |
|
||||
@ -1,32 +0,0 @@ |
|||||
export interface Resource { |
|
||||
id: string; |
|
||||
name: string; |
|
||||
displayName: string; |
|
||||
description: string; |
|
||||
} |
|
||||
|
|
||||
export interface ResourceCreateOrUpdate { |
|
||||
enable: boolean; |
|
||||
displayName: string; |
|
||||
description?: string; |
|
||||
defaultCultureName?: string; |
|
||||
} |
|
||||
|
|
||||
export interface ResourceCreate extends ResourceCreateOrUpdate { |
|
||||
name: string; |
|
||||
} |
|
||||
|
|
||||
export interface ResourceUpdate extends ResourceCreateOrUpdate {} |
|
||||
|
|
||||
|
|
||||
export interface ResourceListResult extends ListResultDto<Resource> {} |
|
||||
|
|
||||
export interface ResourcePagedResult extends PagedResultDto<Resource> {} |
|
||||
|
|
||||
export interface GetResourcePagedRequest extends PagedAndSortedResultRequestDto { |
|
||||
filter?: string; |
|
||||
} |
|
||||
|
|
||||
export interface GetResourceWithFilter { |
|
||||
filter?: string; |
|
||||
} |
|
||||
@ -1,38 +0,0 @@ |
|||||
export interface Text { |
|
||||
key: string; |
|
||||
value: string; |
|
||||
cultureName: string; |
|
||||
resourceName: string; |
|
||||
} |
|
||||
|
|
||||
export interface TextDifference { |
|
||||
key: string; |
|
||||
value: string; |
|
||||
cultureName: string; |
|
||||
resourceName: string; |
|
||||
targetCultureName: string; |
|
||||
targetValue: string; |
|
||||
} |
|
||||
|
|
||||
export interface SetTextInput { |
|
||||
key: string; |
|
||||
value: string; |
|
||||
cultureName: string; |
|
||||
resourceName: string; |
|
||||
} |
|
||||
|
|
||||
export interface TextListResult extends ListResultDto<TextDifference> {} |
|
||||
|
|
||||
export interface GetTextByKey { |
|
||||
key: string; |
|
||||
cultureName: string; |
|
||||
resourceName: string; |
|
||||
} |
|
||||
|
|
||||
export class GetTextRequest { |
|
||||
filter = ''; |
|
||||
cultureName = ''; |
|
||||
targetCultureName = ''; |
|
||||
resourceName = ''; |
|
||||
onlyNull = false; |
|
||||
} |
|
||||
@ -1,63 +0,0 @@ |
|||||
import { defAbpHttp } from '/@/utils/http/abp'; |
|
||||
import { ResourceListResult, Resource, ResourceCreate, ResourceUpdate, GetResourceWithFilter } from './model/resourcesModel'; |
|
||||
|
|
||||
const remoteServiceName = 'LocalizationManagement'; |
|
||||
const controllerName = 'Resource'; |
|
||||
|
|
||||
enum Api { |
|
||||
GetList = '/api/abp/localization/resources', |
|
||||
} |
|
||||
|
|
||||
export const getList = (input: GetResourceWithFilter) => { |
|
||||
return defAbpHttp.get<ResourceListResult>({ |
|
||||
url: Api.GetList, |
|
||||
params: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const GetAsyncByName = (name: string) => { |
|
||||
return defAbpHttp.request<Resource>({ |
|
||||
service: remoteServiceName, |
|
||||
controller: controllerName, |
|
||||
action: 'GetAsync', |
|
||||
uniqueName: 'GetAsyncByName', |
|
||||
params: { |
|
||||
name: name, |
|
||||
}, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const CreateAsyncByInput = (input: ResourceCreate) => { |
|
||||
return defAbpHttp.request<Resource>({ |
|
||||
service: remoteServiceName, |
|
||||
controller: controllerName, |
|
||||
action: 'CreateAsync', |
|
||||
uniqueName: 'CreateAsyncByInput', |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const UpdateAsyncByNameAndInput = (name: string, input: ResourceUpdate) => { |
|
||||
return defAbpHttp.request<Resource>({ |
|
||||
service: remoteServiceName, |
|
||||
controller: controllerName, |
|
||||
action: 'UpdateAsync', |
|
||||
uniqueName: 'UpdateAsyncByNameAndInput', |
|
||||
params: { |
|
||||
name: name, |
|
||||
}, |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const DeleteAsyncByName = (name: string) => { |
|
||||
return defAbpHttp.request<void>({ |
|
||||
service: remoteServiceName, |
|
||||
controller: controllerName, |
|
||||
action: 'DeleteAsync', |
|
||||
uniqueName: 'DeleteAsyncByName', |
|
||||
params: { |
|
||||
name: name, |
|
||||
}, |
|
||||
}); |
|
||||
}; |
|
||||
@ -0,0 +1,35 @@ |
|||||
|
import { defHttp } from '/@/utils/http/axios'; |
||||
|
import { Resource, ResourceCreate, ResourceUpdate, GetResourceWithFilter } from './model'; |
||||
|
|
||||
|
export const getList = (input: GetResourceWithFilter) => { |
||||
|
return defHttp.get<ListResultDto<Resource>>({ |
||||
|
url: '/api/abp/localization/resources', |
||||
|
params: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getByName = (name: string) => { |
||||
|
return defHttp.get<Resource>({ |
||||
|
url: `/api/localization/resources/${name}` |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const create = (input: ResourceCreate) => { |
||||
|
return defHttp.post<Resource>({ |
||||
|
url: '/api/localization/resources', |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const update = (name: string, input: ResourceUpdate) => { |
||||
|
return defHttp.put<Resource>({ |
||||
|
url: `/api/localization/resources/${name}`, |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const deleteByName = (name: string) => { |
||||
|
return defHttp.request<void>({ |
||||
|
url: `/api/localization/resources/${name}`, |
||||
|
}); |
||||
|
}; |
||||
@ -0,0 +1,27 @@ |
|||||
|
export interface Resource { |
||||
|
id: string; |
||||
|
name: string; |
||||
|
displayName: string; |
||||
|
description: string; |
||||
|
} |
||||
|
|
||||
|
export interface ResourceCreateOrUpdate { |
||||
|
enable: boolean; |
||||
|
displayName: string; |
||||
|
description?: string; |
||||
|
defaultCultureName?: string; |
||||
|
} |
||||
|
|
||||
|
export interface ResourceCreate extends ResourceCreateOrUpdate { |
||||
|
name: string; |
||||
|
} |
||||
|
|
||||
|
export interface ResourceUpdate extends ResourceCreateOrUpdate {} |
||||
|
|
||||
|
export interface GetResourcePagedRequest extends PagedAndSortedResultRequestDto { |
||||
|
filter?: string; |
||||
|
} |
||||
|
|
||||
|
export interface GetResourceWithFilter { |
||||
|
filter?: string; |
||||
|
} |
||||
@ -1,35 +0,0 @@ |
|||||
import { defAbpHttp } from '/@/utils/http/abp'; |
|
||||
import { |
|
||||
Text, |
|
||||
SetTextInput, |
|
||||
GetTextByKey, |
|
||||
GetTextRequest, |
|
||||
TextListResult, |
|
||||
} from './model/textsModel'; |
|
||||
|
|
||||
enum Api { |
|
||||
SetText = '/api/localization/texts', |
|
||||
GetList = '/api/abp/localization/texts', |
|
||||
GetByCulture = '/api/abp/localization/texts/by-culture-key', |
|
||||
} |
|
||||
|
|
||||
export const getByCulture = (input: GetTextByKey) => { |
|
||||
return defAbpHttp.get<Text>({ |
|
||||
url: Api.GetByCulture, |
|
||||
params: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const setText = (input: SetTextInput) => { |
|
||||
return defAbpHttp.put<Text>({ |
|
||||
url: Api.SetText, |
|
||||
data: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getList = (input: GetTextRequest) => { |
|
||||
return defAbpHttp.get<TextListResult>({ |
|
||||
url: Api.GetList, |
|
||||
params: input, |
|
||||
}); |
|
||||
}; |
|
||||
@ -0,0 +1,23 @@ |
|||||
|
import { defHttp } from '/@/utils/http/axios'; |
||||
|
import { Text, SetTextInput, GetTextByKey, GetTextRequest } from './model'; |
||||
|
|
||||
|
export const getByCulture = (input: GetTextByKey) => { |
||||
|
return defHttp.get<Text>({ |
||||
|
url: '/api/abp/localization/texts/by-culture-key', |
||||
|
params: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const setText = (input: SetTextInput) => { |
||||
|
return defHttp.put<Text>({ |
||||
|
url: '/api/localization/texts', |
||||
|
data: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getList = (input: GetTextRequest) => { |
||||
|
return defHttp.get<ListResultDto<Text>>({ |
||||
|
url: '/api/abp/localization/texts', |
||||
|
params: input, |
||||
|
}); |
||||
|
}; |
||||
@ -0,0 +1,37 @@ |
|||||
|
export interface Text { |
||||
|
key: string; |
||||
|
value: string; |
||||
|
cultureName: string; |
||||
|
resourceName: string; |
||||
|
} |
||||
|
|
||||
|
export interface TextDifference { |
||||
|
key: string; |
||||
|
value: string; |
||||
|
cultureName: string; |
||||
|
resourceName: string; |
||||
|
targetCultureName: string; |
||||
|
targetValue: string; |
||||
|
} |
||||
|
|
||||
|
export interface SetTextInput { |
||||
|
key: string; |
||||
|
value: string; |
||||
|
cultureName: string; |
||||
|
resourceName: string; |
||||
|
} |
||||
|
|
||||
|
export interface GetTextByKey { |
||||
|
key: string; |
||||
|
cultureName: string; |
||||
|
resourceName: string; |
||||
|
} |
||||
|
|
||||
|
export class GetTextRequest { |
||||
|
filter = ''; |
||||
|
cultureName = ''; |
||||
|
targetCultureName = ''; |
||||
|
resourceName = ''; |
||||
|
onlyNull = false; |
||||
|
} |
||||
|
|
||||
@ -1,21 +0,0 @@ |
|||||
import { defAbpHttp } from '/@/utils/http/abp'; |
|
||||
import { Log, GetLogPagedRequest, LogPagedResult } from './model/loggingModel'; |
|
||||
import { format } from '/@/utils/strings'; |
|
||||
|
|
||||
enum Api { |
|
||||
GetById = '/api/auditing/logging/{id}', |
|
||||
GetList = '/api/auditing/logging', |
|
||||
} |
|
||||
|
|
||||
export const get = (id: string) => { |
|
||||
return defAbpHttp.get<Log>({ |
|
||||
url: format(Api.GetById, { id: id }), |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getList = (input: GetLogPagedRequest) => { |
|
||||
return defAbpHttp.get<LogPagedResult>({ |
|
||||
url: Api.GetList, |
|
||||
params: input, |
|
||||
}); |
|
||||
}; |
|
||||
@ -0,0 +1,15 @@ |
|||||
|
import { defAbpHttp } from '/@/utils/http/abp'; |
||||
|
import { Log, GetLogPagedRequest } from './model'; |
||||
|
|
||||
|
export const get = (id: string) => { |
||||
|
return defAbpHttp.get<Log>({ |
||||
|
url: `/api/auditing/logging/${id}`, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getList = (input: GetLogPagedRequest) => { |
||||
|
return defAbpHttp.get<PagedResultDto<Log>>({ |
||||
|
url: '/api/auditing/logging', |
||||
|
params: input, |
||||
|
}); |
||||
|
}; |
||||
@ -0,0 +1,60 @@ |
|||||
|
export interface LogException { |
||||
|
depth: number; |
||||
|
class: string; |
||||
|
message: string; |
||||
|
source: string; |
||||
|
stackTrace: string; |
||||
|
hResult: number; |
||||
|
helpURL: string; |
||||
|
} |
||||
|
|
||||
|
export interface LogField { |
||||
|
id: string; |
||||
|
machineName: string; |
||||
|
environment: string; |
||||
|
application: string; |
||||
|
context: string; |
||||
|
actionId: string; |
||||
|
actionName: string; |
||||
|
requestId: string; |
||||
|
requestPath: string; |
||||
|
connectionId: string; |
||||
|
correlationId: string; |
||||
|
clientId: string; |
||||
|
userId: string; |
||||
|
processId: number; |
||||
|
threadId: number; |
||||
|
} |
||||
|
|
||||
|
export enum LogLevel { |
||||
|
Trace, |
||||
|
Debug, |
||||
|
Information, |
||||
|
Warning, |
||||
|
Error, |
||||
|
Critical, |
||||
|
None, |
||||
|
} |
||||
|
|
||||
|
export interface Log { |
||||
|
timeStamp: Date; |
||||
|
level: LogLevel; |
||||
|
message: string; |
||||
|
fields: LogField; |
||||
|
exceptions: LogException[]; |
||||
|
} |
||||
|
|
||||
|
export interface GetLogPagedRequest extends PagedAndSortedResultRequestDto { |
||||
|
startTime?: Date; |
||||
|
endTime?: Date; |
||||
|
machineName?: string; |
||||
|
environment?: string; |
||||
|
application?: string; |
||||
|
context?: string; |
||||
|
requestId?: string; |
||||
|
requestPath?: string; |
||||
|
correlationId?: string; |
||||
|
processId?: number; |
||||
|
threadId?: number; |
||||
|
hasException?: boolean; |
||||
|
} |
||||
@ -1,62 +0,0 @@ |
|||||
export interface LogException { |
|
||||
depth: number; |
|
||||
class: string; |
|
||||
message: string; |
|
||||
source: string; |
|
||||
stackTrace: string; |
|
||||
hResult: number; |
|
||||
helpURL: string; |
|
||||
} |
|
||||
|
|
||||
export interface LogField { |
|
||||
id: string; |
|
||||
machineName: string; |
|
||||
environment: string; |
|
||||
application: string; |
|
||||
context: string; |
|
||||
actionId: string; |
|
||||
actionName: string; |
|
||||
requestId: string; |
|
||||
requestPath: string; |
|
||||
connectionId: string; |
|
||||
correlationId: string; |
|
||||
clientId: string; |
|
||||
userId: string; |
|
||||
processId: number; |
|
||||
threadId: number; |
|
||||
} |
|
||||
|
|
||||
export enum LogLevel { |
|
||||
Trace, |
|
||||
Debug, |
|
||||
Information, |
|
||||
Warning, |
|
||||
Error, |
|
||||
Critical, |
|
||||
None, |
|
||||
} |
|
||||
|
|
||||
export interface Log { |
|
||||
timeStamp: Date; |
|
||||
level: LogLevel; |
|
||||
message: string; |
|
||||
fields: LogField; |
|
||||
exceptions: LogException[]; |
|
||||
} |
|
||||
|
|
||||
export interface GetLogPagedRequest extends PagedAndSortedResultRequestDto { |
|
||||
startTime?: Date; |
|
||||
endTime?: Date; |
|
||||
machineName?: string; |
|
||||
environment?: string; |
|
||||
application?: string; |
|
||||
context?: string; |
|
||||
requestId?: string; |
|
||||
requestPath?: string; |
|
||||
correlationId?: string; |
|
||||
processId?: number; |
|
||||
threadId?: number; |
|
||||
hasException?: boolean; |
|
||||
} |
|
||||
|
|
||||
export interface LogPagedResult extends PagedResultDto<Log> {} |
|
||||
@ -1,53 +1,42 @@ |
|||||
import { defHttp } from '/@/utils/http/axios'; |
import { defHttp } from '/@/utils/http/axios'; |
||||
import { |
import { |
||||
UserFriend, |
UserFriend, |
||||
UserFriendListResult, |
|
||||
UserFriendPagedResult, |
|
||||
FriendCreateRequest, |
FriendCreateRequest, |
||||
FriendAddRequest, |
FriendAddRequest, |
||||
GetMyFriendsRequest, |
GetMyFriendsRequest, |
||||
GetMyFriendsPagedRequest, |
GetMyFriendsPagedRequest, |
||||
} from './model/friendsModel'; |
} from './model'; |
||||
import { format } from '/@/utils/strings'; |
|
||||
|
|
||||
enum Api { |
|
||||
Create = 'api/im/my-friends', |
|
||||
AddFriend = '/api/im/my-friends/add-request', |
|
||||
GetList = '/api/im/my-friends', |
|
||||
GetAll = '/api/im/my-friends/all', |
|
||||
GetByFriendId = '/api/im/my-friends/{friendId}', |
|
||||
} |
|
||||
|
|
||||
export const create = (input: FriendCreateRequest) => { |
export const create = (input: FriendCreateRequest) => { |
||||
return defHttp.post<void>({ |
return defHttp.post<void>({ |
||||
url: Api.Create, |
url: 'api/im/my-friends', |
||||
data: input, |
data: input, |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
export const addFriend = (input: FriendAddRequest) => { |
export const addFriend = (input: FriendAddRequest) => { |
||||
return defHttp.post<void>({ |
return defHttp.post<void>({ |
||||
url: Api.AddFriend, |
url: '/api/im/my-friends/add-request', |
||||
data: input, |
data: input, |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
export const getByFriendId = (friendId: string) => { |
export const getByFriendId = (friendId: string) => { |
||||
return defHttp.get<UserFriend>({ |
return defHttp.get<UserFriend>({ |
||||
url: format(Api.GetByFriendId, { friendId: friendId }), |
url: `/api/im/my-friends/${friendId}`, |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
export const getList = (input: GetMyFriendsPagedRequest) => { |
export const getList = (input: GetMyFriendsPagedRequest) => { |
||||
return defHttp.get<UserFriendPagedResult>({ |
return defHttp.get<PagedResultDto<UserFriend>>({ |
||||
url: Api.GetList, |
url: '/api/im/my-friends', |
||||
params: input, |
params: input, |
||||
}); |
}); |
||||
}; |
}; |
||||
|
|
||||
export const getAll = (input: GetMyFriendsRequest) => { |
export const getAll = (input: GetMyFriendsRequest) => { |
||||
return defHttp.get<UserFriendListResult>({ |
return defHttp.get<ListResultDto<UserFriend>>({ |
||||
url: Api.GetAll, |
url: '/api/im/my-friends/all', |
||||
params: input, |
params: input, |
||||
}); |
}); |
||||
}; |
}; |
||||
@ -1,21 +0,0 @@ |
|||||
import { defHttp } from '/@/utils/http/axios'; |
|
||||
import { Group, GroupPagedResult, GroupSearchRequest } from './model/groupModel'; |
|
||||
import { format } from '/@/utils/strings'; |
|
||||
|
|
||||
enum Api { |
|
||||
Search = '/api/im/groups/search', |
|
||||
GetById = '/api/im/groups/{groupId}', |
|
||||
} |
|
||||
|
|
||||
export const search = (input: GroupSearchRequest) => { |
|
||||
return defHttp.get<GroupPagedResult>({ |
|
||||
url: Api.Search, |
|
||||
params: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getById = (groupId: string) => { |
|
||||
return defHttp.get<Group>({ |
|
||||
url: format(Api.GetById, { groupId: groupId }), |
|
||||
}); |
|
||||
}; |
|
||||
@ -0,0 +1,15 @@ |
|||||
|
import { defHttp } from '/@/utils/http/axios'; |
||||
|
import { Group, GroupSearchRequest } from './model'; |
||||
|
|
||||
|
export const search = (input: GroupSearchRequest) => { |
||||
|
return defHttp.get<PagedResultDto<Group>>({ |
||||
|
url: '/api/im/groups/search', |
||||
|
params: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getById = (groupId: string) => { |
||||
|
return defHttp.get<Group>({ |
||||
|
url: `'/api/im/groups/${groupId}`, |
||||
|
}); |
||||
|
}; |
||||
@ -0,0 +1,14 @@ |
|||||
|
export interface Group { |
||||
|
id: string; |
||||
|
name: string; |
||||
|
avatarUrl: string; |
||||
|
allowAnonymous: boolean; |
||||
|
allowSendMessage: boolean; |
||||
|
maxUserLength: number; |
||||
|
groupUserCount: number; |
||||
|
} |
||||
|
|
||||
|
export interface GroupSearchRequest extends PagedAndSortedResultRequestDto { |
||||
|
filter: string; |
||||
|
} |
||||
|
|
||||
@ -1,35 +0,0 @@ |
|||||
import { defHttp } from '/@/utils/http/axios'; |
|
||||
import { |
|
||||
ChatMessagePagedResult, |
|
||||
LastChatMessageListResult, |
|
||||
GetUserLastMessageRequest, |
|
||||
GetUserMessagePagedRequest, |
|
||||
GetGroupMessagePagedRequest, |
|
||||
} from './model/messagesModel'; |
|
||||
|
|
||||
enum Api { |
|
||||
GetChatMessages = '/api/im/chat/my-messages', |
|
||||
GetLastMessages = '/api/im/chat/my-last-messages', |
|
||||
GetGroupMessages = '/api/im/chat/group/messages', |
|
||||
} |
|
||||
|
|
||||
export const getLastMessages = (input: GetUserLastMessageRequest) => { |
|
||||
return defHttp.get<LastChatMessageListResult>({ |
|
||||
url: Api.GetLastMessages, |
|
||||
params: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getChatMessages = (input: GetUserMessagePagedRequest) => { |
|
||||
return defHttp.get<ChatMessagePagedResult>({ |
|
||||
url: Api.GetChatMessages, |
|
||||
params: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getGroupMessages = (input: GetGroupMessagePagedRequest) => { |
|
||||
return defHttp.get<ChatMessagePagedResult>({ |
|
||||
url: Api.GetGroupMessages, |
|
||||
params: input, |
|
||||
}); |
|
||||
}; |
|
||||
@ -0,0 +1,29 @@ |
|||||
|
import { defHttp } from '/@/utils/http/axios'; |
||||
|
import { |
||||
|
GetUserLastMessageRequest, |
||||
|
GetUserMessagePagedRequest, |
||||
|
GetGroupMessagePagedRequest, |
||||
|
ChatMessage, |
||||
|
LastChatMessage, |
||||
|
} from './model'; |
||||
|
|
||||
|
export const getLastMessages = (input: GetUserLastMessageRequest) => { |
||||
|
return defHttp.get<ListResultDto<LastChatMessage>>({ |
||||
|
url: '/api/im/chat/my-last-messages', |
||||
|
params: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getChatMessages = (input: GetUserMessagePagedRequest) => { |
||||
|
return defHttp.get<PagedResultDto<ChatMessage>>({ |
||||
|
url: '/api/im/chat/my-messages', |
||||
|
params: input, |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export const getGroupMessages = (input: GetGroupMessagePagedRequest) => { |
||||
|
return defHttp.get<PagedResultDto<ChatMessage>>({ |
||||
|
url: '/api/im/chat/group/messages', |
||||
|
params: input, |
||||
|
}); |
||||
|
}; |
||||
@ -0,0 +1,70 @@ |
|||||
|
export enum MessageType { |
||||
|
Text = 0, |
||||
|
Image = 10, |
||||
|
Link = 20, |
||||
|
Video = 30, |
||||
|
Voice = 40, |
||||
|
File = 50, |
||||
|
Notifier = 100, |
||||
|
} |
||||
|
|
||||
|
export enum MessageState { |
||||
|
Send = 0, |
||||
|
Read = 1, |
||||
|
ReCall = 10, |
||||
|
Failed = 50, |
||||
|
BackTo = 100, |
||||
|
} |
||||
|
|
||||
|
export enum MessageSourceTye { |
||||
|
User = 0, |
||||
|
System = 10, |
||||
|
} |
||||
|
|
||||
|
export interface ChatMessage extends ExtensibleObject { |
||||
|
// tenantId: string;
|
||||
|
groupId?: string; |
||||
|
groupName?: string; |
||||
|
messageId: string; |
||||
|
formUserId: string; |
||||
|
formUserName: string; |
||||
|
toUserId: string; |
||||
|
content: string; |
||||
|
sendTime: Date; |
||||
|
isAnonymous: boolean; |
||||
|
messageType: MessageType; |
||||
|
source: MessageSourceTye; |
||||
|
} |
||||
|
|
||||
|
export interface LastChatMessage { |
||||
|
avatar: string; |
||||
|
object: string; |
||||
|
groupId?: string; |
||||
|
groupName?: string; |
||||
|
messageId: string; |
||||
|
formUserId: string; |
||||
|
formUserName: string; |
||||
|
toUserId: string; |
||||
|
content: string; |
||||
|
sendTime: Date; |
||||
|
isAnonymous: boolean; |
||||
|
messageType: MessageType; |
||||
|
source: MessageSourceTye; |
||||
|
} |
||||
|
|
||||
|
export interface GetUserLastMessageRequest extends LimitedResultRequestDto, SortedResultRequest { |
||||
|
state?: MessageState; |
||||
|
} |
||||
|
|
||||
|
export interface GetUserMessagePagedRequest extends PagedAndSortedResultRequestDto { |
||||
|
filter?: string; |
||||
|
receiveUserId: string; |
||||
|
messageType?: MessageType; |
||||
|
} |
||||
|
|
||||
|
export interface GetGroupMessagePagedRequest extends PagedAndSortedResultRequestDto { |
||||
|
filter?: string; |
||||
|
groupId: string; |
||||
|
messageType?: MessageType; |
||||
|
} |
||||
|
|
||||
@ -1,17 +0,0 @@ |
|||||
export enum Sex { |
|
||||
Male, |
|
||||
Female, |
|
||||
Other, |
|
||||
} |
|
||||
|
|
||||
export interface UserCard { |
|
||||
userId: string; |
|
||||
userName: string; |
|
||||
avatarUrl: string; |
|
||||
nickName: string; |
|
||||
age: number; |
|
||||
sex: Sex; |
|
||||
sign: string; |
|
||||
description: string; |
|
||||
birthday?: Date; |
|
||||
} |
|
||||
@ -1,15 +0,0 @@ |
|||||
export interface Group { |
|
||||
id: string; |
|
||||
name: string; |
|
||||
avatarUrl: string; |
|
||||
allowAnonymous: boolean; |
|
||||
allowSendMessage: boolean; |
|
||||
maxUserLength: number; |
|
||||
groupUserCount: number; |
|
||||
} |
|
||||
|
|
||||
export interface GroupSearchRequest extends PagedAndSortedResultRequestDto { |
|
||||
filter: string; |
|
||||
} |
|
||||
|
|
||||
export interface GroupPagedResult extends PagedResultDto<Group> {} |
|
||||
@ -0,0 +1,18 @@ |
|||||
|
export enum Sex { |
||||
|
Male, |
||||
|
Female, |
||||
|
Other, |
||||
|
} |
||||
|
|
||||
|
export interface UserCard { |
||||
|
userId: string; |
||||
|
userName: string; |
||||
|
avatarUrl: string; |
||||
|
nickName: string; |
||||
|
age: number; |
||||
|
sex: Sex; |
||||
|
sign: string; |
||||
|
description: string; |
||||
|
birthday?: Date; |
||||
|
} |
||||
|
|
||||
@ -1,75 +0,0 @@ |
|||||
export enum MessageType { |
|
||||
Text = 0, |
|
||||
Image = 10, |
|
||||
Link = 20, |
|
||||
Video = 30, |
|
||||
Voice = 40, |
|
||||
File = 50, |
|
||||
Notifier = 100, |
|
||||
} |
|
||||
|
|
||||
export enum MessageState { |
|
||||
Send = 0, |
|
||||
Read = 1, |
|
||||
ReCall = 10, |
|
||||
Failed = 50, |
|
||||
BackTo = 100, |
|
||||
} |
|
||||
|
|
||||
export enum MessageSourceTye { |
|
||||
User = 0, |
|
||||
System = 10, |
|
||||
} |
|
||||
|
|
||||
export interface ChatMessage extends ExtensibleObject { |
|
||||
// tenantId: string;
|
|
||||
groupId?: string; |
|
||||
groupName?: string; |
|
||||
messageId: string; |
|
||||
formUserId: string; |
|
||||
formUserName: string; |
|
||||
toUserId: string; |
|
||||
content: string; |
|
||||
sendTime: Date; |
|
||||
isAnonymous: boolean; |
|
||||
messageType: MessageType; |
|
||||
source: MessageSourceTye; |
|
||||
} |
|
||||
|
|
||||
export interface LastChatMessage { |
|
||||
avatar: string; |
|
||||
object: string; |
|
||||
groupId?: string; |
|
||||
groupName?: string; |
|
||||
messageId: string; |
|
||||
formUserId: string; |
|
||||
formUserName: string; |
|
||||
toUserId: string; |
|
||||
content: string; |
|
||||
sendTime: Date; |
|
||||
isAnonymous: boolean; |
|
||||
messageType: MessageType; |
|
||||
source: MessageSourceTye; |
|
||||
} |
|
||||
|
|
||||
export interface GetUserLastMessageRequest extends LimitedResultRequestDto, SortedResultRequest { |
|
||||
state?: MessageState; |
|
||||
} |
|
||||
|
|
||||
export interface GetUserMessagePagedRequest extends PagedAndSortedResultRequestDto { |
|
||||
filter?: string; |
|
||||
receiveUserId: string; |
|
||||
messageType?: MessageType; |
|
||||
} |
|
||||
|
|
||||
export interface GetGroupMessagePagedRequest extends PagedAndSortedResultRequestDto { |
|
||||
filter?: string; |
|
||||
groupId: string; |
|
||||
messageType?: MessageType; |
|
||||
} |
|
||||
|
|
||||
export interface ChatMessagePagedResult extends PagedResultDto<ChatMessage> {} |
|
||||
|
|
||||
export interface ChatMessageListResult extends ListResultDto<ChatMessage> {} |
|
||||
|
|
||||
export interface LastChatMessageListResult extends ListResultDto<LastChatMessage> {} |
|
||||
@ -1,69 +0,0 @@ |
|||||
export enum NotificationLifetime { |
|
||||
Persistent = 0, |
|
||||
OnlyOne = 1, |
|
||||
} |
|
||||
|
|
||||
export enum NotificationType { |
|
||||
Application = 0, |
|
||||
System = 10, |
|
||||
User = 20, |
|
||||
ServiceCallback = 30, |
|
||||
} |
|
||||
|
|
||||
export enum NotificationContentType { |
|
||||
Text = 0, |
|
||||
Html = 1, |
|
||||
Markdown = 2, |
|
||||
Json = 3, |
|
||||
} |
|
||||
|
|
||||
export enum NotificationSeverity { |
|
||||
Success = 0, |
|
||||
Info = 10, |
|
||||
Warn = 20, |
|
||||
Error = 30, |
|
||||
Fatal = 40, |
|
||||
} |
|
||||
|
|
||||
export enum NotificationReadState { |
|
||||
Read = 0, |
|
||||
UnRead = 1, |
|
||||
} |
|
||||
|
|
||||
export interface NotificationData { |
|
||||
type: string; |
|
||||
extraProperties: { [key: string]: any }; |
|
||||
} |
|
||||
|
|
||||
export interface NotificationInfo { |
|
||||
// tenantId?: string;
|
|
||||
name: string; |
|
||||
id: string; |
|
||||
data: NotificationData; |
|
||||
creationTime: Date; |
|
||||
lifetime: NotificationLifetime; |
|
||||
type: NotificationType; |
|
||||
severity: NotificationSeverity; |
|
||||
contentType: NotificationContentType; |
|
||||
} |
|
||||
|
|
||||
export interface NotificationGroup { |
|
||||
name: string; |
|
||||
displayName: string; |
|
||||
notifications: { |
|
||||
name: string; |
|
||||
displayName: string; |
|
||||
description: string; |
|
||||
type: NotificationType; |
|
||||
lifetime: NotificationLifetime; |
|
||||
}[]; |
|
||||
} |
|
||||
|
|
||||
export interface GetNotificationPagedRequest extends PagedAndSortedResultRequestDto { |
|
||||
reverse?: boolean; |
|
||||
readState?: NotificationReadState; |
|
||||
} |
|
||||
|
|
||||
export interface NotificationPagedResult extends PagedResultDto<NotificationInfo> {} |
|
||||
|
|
||||
export interface NotificationGroupListResult extends ListResultDto<NotificationGroup> {} |
|
||||
@ -1,14 +0,0 @@ |
|||||
export interface UserSubscreNotification { |
|
||||
name: string; |
|
||||
} |
|
||||
|
|
||||
export interface UserSubscriptionsResult { |
|
||||
isSubscribed: boolean; |
|
||||
} |
|
||||
|
|
||||
export interface GetSubscriptionsPagedRequest extends PagedAndSortedResultRequestDto {} |
|
||||
|
|
||||
export interface UserSubscreNotificationPagedResult |
|
||||
extends PagedResultDto<UserSubscreNotification> {} |
|
||||
|
|
||||
export interface UserSubscreNotificationListResult extends ListResultDto<UserSubscreNotification> {} |
|
||||
@ -1,48 +0,0 @@ |
|||||
import { defHttp } from '/@/utils/http/axios'; |
|
||||
import { |
|
||||
GetNotificationPagedRequest, |
|
||||
NotificationPagedResult, |
|
||||
NotificationGroupListResult, |
|
||||
NotificationReadState, |
|
||||
} from './model/notificationsModel'; |
|
||||
import { format } from '/@/utils/strings'; |
|
||||
|
|
||||
enum Api { |
|
||||
GetById = '/api/notifications/my-notifilers/{id}', |
|
||||
GetList = '/api/notifications/my-notifilers', |
|
||||
GetAssignableNotifiers = '/api/notifications/assignables', |
|
||||
Read = '/api/notifications/my-notifilers/{id}/read', |
|
||||
MarkReadState = '/api/notifications/my-notifilers/mark-read-state', |
|
||||
} |
|
||||
|
|
||||
export const markReadState = ( |
|
||||
ids: string[], |
|
||||
state: NotificationReadState = NotificationReadState.Read, |
|
||||
) => { |
|
||||
return defHttp.put<void>({ |
|
||||
url: Api.MarkReadState, |
|
||||
data: { |
|
||||
idList: ids, |
|
||||
state: state, |
|
||||
}, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const deleteById = (id: string) => { |
|
||||
return defHttp.delete<void>({ |
|
||||
url: format(Api.GetById, { id: id }), |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getList = (input: GetNotificationPagedRequest) => { |
|
||||
return defHttp.get<NotificationPagedResult>({ |
|
||||
url: Api.GetList, |
|
||||
params: input, |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
export const getAssignableNotifiers = () => { |
|
||||
return defHttp.get<NotificationGroupListResult>({ |
|
||||
url: Api.GetAssignableNotifiers, |
|
||||
}); |
|
||||
}; |
|
||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue